Build nightly wheels against developer version of Numpy#15524
Build nightly wheels against developer version of Numpy#15524astrofrog merged 3 commits intoastropy:mainfrom
Conversation
… build-time dependencies to build nightly wheels
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
Ok this seems to work fine in |
Can @seberg advise here? 🙏 |
pllim
left a comment
There was a problem hiding this comment.
Why only do this for scheduled or dispatched events? Shouldn't we be consistent? That is, if I apply "build all wheels" label on a PR, I would expect the same thing to happen, except no wheel upload.
Also I think this only solves half our problem. We also need pyerfa dev that is built against numpy-dev, no? xref liberfa/pyerfa#109
|
I think we'd still want to check that the wheels we build work with stable numpy, no? If we did that, I agree #15506 would become superfluous. |
Unfortunately, I don't have a great advise here right now. The problem is that you only really see which version is it when you try to import a newer NumPy and it refuses. If you want something viable today, you can use the NumPy 2.0 nightly wheel and: If it works, you are building with NumPy 2.0, if it fails you are building with NumPy 1.x. We were discussing whether we could create a tool that does that in a way that it fails to see which version you compiled for, but that needs some hacking and it doesn't exist yet (I am not certain it will actually be easy to do that). I doubt that is super relevant for you, it is mainly something the conda folks would like to test their builds. EDIT: A note in case someone finds this. The above hack I gave will fail if you use |
Ok I've now switched it to use the 'dev' build dependencies when doing 'Build all wheels'. Note that at least we will still have a build against the latest stable version in the
The Note that in all cases, the tests are run using the latest stable numpy, not dev numpy. |
|
Ah we need to release https://github.com/OpenAstronomy/github-actions-workflows/releases/tag/untagged-6c0ffc9148fcf9a95fe5 for this to work properly here. |
OK, I now see that that works, indeed, since you just install the wheel with the regular+test dependencies. |
b599b82 to
9545209
Compare
Yes I can always try and set up dev wheels of pyerfa, but that's separate as pyerfa isn't a build-time dependency of astropy so not within the scope of this PR. |
pllim
left a comment
There was a problem hiding this comment.
I guess we can give it a try and see. Thanks!
|
Not sure what's up w.r.t. your comment on OpenAstronomy so I'll let you merge when you think this is ready. |
On the astropy side, I guess the alternative would be building erfa in the regular numpy-dev run, right? |
|
Thanks, @astrofrog! Really nice. |
|
@pllim - I have triggered a build of the dev wheels: https://github.com/astropy/astropy/actions/runs/6632806493 Once that is done we can try what @seberg suggested in #15524 (comment) (I might not be able to get to it for a couple of days so feel free to try it if you like) |
|
@seberg I tried your suggestion with the latest dev wheels which have now been uploaded, and using: but |
|
Fix in #15533 |
|
@seberg @pllim @mhvk - there are now nightly wheels for pyerfa which can be installed from https://pypi.anaconda.org/liberfa/simple – if I do: rm -rf test-dev
python -m venv test-dev
source test-dev/bin/activate
pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy --pre
pip install --extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa --pre
pip install --extra-index-url https://pypi.anaconda.org/astropy/simple astropy --pre
pip freeze
python -c 'import numpy.core._multiarray_umath; numpy.core._multiarray_umath._ARRAY_API = None; import astropy'there is now no longer an error in the last command! 🎉 |
|
Awesome, thanks! A note in case someone finds this. The above hack I gave will fail if you use |
|
Thanks so much, @astrofrog!! |
This disables build isolation for nightly wheels in favor of installing dependencies by hand, and installs the latest developer version of numpy and the latest stable version of other build-time dependencies before doing the build. This also switches the regular builds from using
pip wheeltopython -m buildby selecting thebuildframework (this is going to change by default in future, just anticipating the change).I tested that the 'nightly' version works properly in my fork, e.g.:
https://github.com/astrofrog/astropy/actions/runs/6627003294/job/18001058641
Note the following in the cibuildwheel output:
Once we merge this PR we can use the workflow dispatch to force a new nightly build to make sure it also works properly.
From the logs, it looks like this is working but what I can't tell is if there is a way to find out for a given wheel what version of Numpy it was built against, to double check.