-
Notifications
You must be signed in to change notification settings - Fork 24
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
BLD: allow building without Py_LIMITED_API #154
Conversation
fbd7aff
to
9e6aaed
Compare
@@ -19,6 +19,16 @@ | |||
] | |||
|
|||
|
|||
class bdist_wheel_abi3(bdist_wheel): |
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.
this is inspired from https://github.com/joerick/python-abi3-package-sample/blob/main/setup.py, which is the repo that cibuildwheel's docs cites as a reference implementation.
This class is used in replacement of the static metadata from setup.cfg
d284eba
to
815f94a
Compare
1908779
to
9006a5d
Compare
pypa/setuptools#4424 might supersede this. |
9006a5d
to
6c1fb79
Compare
6c1fb79
to
baca5f2
Compare
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.
pypa/setuptools#4424 might supersede this.
If I understand pypa/setuptools#4424 (comment) correctly, we'll get an actual error for trying to use the limited API with no-GIL. Which means we probably should go with this PR.
I think it looks good - my main suggestion is to add a comment...
I also considered adding a CI run, but ended up thinking we probably better first make sure pyerfa
is actually OK with threads. From the stuff that we added ourselves, my main worry is about the leap second list - which should almost always be identical between threads, but perhaps is not guaranteed to be so.
@@ -10,7 +10,6 @@ | |||
*/ | |||
|
|||
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION | |||
#define Py_LIMITED_API 0x030900f0 |
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.
Would it make sense to leave a comment here that we use the limited API but by default set it insetup.py
?
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.
wouldn't hurt, I'll add it now
Actually we already get one, it's just no very clear: Example
|
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.
Great, looks all OK now! I'll merge this, since it doesn't depend on the others.
This is to address #152 (comment)
This changes nothing by default but it allows building pyerfa without
Py_LIMITED_API
for testing purposes. This is needed to enable testing astropy in free-threaded Python.Note that I also ran the test suite locally with free-threading (using Python 3.13.0b3 + numpy 2.1.0dev0) and got no errors so this seems like a safe bet.