Skip to content

Commit

Permalink
ci: update build system for numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Aug 8, 2024
1 parent be57251 commit 40fb106
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
uses: ssrobins/install-cmake@v1

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.19.1
# to supply options, put them in 'env', like:
env:
CIBW_BEFORE_BUILD: git submodule init && git submodule update && pip install cython oldest-supported-numpy scikit-build
CIBW_BEFORE_BUILD: git submodule init && git submodule update && pip install cython numpy scikit-build
CPPFLAGS: -I/usr/local/opt/zlib/include
LDFLAGS: -L/usr/local/opt/zlib/lib
CIBW_ARCHS_MACOS: "x86_64 arm64"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ requires = [
"setuptools",
"scikit-build >= 0.9.0",
"wheel",
"oldest-supported-numpy"
"numpy"
]
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@
from skbuild.exceptions import SKBuildError
from skbuild.cmaker import get_cmake_version

import numpy as np
import multiprocessing as mp

class NumpyImport:
def __repr__(self):
import numpy as np

return np.get_include()

__fspath__ = __repr__


if not "CMAKE_BUILD_PARALLEL_LEVEL" in os.environ:
os.environ["CMAKE_BUILD_PARALLEL_LEVEL"] = str(mp.cpu_count())

Expand Down Expand Up @@ -90,7 +98,7 @@ def read(fname):
depends=[ os.path.join(src_dir, 'DracoPy.h') ],
language='c++',
include_dirs = [
np.get_include(),
str(NumpyImport()),
os.path.join(CMAKE_INSTALL_DIR(), 'include/'),
],
extra_compile_args=extra_compile_args,
Expand Down

0 comments on commit 40fb106

Please sign in to comment.