Skip to content

Commit e2a9344

Browse files
committed
Still too soon to rely exclusively on Cython 3
1 parent 3b30935 commit e2a9344

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

setup.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,37 @@ def compile_cython_extensions():
4848
compile_cython_extensions()
4949

5050
INCLUDE_DIRS = [SRCPATH, numpy.get_include()]
51-
DEFINE_MACROS = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
51+
52+
# -------------------------------------------------------------------------------------
53+
# TODO: When dropping support for Cython < 3.0, we can remove the following line
54+
# and uncomment the next one.
55+
# In the meantime, we should not be worried about the deprecation warnings when
56+
# building the package.
57+
DEFINE_MACROS_CYTHON = []
58+
# DEFINE_MACROS_CYTHON = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
59+
# -------------------------------------------------------------------------------------
60+
61+
DEFINE_MACROS_CPP = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
5262

5363
setup(
5464
ext_modules=[
5565
Extension(
5666
name=f"{LIBNAME}.mandelbrot",
5767
sources=[osp.join(SRCPATH, "mandelbrot.c")],
5868
include_dirs=INCLUDE_DIRS,
59-
define_macros=DEFINE_MACROS,
69+
define_macros=DEFINE_MACROS_CYTHON,
6070
),
6171
Extension(
6272
name=f"{LIBNAME}.histogram2d",
6373
sources=[osp.join(SRCPATH, "histogram2d.c")],
6474
include_dirs=INCLUDE_DIRS,
65-
define_macros=DEFINE_MACROS,
75+
define_macros=DEFINE_MACROS_CYTHON,
6676
),
6777
Extension(
6878
name=f"{LIBNAME}.contour2d",
6979
sources=[osp.join(SRCPATH, "contour2d.c")],
7080
include_dirs=INCLUDE_DIRS,
71-
define_macros=DEFINE_MACROS,
81+
define_macros=DEFINE_MACROS_CYTHON,
7282
),
7383
Extension(
7484
name=f"{LIBNAME}._scaler",
@@ -82,7 +92,7 @@ def compile_cython_extensions():
8292
osp.join(SRCPATH, "debug.hpp"),
8393
],
8494
include_dirs=INCLUDE_DIRS,
85-
define_macros=DEFINE_MACROS,
95+
define_macros=DEFINE_MACROS_CPP,
8696
),
8797
]
8898
)

0 commit comments

Comments
 (0)