From 6309cf291ca806f554723d659777acca46cdad1f Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Tue, 4 Apr 2023 14:58:33 +0200 Subject: BLD: Add support for NPY_TARGET_VERSION macro This is a way for downstream users to specify which NumPy version they wish to be compaible with. Note that we provide a conservative default here (because almost nobody actually uses new API as they would lose backwards compatibility). Initially I had thought we should just redefine it so that the target version uses the same scheme as the Python hex version (and limited API), but since we have `NPY_1_15_API_VERSION` defines, use those... This commit does not include any actual use of this! --- numpy/core/setup_common.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'numpy/core/setup_common.py') diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py index ef8d21fa7..af8eeecde 100644 --- a/numpy/core/setup_common.py +++ b/numpy/core/setup_common.py @@ -50,6 +50,11 @@ C_ABI_VERSION = 0x01000009 # 0x00000010 - 1.24.x C_API_VERSION = 0x00000010 +# When compiling against NumPy (downstream libraries), NumPy will by default +# pick an older feature version. For example, for 1.25.x we default to the +# 1.17 API and support going back all the way to 1.15.x (if so desired). +# This is set up in `numpyconfig.h`. + class MismatchCAPIError(ValueError): pass -- cgit v1.2.1