summaryrefslogtreecommitdiff
path: root/numpy/core/setup_common.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastianb@nvidia.com>2023-04-04 14:58:33 +0200
committerSebastian Berg <sebastianb@nvidia.com>2023-04-04 17:17:17 +0200
commit6309cf291ca806f554723d659777acca46cdad1f (patch)
tree03451e061b5324367557ad87bde62648f64680f9 /numpy/core/setup_common.py
parent95eeb2a45f76062bcf77101fcd14067ca8075166 (diff)
downloadnumpy-6309cf291ca806f554723d659777acca46cdad1f.tar.gz
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!
Diffstat (limited to 'numpy/core/setup_common.py')
-rw-r--r--numpy/core/setup_common.py5
1 files changed, 5 insertions, 0 deletions
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