Skip to content

Commit

Permalink
Merge pull request #4898 from yut23/fix-bleeding-edge
Browse files Browse the repository at this point in the history
BLD: fix bleeding-edge build script
  • Loading branch information
neutrinoceros authored May 11, 2024
2 parents 1199df6 + a73fc92 commit 0a865a3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/bleeding-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ jobs:
# are not installed by pip as specified from pyproject.toml, hence we get
# to use the dev version of numpy at build time.
run: |
python setup.py build_ext -q -j2
python -m pip install -e .[test] --no-build-isolation
python -m pip -v install -e .[test] --no-build-isolation
- run: python -m pip list

Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from setuptools import Distribution, setup

from setupext import (
NUMPY_MACROS,
check_CPP14_flags,
check_for_openmp,
check_for_pyembree,
Expand Down Expand Up @@ -111,6 +112,7 @@ def has_ext_modules(self):
{
"sources": ["yt/utilities/lib/fixed_interpolator.cpp"],
"include_dirs": clib_include_dirs,
"define_macros": NUMPY_MACROS,
},
)

Expand Down
13 changes: 8 additions & 5 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,13 @@ def get_python_include_dirs():
return include_dirs


NUMPY_MACROS = [
("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"),
# keep in sync with runtime requirements (pyproject.toml)
("NPY_TARGET_VERSION", "NPY_1_19_API_VERSION"),
]


def create_build_ext(lib_exts, cythonize_aliases):
class build_ext(_build_ext):
# subclass setuptools extension builder to avoid importing cython and numpy
Expand Down Expand Up @@ -425,11 +432,7 @@ def finalize_options(self):
self.include_dirs.append(numpy.get_include())
self.include_dirs.append(ewah_bool_utils.get_include())

define_macros = [
("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"),
# keep in sync with runtime requirements (pyproject.toml)
("NPY_TARGET_VERSION", "NPY_1_19_API_VERSION"),
]
define_macros = NUMPY_MACROS

if self.define is None:
self.define = define_macros
Expand Down
2 changes: 1 addition & 1 deletion yt/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def update_git(path):
def rebuild_modules(path, f):
f.write("Rebuilding modules\n\n")
p = subprocess.Popen(
[sys.executable, "setup.py", "build_ext", "-i"],
[sys.executable, "setup.py", "build_clib", "build_ext", "-i"],
cwd=path,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
Expand Down

0 comments on commit 0a865a3

Please sign in to comment.