diff --git a/pyproject.toml b/pyproject.toml index ed4d599..fb4cfe1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] diff --git a/setup.py b/setup.py index 535b2be..74a5c4f 100644 --- a/setup.py +++ b/setup.py @@ -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, @@ -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++", ), @@ -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}, ), )