From c17b2f28d71ce74fc7ab9014ff8f3a1c727ff90a Mon Sep 17 00:00:00 2001 From: yut23 Date: Tue, 7 May 2024 13:00:02 -0400 Subject: [PATCH 1/5] BLD: fix bleeding-edge build script --- .github/workflows/bleeding-edge.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bleeding-edge.yaml b/.github/workflows/bleeding-edge.yaml index 0807341e489..4b7a24db260 100644 --- a/.github/workflows/bleeding-edge.yaml +++ b/.github/workflows/bleeding-edge.yaml @@ -61,6 +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_clib -q python setup.py build_ext -q -j2 python -m pip install -e .[test] --no-build-isolation From 38c3f1830755c40076f6c58ce499acaa72c5d8aa Mon Sep 17 00:00:00 2001 From: yut23 Date: Tue, 7 May 2024 13:00:46 -0400 Subject: [PATCH 2/5] BLD: disable deprecated numpy API for fixed_interpolator clib --- setup.py | 2 ++ setupext.py | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index f1d547b1839..2c49b693b37 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,7 @@ create_build_ext, get_python_include_dirs, install_ccompiler, + NUMPY_MACROS, ) install_ccompiler() @@ -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, }, ) diff --git a/setupext.py b/setupext.py index cf5af628123..a9aafdbbf99 100644 --- a/setupext.py +++ b/setupext.py @@ -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 @@ -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 From 70832cc67a13bc2e454e3f27a4c976b5e3f29591 Mon Sep 17 00:00:00 2001 From: yut23 Date: Tue, 7 May 2024 14:23:24 -0400 Subject: [PATCH 3/5] Fix import sorting --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2c49b693b37..56a26ef1f0b 100644 --- a/setup.py +++ b/setup.py @@ -7,13 +7,13 @@ from setuptools import Distribution, setup from setupext import ( + NUMPY_MACROS, check_CPP14_flags, check_for_openmp, check_for_pyembree, create_build_ext, get_python_include_dirs, install_ccompiler, - NUMPY_MACROS, ) install_ccompiler() From 7eea5d18320ff1c1aca05f14647c2b731b2780ff Mon Sep 17 00:00:00 2001 From: yut23 Date: Tue, 7 May 2024 16:04:55 -0400 Subject: [PATCH 4/5] Remove setup.py calls in bleeding-edge workflow --- .github/workflows/bleeding-edge.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/bleeding-edge.yaml b/.github/workflows/bleeding-edge.yaml index 4b7a24db260..3567465440c 100644 --- a/.github/workflows/bleeding-edge.yaml +++ b/.github/workflows/bleeding-edge.yaml @@ -61,9 +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_clib -q - 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 From a73fc924df30cc6bf9c970f2a42ea12af62df683 Mon Sep 17 00:00:00 2001 From: yut23 Date: Tue, 7 May 2024 16:10:10 -0400 Subject: [PATCH 5/5] Add build_clib to setup.py call in `yt update` --- yt/funcs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt/funcs.py b/yt/funcs.py index 94547af0916..f63b5f73fc6 100644 --- a/yt/funcs.py +++ b/yt/funcs.py @@ -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,