Skip to content

Commit 40fb106

Browse files
ci: update build system for numpy 2.0
1 parent be57251 commit 40fb106

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/build_wheel.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
uses: ssrobins/install-cmake@v1
2929

3030
- name: Build wheels
31-
uses: pypa/cibuildwheel@v2.16.5
31+
uses: pypa/cibuildwheel@v2.19.1
3232
# to supply options, put them in 'env', like:
3333
env:
34-
CIBW_BEFORE_BUILD: git submodule init && git submodule update && pip install cython oldest-supported-numpy scikit-build
34+
CIBW_BEFORE_BUILD: git submodule init && git submodule update && pip install cython numpy scikit-build
3535
CPPFLAGS: -I/usr/local/opt/zlib/include
3636
LDFLAGS: -L/usr/local/opt/zlib/lib
3737
CIBW_ARCHS_MACOS: "x86_64 arm64"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ requires = [
33
"setuptools",
44
"scikit-build >= 0.9.0",
55
"wheel",
6-
"oldest-supported-numpy"
6+
"numpy"
77
]

setup.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@
88
from skbuild.exceptions import SKBuildError
99
from skbuild.cmaker import get_cmake_version
1010

11-
import numpy as np
1211
import multiprocessing as mp
1312

13+
class NumpyImport:
14+
def __repr__(self):
15+
import numpy as np
16+
17+
return np.get_include()
18+
19+
__fspath__ = __repr__
20+
21+
1422
if not "CMAKE_BUILD_PARALLEL_LEVEL" in os.environ:
1523
os.environ["CMAKE_BUILD_PARALLEL_LEVEL"] = str(mp.cpu_count())
1624

@@ -90,7 +98,7 @@ def read(fname):
9098
depends=[ os.path.join(src_dir, 'DracoPy.h') ],
9199
language='c++',
92100
include_dirs = [
93-
np.get_include(),
101+
str(NumpyImport()),
94102
os.path.join(CMAKE_INSTALL_DIR(), 'include/'),
95103
],
96104
extra_compile_args=extra_compile_args,

0 commit comments

Comments
 (0)