Skip to content

BLD: Use NumPy nightly wheels for non-release builds #27204

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

Merged
merged 5 commits into from
Oct 30, 2023

Conversation

seberg
Copy link
Contributor

@seberg seberg commented Oct 26, 2023

This uses the NumPy nightlies for non-release builds to ensure the matplotlib nightlies uploaded are build against the new NumPy version.

These nightlies are not tested, but if they were they should actually still be tested against the release NumPy. This is necessary to allow NumPy to enforce API changes, it does mean that potential C-API breaks in NumPy need quicker follow-up unfortunately (either in NumPy or in matplotlib).

Closes gh-27174


I have tested that it calls with --no-build-isolation and installs the right NumPy before that. I am not sure that this is the best approach, it is rather tedious to set up all dependencies manually (and I am not a workflow specialist)!
For example, I don't really understand the >- but I removed it because that means that newlines are not included in the 'strings', which would otherwise make trouble.

This uses the NumPy nightlies for non-release builds to ensure the
matplotlib nightlies uploaded are build against the new NumPy version.

These nightlies are not tested, but if they were they should actually
still be tested against the release NumPy.  This is necessary to allow
NumPy to enforce API changes, it does mean that potential C-API breaks
in NumPy need quicker follow-up unfortunately (either in NumPy or in
matplotlib).
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

tacaswell
tacaswell previously approved these changes Oct 26, 2023
@tacaswell tacaswell added the CI: Run cibuildwheel Run wheel building tests on a PR label Oct 26, 2023
@tacaswell tacaswell added this to the v3.9.0 milestone Oct 26, 2023
@tacaswell tacaswell dismissed their stale review October 26, 2023 16:13

I am confused by the conditionals.

Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
@tacaswell
Copy link
Member

I got my self a bit confused about how our nightly uploads to anaconda.org work. To save others the time of reading that workflow, we download the most recent wheel artifacts from a build on main and then publish that so the logic here of using the pre-release numpy on pushes to the main branch is what we want to do.

We also have a weekly job that runs our main test jobs with the pre releases of numpy and pandas, but we use it for both building and for testing.


Rather than opting out of the build isolation, would it make more sense to pass --pre and the index url into the build front end?

@seberg
Copy link
Contributor Author

seberg commented Oct 26, 2023

Rather than opting out of the build isolation, would it make more sense to pass --pre and the index url into the build front end?

You would opt into pre for other dependencies, but yeah, I can try that tomorrow. It should definitely be a bit smaller of a change.

@tacaswell
Copy link
Member

You would opt into pre for other dependencies, but yeah,

Once you are living on the edge might as well go all the way 😉

rm -rf {package}/build
CIBW_BEFORE_BUILD_WINDOWS: >-
pip install delvewheel numpy>=1.25 &&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure why the numpy install ahead of time. I tried this a bit (but no artifacts yet) and it works, but I don't see in the log whether the correct numpy got installed.

Copy link
Member

Choose a reason for hiding this comment

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

I believe this was added when we were having problems with oldest-supported-numpy (and decided to fix them by switching to the np 1.25+ backwards compatible builds)

I think that it is likely we haven't needed it on this line since we switched to meson/pyproject.toml, but it did get changed in #26443.

Copy link
Member

Choose a reason for hiding this comment

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

but if we are using build isolation the wheel build won't see this numpy instal....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought we have build isolation by default in cibuildwheel, but I am not sure what the default does exactly.

Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
@tacaswell
Copy link
Member

  * Installing packages in isolated environment... (meson-python>=0.13.1, numpy>=1.25, pybind11>=2.6, setuptools_scm>=7)

appears to be the logging we get....

@seberg
Copy link
Contributor Author

seberg commented Oct 26, 2023

The logging is unfortunate, but I tried the artifact wheel and it looks wrong. Have to check a bit more careful and think about it (if I got the right one for the first version, that may have been also wrong).

@seberg
Copy link
Contributor Author

seberg commented Oct 27, 2023

OK, I confirmed that the new wheels were compiled with the NumPy nightlies :).

@tacaswell tacaswell merged commit e5c6c7c into matplotlib:main Oct 30, 2023
@seberg seberg deleted the build-numpy2 branch October 30, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Run cibuildwheel Run wheel building tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MNT]: Build nightly wheels with NumPy nightly wheels
3 participants