From 796d3cfef09e54630a7db305d3bf4e3ff7f828a9 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Thu, 20 Jul 2023 11:14:05 +0200 Subject: [PATCH] Update numpy build constraints for numpy 1.25 (#53) Starting in numpy 1.25 (see https://github.com/numpy/numpy/releases/tag/v1.25.0), the numpy C API is backwards-compatible by default. For python 3.9+, we should be able to drop the specific numpy build requirements and use `numpy>=1.25`, which is currently backwards-compatible to `numpy>=1.19`. In the future, the python <3.9 requirements could be dropped and the lower numpy pin could correspond to the oldest supported version for the current lower python pin. --- build-constraints.txt | 5 +---- pyproject.toml | 5 +++-- requirements.txt | 2 ++ setup.cfg | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build-constraints.txt b/build-constraints.txt index c1e82f1..5540d63 100644 --- a/build-constraints.txt +++ b/build-constraints.txt @@ -3,7 +3,4 @@ numpy==1.15.0; python_version<='3.7' and platform_machine!='aarch64' numpy==1.19.2; python_version<='3.7' and platform_machine=='aarch64' numpy==1.17.3; python_version=='3.8' and platform_machine!='aarch64' numpy==1.19.2; python_version=='3.8' and platform_machine=='aarch64' -numpy==1.19.3; python_version=='3.9' -numpy==1.21.3; python_version=='3.10' -numpy==1.23.2; python_version=='3.11' -numpy; python_version>='3.12' +numpy>=1.25.0; python_version>='3.9' diff --git a/pyproject.toml b/pyproject.toml index 8aa3a6f..c57e380 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ requires = [ "setuptools", "wheel", "Cython<3.0", - "spacy>=3.3.0,<3.6.0", - "numpy", + "spacy>=3.3.0,<3.7.0", + "numpy>=1.15.0; python_version < '3.9'", + "numpy>=1.25.0; python_version >= '3.9'", ] diff --git a/requirements.txt b/requirements.txt index 0c935d3..ec9e818 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ spacy>=3.3.0,<3.7.0 +numpy>=1.15.0; python_version < "3.9" +numpy>=1.19.0; python_version >= "3.9" # Development dependencies cython>=0.25,<3.0 diff --git a/setup.cfg b/setup.cfg index 05b5077..cb3d2f3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,6 +14,8 @@ zip_safe = false python_requires = >=3.6 install_requires = spacy>=3.3.0,<3.7.0 + numpy>=1.15.0; python_version < "3.9" + numpy>=1.19.0; python_version >= "3.9" [options.entry_points] spacy_architectures =