Skip to content

Commit d43a292

Browse files
committed
pep517 build backend
1 parent fde002a commit d43a292

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
include RELEASE.md
22
include versioneer.py
3+
include CMakeLists.txt
34

45
graft doc
56
prune doc/build
67

78
graft LICENSES
89

910
graft pandas
11+
graft build_support
1012

1113
global-exclude *.bz2
1214
global-exclude *.csv

build_support/build_backend.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import pathlib
2+
import subprocess
3+
4+
from setuptools import build_meta as _orig
5+
6+
prepare_metadata_for_build_wheel = _orig.prepare_metadata_for_build_wheel
7+
build_sdist = _orig.build_sdist
8+
get_requires_for_build_wheel = _orig.get_requires_for_build_wheel
9+
get_requires_for_build_sdist = _orig.get_requires_for_build_sdist
10+
11+
12+
def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
13+
filedir = pathlib.Path(__file__).resolve().parent.parent
14+
subprocess.run(["cmake", "."], cwd=filedir, check=True)
15+
subprocess.run(
16+
["cmake", "--build", ".", "--config", "Release", "--parallel"],
17+
cwd=filedir,
18+
check=True,
19+
)
20+
21+
return _orig.build_wheel(wheel_directory, config_settings, metadata_directory)

pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ requires = [
88
"Cython>=0.29.24,<3", # Note: sync with setup.py, environment.yml and asv.conf.json
99
"oldest-supported-numpy>=0.10"
1010
]
11-
# uncomment to enable pep517 after versioneer problem is fixed.
12-
# https://github.com/python-versioneer/python-versioneer/issues/193
13-
# build-backend = "setuptools.build_meta"
11+
12+
build-backend = "build_backend"
13+
backend-path = ["build_support"]
1414

1515
[tool.black]
1616
target-version = ['py38', 'py39']

setup.py

+6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
(https://github.com/zeromq/pyzmq) which have been permitted for use under the
66
BSD license. Parts are from lxml (https://github.com/lxml/lxml)
77
"""
8+
import os
9+
import sys
10+
811
from setuptools import setup
912

13+
# uncomment to enable pep517 after versioneer problem is fixed.
14+
# https://github.com/python-versioneer/python-versioneer/issues/193
15+
sys.path.insert(0, os.path.dirname(__file__))
1016
import versioneer
1117

1218
cmdclass = versioneer.get_cmdclass()

0 commit comments

Comments
 (0)