-
Notifications
You must be signed in to change notification settings - Fork 652
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
Build wheels with numpy 1.25+ #4198
Conversation
Linter Bot Results:Hi @IAlibay! Thanks for making this PR. We linted your code and found the following: There are currently no issues detected! 🎉 |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## develop #4198 +/- ##
===========================================
- Coverage 93.62% 93.41% -0.21%
===========================================
Files 179 183 +4
Lines 24199 23306 -893
Branches 4064 4064
===========================================
- Hits 22657 21772 -885
+ Misses 1026 1018 -8
Partials 516 516 ☔ View full report in Codecov by Sentry. |
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.
Looks good to me @IAlibay
I mean it still needs a lot of changes / work.. I wouldn't prematurely approve it. |
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 don't feel knowledgeable to approve here — all I would do is look if the CI is still green. I assume that NEP29 allows us to depend on numpy >= 1.25
?
numpy 1.25 offers backwards compatibility all the way through to numpy 1.19 (which more than covers nep29). What's left to do here in this PR is to go back and rework CI to do the right install order for wheel generation where necessary - i.e. install with 1.25 and then downgrade to 1.22 and see if it still works. I'll have a stab at it later this week probably. |
Cron CI issue is elsewhere see #4238 |
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.
Some comments for when folks get to review so it makes more sense what I'm doing here.
@@ -9,6 +9,10 @@ inputs: | |||
description: 'build MDA docs' | |||
required: true | |||
default: false | |||
isolation: |
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.
We're adding an option to trigger the pip --no-build-isolation flag. This will allow us to avoid pip
trying to have its own isolated build & overidding already installed dependencies.
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.
It took me a couple readings of this comment and the pip documentation to understand (if I have this correctly) that:
- default (i.e. isolate) installs new build-time dependencies that can be separate from runtime dependencies or previously installed packages
--no-build-isolation
does not override previously installed packages (I think?) but makes use of what is currently installed, which is why we added this flag here to test different build package versions
If that's right, could you please add that to the description of this flag, so later maintainers understand the use of the flag in our CI?
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.
Honestly I'm not really 100% sure I know exactly how build isolation works, my take is that it creates an isolated environment with brand new everything to create wheels and then it gives you the wheels back in the world you first started in.
I'll try to add something sensible here.
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.
Ok I've added a longer explanation and justification for how build isolation works, why we need it, etc...
I'm going to go ahead with the merge, but if you have the time to review what I wrote here and call out anything that's unclear in an issue that'd be great.
- name: install_min_deps | ||
if: "matrix.type == 'MIN'" | ||
run: | | ||
pip install pytest-xdist pytest-timeout |
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.
Moving this here because pip installing MDAnalysisTests should have already gotten pytest, you just need ot add pytest-xdist and pytest-timeout
@@ -69,6 +72,7 @@ jobs: | |||
with: | |||
build-tests: true | |||
build-docs: false | |||
isolation: false |
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.
turn off isolation here because we want to build with the nightly wheels
- name: build_srcs | ||
uses: ./.github/actions/build-src | ||
with: | ||
build-tests: true | ||
build-docs: false | ||
isolation: false |
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.
build with the deps you have installed
@@ -152,6 +158,7 @@ jobs: | |||
with: | |||
build-tests: true | |||
build-docs: true | |||
isolation: false |
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.
no need for isolation if we have all the dependencies here
displayName: 'Build MDAnalysis' | ||
condition: and(succeeded(), eq(variables['BUILD_TYPE'], 'normal')) | ||
- powershell: pip list | ||
displayName: 'Check installed packages' |
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.
Keeping this around so we can get an idea of what's in the environment ahead of testing
# than NEP29 (see: https://numpy.org/doc/stable/dev/depending_on_numpy.html#adding-a-dependency-on-numpy) | ||
# We pin our wheel installation to that and a maximum of numpy 2.0 since | ||
# this will likely involve several breaking changes | ||
"numpy>=1.25,<2.0; python_version>='3.9'", |
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.
NumPy 1.25+ is backwards compatible with its C/C++ API, so (as shown in the CI tests) we can build with it and then use an older version of NumPy at runtime and things just work.
Alright can I ask for a priority re-review & merge here @MDAnalysis/coredevs ? I would like to get this merged to get the 2.6.0 release out. |
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 but IMO more documentation would be a huge help for future maintenance. Thanks for this @IAlibay
@@ -9,6 +9,10 @@ inputs: | |||
description: 'build MDA docs' | |||
required: true | |||
default: false | |||
isolation: |
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.
It took me a couple readings of this comment and the pip documentation to understand (if I have this correctly) that:
- default (i.e. isolate) installs new build-time dependencies that can be separate from runtime dependencies or previously installed packages
--no-build-isolation
does not override previously installed packages (I think?) but makes use of what is currently installed, which is why we added this flag here to test different build package versions
If that's right, could you please add that to the description of this flag, so later maintainers understand the use of the flag in our CI?
Thanks for the quick review @lilyminium ! I'll go ahead and merge when CI returns green so we can move ahead with the release. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Fixes #4183
This will likely (silently) break all of CI since the order of things changes.
Things to check
PR Checklist
📚 Documentation preview 📚: https://mdanalysis--4198.org.readthedocs.build/en/4198/