Add NumPy upper-bound pin for Python 3.14 compatibility #1170
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a Python 3.14–specific NumPy version constraint in pyproject.toml to fix dependency resolution failures when installing opencv-python on Python 3.14.
Issue: #1165 – Installation fails on Python 3.14 because no compatible NumPy version is selected during build dependency resolution.
Changes
Added an environment marker in pyproject.toml to require numpy>=2.1.3,<2.2 for python_version >= '3.14'.
Preserves existing dependency behavior for Python 3.8–3.13.
No changes to setup.py; the fix is fully compliant with PEP 518 and modern packaging standards.
Testing
Verified dependency resolution using pip install --dry-run -e ..
Confirmed that the new marker does not affect installation on supported Python versions (3.8–3.13).
The pinned NumPy version (2.1.3) is published on PyPI and declares Python 3.14 support via classifiers.
This minimal, forward-compatible change ensures opencv-python remains installable as Python 3.14 adoption begins.