-
Notifications
You must be signed in to change notification settings - Fork 229
Support numpy 2.x #6899
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
Support numpy 2.x #6899
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6899 +/- ##
==========================================
- Coverage 79.14% 79.13% -0.01%
==========================================
Files 565 565
Lines 43394 43394
==========================================
- Hits 34342 34334 -8
- Misses 9052 9060 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Hmm, looks like updating numpy in the lockfile had a cascading effect, here's the relevant diff
@@ -43,7 +44,8 @@ dependencies = [
{ name = "kiwipy", extra = ["rmq"] },
- { name = "numpy" },
+ { name = "numpy", version = "2.0.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" },
+ { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" },
{ name = "paramiko" },
{ name = "pgsu" },
I just ran uv lock --upgrade-package numpy
46b4c88
to
6fccd76
Compare
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.
I here trust uv doing the right thing (and the tests picking up bugs due to numpy changes), the changes in environment.yml and pyproject.toml seem fine.
@danielhollas I am a bit concerned that in the future we might add functionalities that are only v2 only. By theses changes there are no tests anymore for numpy v1. Isn't it better to still test with v1 and use the ruff linting rule https://docs.astral.sh/ruff/rules/numpy2-deprecation/ to test if we use functionalities that are deprecated in v2? |
That's a fair point, but your concern is not actually specific to numpy, in principle we have the same issue for all packages. Fortunately, uv resolver has an option where you can run it so that it picks the minimum versions (instead of higher versions). So I would suggest we add a new test job that will cover this. I am happy to do it. I would prefer to do it in a separate PR and merge this one ASAP, as I think it would be beneficial if people started testing with numpy 2.0.
Good idea! LMK if you want me to do that here or in a new PR. |
Ah, I see you've already done that, thanks! |
ok! will change to numpy v1, run CI and then merge. |
@giovannipizzi mentioned to check if we align with official numpy recommandation guidelines for software dependencies as menitoned in AEP 003, referencing NEP 0029 which was superseeded by SPEC 0000. Anyway topic for another PR EDIT: It is now issue #6933 |
Looks like numpy 2.x just....works?
(we should still probably wait before merging this until after release 2.7 just to be on the safe side, and we can then release in
2.7.1
?)See #6898
Warning from docs build, no idea where it comes from since we don't reference
numpy.bool
anywhere. I've addednumpy.bool
tonitpicks-exceptions