From 443e291aec8ad7bb78b5488b000ddc75546bf49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Fri, 28 Jul 2023 10:54:42 +0200 Subject: [PATCH] BLD: forbid deprecated numpy C API --- setupext.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setupext.py b/setupext.py index 006bb582af2..59110fd6d21 100644 --- a/setupext.py +++ b/setupext.py @@ -409,6 +409,12 @@ 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")] + if self.define is None: + self.define = define_macros + else: + self.define.extend(define_macros) + def build_extensions(self): self.check_extensions_list(self.extensions)