sunpy icon indicating copy to clipboard operation
sunpy copied to clipboard

Publish pure Python wheels

Open ConorMacBride opened this issue 3 years ago • 2 comments

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.py import errors https://github.com/sunpy/sunpy/blob/5a351a8e6161cab6bc4cb7974d0d8a93ad92a3ef/sunpy/io/ana.py#L51

ConorMacBride avatar May 23 '22 22:05 ConorMacBride

Worth backporting to 4.0?

nabobalis avatar May 23 '22 22:05 nabobalis

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??

ConorMacBride avatar May 23 '22 22:05 ConorMacBride

@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

ConorMacBride avatar Feb 10 '23 02:02 ConorMacBride

@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.

nabobalis avatar Feb 10 '23 04:02 nabobalis

This appears to be successfully building the pure Python wheel, with just an env var set!

ConorMacBride avatar Feb 14 '23 21:02 ConorMacBride

I think this is worth adding a changelog.

nabobalis avatar Feb 14 '23 21:02 nabobalis

feature or trivial changelog?

ConorMacBride avatar Feb 14 '23 22:02 ConorMacBride

I consider this a new feature.

nabobalis avatar Feb 14 '23 22:02 nabobalis

I tagged to close #5772 as I think aarch64 wheels without the ana extension would be sufficient for almost all users.

ConorMacBride avatar Feb 14 '23 23:02 ConorMacBride

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.

nabobalis avatar Feb 14 '23 23:02 nabobalis

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

ConorMacBride avatar Feb 15 '23 00:02 ConorMacBride

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?

Cadair avatar Feb 15 '23 00:02 Cadair

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.

ConorMacBride avatar Feb 21 '23 21:02 ConorMacBride

Thanks @ConorMacBride !

Cadair avatar Feb 22 '23 14:02 Cadair