Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLD: fix bleeding-edge build script #4898

Merged
merged 5 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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