Skip to content

Commit

Permalink
BLD: switch to Cython 3.0, forbid deprecated Numpy C API in generated…
Browse files Browse the repository at this point in the history
… code
  • Loading branch information
neutrinoceros committed Jul 28, 2023
1 parent 6b831a8 commit 6b7f859
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = [
"setuptools>=61.2",
"Cython>=0.29.22,<3.0",

# see https://github.com/yt-project/ewah_bool_utils/issues/52
"Cython>=3.0, <3.1",
"oldest-supported-numpy",
# see https://github.com/numpy/numpy/pull/18389
"wheel>=0.36.2",
]

[project]
Expand Down
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@
else:
std_libs = ["m"]

define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]

extensions = [
Extension(
"ewah_bool_utils.ewah_bool_wrap",
["ewah_bool_utils/ewah_bool_wrap.pyx"],
define_macros=define_macros,
include_dirs=["ewah_bool_utils", "ewah_bool_utils/cpp", np.get_include()],
language="c++",
),
Extension(
"ewah_bool_utils.morton_utils",
["ewah_bool_utils/morton_utils.pyx"],
define_macros=define_macros,
extra_compile_args=omp_args,
extra_link_args=omp_args,
libraries=std_libs,
Expand All @@ -35,6 +39,7 @@
"ewah_bool_utils._testing",
["ewah_bool_utils/_testing.pyx"],
include_dirs=["ewah_bool_utils", "ewah_bool_utils/cpp", np.get_include()],
define_macros=define_macros,
extra_compile_args=["-O3"],
language="c++",
),
Expand All @@ -44,8 +49,6 @@
setup(
ext_modules=cythonize(
extensions,
compiler_directives={
"language_level": 3 # this option can be removed when Cython >= 3.0 is required
},
compiler_directives={"language_level": 3},
),
)

0 comments on commit 6b7f859

Please sign in to comment.