-
Notifications
You must be signed in to change notification settings - Fork 153
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
Pin Numpy < 2 in requirements #1012
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We have compiled extensions that are built against the Numpy C API. The Numpy transition guide for developers of downstream packages[1] encourages us to put in this pin until we have wheels built against the newer version, which is not expected to be fully ABI compatible (but extensions built against Numpy 2 _should_ work with older versions of Numpy). Note that this won't prevent package managers from resolving _older_ versions of rustworkx (which don't have the pin) along with Numpy 2, but there's not a vast amount we can do about that now. Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
IvanIsCoding
approved these changes
Oct 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pull Request Test Coverage Report for Build 6580899183
💛 - Coveralls |
mtreinish
added a commit
to mtreinish/retworkx
that referenced
this pull request
Apr 24, 2024
In Qiskit#1012 we added an upper version cap to numpy to prevent it from installing numpy 2.0 before we confirmed that rustworkx was compatible with it. Now that numpy 2.0.0rc1 has been released we're able to confirm that rustworkx works fine with numpy 2.0. This commit raises the upper bound on the numpy version to < 3 to enable installing numpy 2.0 with rustworkx.
IvanIsCoding
added a commit
that referenced
this pull request
Apr 27, 2024
* Relax numpy upper version cap In #1012 we added an upper version cap to numpy to prevent it from installing numpy 2.0 before we confirmed that rustworkx was compatible with it. Now that numpy 2.0.0rc1 has been released we're able to confirm that rustworkx works fine with numpy 2.0. This commit raises the upper bound on the numpy version to < 3 to enable installing numpy 2.0 with rustworkx. * Handle new __array__ API in numpy 2.0 While we didn't have any test coverage for this looking at the numpy 2.0 migration guide one thing we'll have to handle is the new copy kwarg on array: https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword This commit updates the sole use of __array__ we have on custom sequence return types so that if copy=False is passed in we raise a ValueError. Additionally, the dtype handling is done directly in the rustworkx code now to ensure we don't have any issues with numpy 2.0. * Fix __array__ stubs * Update src/iterators.rs * Pin ruff to 0.4.1 --------- Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We have compiled extensions that are built against the Numpy C API. The Numpy transition guide for developers of downstream packages[1] encourages us to put in this pin until we have wheels built against the newer version, which is not expected to be fully ABI compatible (but extensions built against Numpy 2 should work with older versions of Numpy).
Note that this won't prevent package managers from resolving older versions of rustworkx (which don't have the pin) along with Numpy 2, but there's not a vast amount we can do about that now.