diff --git a/setup.py b/setup.py index 4d071ff..b28af7b 100755 --- a/setup.py +++ b/setup.py @@ -26,12 +26,17 @@ # MSVC does not understand -std=c11 and only warns about it. extra_compile_args = [] if sys.platform == "win32" else ["-std=c11"] +# Pin the numpy C API level, so that a future numpy removing an already +# deprecated API is a compile error here rather than a surprise at runtime. +define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] + extensions = [ Extension( "extinction._extinction", source_files, include_dirs=include_dirs, depends=depends_files, + define_macros=define_macros, extra_compile_args=extra_compile_args, ) ]