sunpy
sunpy copied to clipboard
Publish pure Python wheels
Based on discussions in #5772, this adds a pure Python wheel to the publishing workflow. (I think this PR should probably close that issue?) The pure Python wheel would be installed (by pip) when a platform specific compiled wheel is not available.
For example, by default pip on aarch64 will install the pure Python wheel (without the sunpy.io.ana compiled extension) rather than compiling from the sdist. And for macOS, it would continue to use the specific compiled wheel rather than the pure Python wheel.
Due to how we detect whether to build pure python or not on GitHub Actions, this means the ana test no longer run when testing the sdist on GitHub Actions. I don't think this is an issue.
- [ ] Update documentation
- [ ] Document how to install sdist instead of pure wheel (pip
--no-binary :all:option) - [ ] Improve
ana.pyimport errors https://github.com/sunpy/sunpy/blob/5a351a8e6161cab6bc4cb7974d0d8a93ad92a3ef/sunpy/io/ana.py#L51
Worth backporting to 4.0?
It would be nice to backport it. Although if someone was running 4.0.0 on e.g. aarch64, they would have compiled from source, however, when they upgrade to 4.0.1 they would get the pure Python wheel which doesn't include ana. So from the point of view of the user, a feature is removed by a bugfix release. That's an unlikely case so maybe we should backport??
@nabobalis this needs the workflow to support an input for passing in env vars. Do you have any thoughts on the syntax here? https://github.com/OpenAstronomy/github-actions-workflows/pull/56#issuecomment-1425089211
@nabobalis this needs the workflow to support an input for passing in env vars. Do you have any thoughts on the syntax here? OpenAstronomy/github-actions-workflows#56 (comment)
👍 Its simple, straight to the point.
This appears to be successfully building the pure Python wheel, with just an env var set!
I think this is worth adding a changelog.
feature or trivial changelog?
I consider this a new feature.
I tagged to close #5772 as I think aarch64 wheels without the ana extension would be sufficient for almost all users.
I tagged to close #5772 as I think aarch64 wheels without the ana extension would be sufficient for almost all users.
Makes sense.
About your last bullet point. Should we link to a webpage? I think trying to explain how to fix that issue in a message might be impossible.
Good idea! I changed the message to:
C extension for ANA is missing. For more details see: https://docs.sunpy.org/en/stable/installation.html#installing-without-conda
If we are putting that link in that error we should add a comment to the page about what platforms we don't have ana on?
I've reworded the info on the Python wheels in the installation guide. I've stated what platforms have a complied wheel, and made it clear that all other Python implementations and platforms will need to compile from source if they want the extension.
Thanks @ConorMacBride !