From b39279caa5c93991e77416e12b3c0183bdda757c Mon Sep 17 00:00:00 2001 From: Agis Kounelis Date: Mon, 17 Jun 2024 18:57:32 +0300 Subject: [PATCH] Fix numpy versions --- misc/requirements_wheel.txt | 13 ++++--------- pyproject.toml | 19 +++++++++++++++++-- requirements.txt | 8 ++++---- requirements_dev.txt | 5 ++++- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/misc/requirements_wheel.txt b/misc/requirements_wheel.txt index e0fa24d1e4..38c6fc6709 100644 --- a/misc/requirements_wheel.txt +++ b/misc/requirements_wheel.txt @@ -1,12 +1,7 @@ -# numpy pinning for ABI forward-compatibility -numpy==1.16.5 ; python_version < "3.8" and platform_machine !='aarch64' -numpy==1.17.* ; python_version == "3.8" and platform_machine !='aarch64' -numpy==1.19.4 ; python_version == "3.9" and platform_machine !='aarch64' - -# NOTE: oldest-supported-numpy (1.19.2) had forward ABI compat problems -numpy==1.20.* ; python_version < "3.10" and platform_machine=='aarch64' -numpy==1.21.* ; python_version == "3.10" -numpy>=1.23.2 ; python_version >= "3.11" +numpy==1.17.*,<2.0 ; python_version == '3.8' and platform_machine not in 'arm64|aarch64' +numpy==1.19.*,<2.0 ; python_version == '3.8' and platform_machine == 'aarch64' +numpy==1.21.*,<2.0 ; python_version == '3.8' and platform_machine == 'arm64' +numpy>=1.25,<2.0 ; python_version >= '3.9' #------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 23a282ffa3..3031201b9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,14 @@ [build-system] -requires = ["setuptools>=64", "wheel", "pybind11", "Cython"] +requires = [ + "setuptools>=64", + "wheel", + "pybind11", + "Cython", + "numpy==1.17.*,<2.0 ; python_version == '3.8' and platform_machine not in 'arm64|aarch64'", + "numpy==1.19.*,<2.0 ; python_version == '3.8' and platform_machine == 'aarch64'", + "numpy==1.21.*,<2.0 ; python_version == '3.8' and platform_machine == 'arm64'", + "numpy>=1.25,<2.0 ; python_version >= '3.9'", +] build-backend = "setuptools.build_meta" [project] @@ -33,7 +42,13 @@ classifiers=[ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", ] -dynamic = ["version", "dependencies"] +dependencies = [ + "numpy>=1.17,<2.0 ; python_version == '3.8' and platform_machine not in 'arm64|aarch64'", + "numpy>=1.19,<2.0 ; python_version == '3.8' and platform_machine == 'aarch64'", + "numpy>=1.21,<2.0 ; python_version == '3.8' and platform_machine == 'arm64'", + "numpy>=1.25,<2.0 ; python_version >= '3.9'", +] +dynamic = ["version"] [tool.setuptools.packages.find] exclude = ["*.pyc", ".pytest_cache/*", ".hypothesis/*"] diff --git a/requirements.txt b/requirements.txt index d2b5c38fce..07805d6e55 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -numpy>=1.16.5 ; python_version < "3.10" and platform_machine != 'aarch64' -numpy>=1.19.2 ; python_version < "3.10" and platform_machine == 'aarch64' -numpy>=1.21.0 ; python_version == "3.10" -numpy>=1.23.2 ; python_version >= "3.11" +numpy>=1.17,<2.0 ; python_version == '3.8' and platform_machine not in 'arm64|aarch64' +numpy>=1.19,<2.0 ; python_version == '3.8' and platform_machine == 'aarch64' +numpy>=1.21,<2.0 ; python_version == '3.8' and platform_machine == 'arm64' +numpy>=1.25,<2.0 ; python_version >= '3.9' packaging contextvars ;python_version<"3.7" diff --git a/requirements_dev.txt b/requirements_dev.txt index b0eae167ee..9fd97193c1 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,7 @@ -numpy >= 1.16.5 +numpy>=1.17,<2.0 ; python_version == '3.8' and platform_machine not in 'arm64|aarch64' +numpy>=1.19,<2.0 ; python_version == '3.8' and platform_machine == 'aarch64' +numpy>=1.21,<2.0 ; python_version == '3.8' and platform_machine == 'arm64' +numpy>=1.25,<2.0 ; python_version >= '3.9' # ------------------------------------------------ # ** MUST sync with misc/requirements_wheel.txt **