build(python): Add support for NumPy 2.0 #17384
Merged
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.
Closes #16998
Changes
numpy
crate in Cargo.toml to a git commit that includes NumPy 2.0 support. The git commit is based on Add support for Numpy 2.x PyO3/rust-numpy#429 and includes a minor fix to enable Windows support.< 2.0.0
version constraint for NumPy dependencyWe are dependent on the
numpy
crate for NumPy support. There is a PR open that adds NumPy 2.0 support, however, it is still in review. We understand that reviews in open source take time, since we are open source maintainers ourselves. However, due to the great impact on our users, we elect to build Polars based off of that PR. This passes our full test suite, both on NumPy 1.26 and 2.0.