BLD: allow building without Py_LIMITED_API#154
Conversation
fbd7aff to
9e6aaed
Compare
| ] | ||
|
|
||
|
|
||
| class bdist_wheel_abi3(bdist_wheel): |
There was a problem hiding this comment.
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
mhvk
left a comment
There was a problem hiding this comment.
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.
| */ | ||
|
|
||
| #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION | ||
| #define Py_LIMITED_API 0x030900f0 |
There was a problem hiding this comment.
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.
wouldn't hurt, I'll add it now
Actually we already get one, it's just no very clear: Example |
mhvk
left a comment
There was a problem hiding this comment.
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_APIfor 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.