-
-
Notifications
You must be signed in to change notification settings - Fork 592
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
Use Python Limited API #6171
Use Python Limited API #6171
Conversation
Is there a downside? |
I have no issues with this, I know of no downsides. It would be interesting to get astropy/extension-helpers#26 in before we do this though. |
f6f05ac
to
f209af6
Compare
Okay. This PR adds to sunpy what the extension-helpers PR would add automatically. (I accidentally set the |
@@ -110,6 +110,9 @@ asdf.resource_mappings = | |||
asdf.extensions = | |||
sunpy = sunpy.io.special.asdf.entry_points:get_extensions | |||
|
|||
[bdist_wheel] | |||
py_limited_api = cp38 |
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.
Put a comment here saying if you change this you need to change the line in _pyana.c
or else we will forget.
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've added the comment. Here's the working CI from before the comment was added: https://github.com/sunpy/sunpy/actions/runs/2371727589
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.
Silly question, how does one get the version hex? Is it just a conversion of the number to hexadecimal?
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's defined here: https://docs.python.org/3.12/c-api/apiabiversion.html
And more general details here: https://docs.python.org/3/c-api/stable.html#c.Py_LIMITED_API
f209af6
to
e2726ce
Compare
If we rebase this we can see the CI run? |
e2726ce
to
16bf98d
Compare
Does this need a changelog? |
Up to you, we could add a trivial one? |
45f0bd4
to
ee2c6f1
Compare
Not sure if we want to do this. Basically, it compiles the extensions in such a way that they are compatible with all the Python versions, so we only need one wheel per OS. It will still test the wheel across all supported Python version so there won't be much of a speed up when publishing.
The ANA tests passed for me locally on macOS. Will see if all the tests pass in the CI. This is assuming the tests have good coverage of the C extension.
This is based on astrofrog/fast-histogram#56. See also PEP 384 – Defining a Stable ABI.