From 19a9c9b97e87567d4e2f1f99cacbb149800d16fb Mon Sep 17 00:00:00 2001 From: Mulham Fetna Date: Sat, 9 May 2026 20:47:59 +0300 Subject: [PATCH 1/2] fix: add explicit NumPy version constraints for Python 3.13+ and 3.14 - Changed install_requires to specify minimum numpy versions per Python version: - Python 3.9-3.12: numpy>=2.0.2 - Python 3.13: numpy>=2.1.3 - Python 3.14+: numpy>=2.3.0 - This fixes NumPy 2.x ABI compatibility issue where wheels compiled against NumPy 1.x fail at runtime with NumPy 2.x Fixes opencv/opencv-python#1201 --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d0c57b480..952f37ce8 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,9 @@ def main(): install_requires = [ 'numpy<2.0; python_version<"3.9"', - 'numpy>=2; python_version>="3.9"', + 'numpy>=2.0.2; python_version>="3.9" and python_version<"3.13"', + 'numpy>=2.1.3; python_version>="3.13" and python_version<"3.14"', + 'numpy>=2.3.0; python_version>="3.14"', ] python_version = cmaker.CMaker.get_python_version() From 40f1b58ca7ffb078d6fa8e19ce8dfeb94ef70313 Mon Sep 17 00:00:00 2001 From: Mulham Fetna Date: Sat, 22 Aug 2026 12:38:36 +0300 Subject: [PATCH 2/2] Relax NumPy lower bounds to minor versions per review Address review feedback from @Avasam: the patch-level pins were unnecessarily specific. Lower bounds now track the first NumPy release providing wheels for each interpreter: - numpy 2.1.0 is the first release with cp313 wheels - numpy 2.3.2 is the first release with cp314 wheels (2.3.0 and 2.3.1 ship none), so the Python 3.14 floor stays at the patch level --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 952f37ce8..7d1655c4f 100755 --- a/setup.py +++ b/setup.py @@ -24,9 +24,9 @@ def main(): install_requires = [ 'numpy<2.0; python_version<"3.9"', - 'numpy>=2.0.2; python_version>="3.9" and python_version<"3.13"', - 'numpy>=2.1.3; python_version>="3.13" and python_version<"3.14"', - 'numpy>=2.3.0; python_version>="3.14"', + 'numpy>=2.0; python_version>="3.9" and python_version<"3.13"', + 'numpy>=2.1; python_version>="3.13" and python_version<"3.14"', + 'numpy>=2.3.2; python_version>="3.14"', ] python_version = cmaker.CMaker.get_python_version()