Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Numpy 2.0 for Python 3.9+ packages #1002

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

asmorkalov
Copy link
Collaborator

@asmorkalov asmorkalov commented Jun 17, 2024

Numpy 2.0 is backward compatible with 1.x, but introduce several API and ABI changes. Numpy authors claim, that packages built against Numpy 2.0 should work with 1.x too. The PR introduce additional packages built with Python 3.9 and Numpy 2.0.

Numpy release details: https://github.com/numpy/numpy/releases/tag/v2.0.0

The PR differs from #1001. It builds packages with limited API cp37, but with Python 3.9 and Numpy 2.0. It's expected that the package should work with all supported Pythons 3.7+ and Numpy 1.x and 2.x.

@asmorkalov asmorkalov changed the title WIP: Alternative solution to use Numpy 2.0 for Python 3.9+ packages Use Numpy 2.0 for Python 3.9+ packages Jun 17, 2024
@@ -4,13 +4,9 @@ requires = [
"numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
"numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
"numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
"numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need explicit <2 in setup.py for Python 3.8 and earlier in case of possible expanding of numpy2 releases.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would clarify the actual state, but the current version works as well since numpy itself has python_requires>=3.9, so numpy 2.0 and later cannot be installed with older Python versions.

The added constraints here look good to me.

Copy link
Collaborator

@sergregory sergregory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@caldempsey
Copy link

🙏

@asmorkalov asmorkalov merged commit cce7c99 into opencv:4.x Jun 17, 2024
185 of 189 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants