API: allow building in cython with Py_LIMITED_API#25531
Conversation
| except subprocess.CalledProcessError as p: | ||
| print(f"{p.stdout=}") | ||
| print(f"{p.stderr=}") | ||
| raise |
There was a problem hiding this comment.
Try to print out the error instead of swallowing it
|
The test generates a C file that includes the Note that the That macro is not used in scipy, astropy, scikit-learn, nor cython. The only one of the scalar types used in the public API is and is used in the public macro for I wonder if we could move much of this into private headers. @seberg thoughts? |
Not sure how much In either case, hiding the I also think that defining the exported bool singletons as |
|
Conclusion from the triage discussion: there are projects that use |
|
Thanks for updating, the test failures look real. Also might be good to add the note in the |
…thon [skip cirrus]
[skip azp][skip cirrus]
|
I added a release note
Hmm. Which docs 😄? |
seberg
left a comment
There was a problem hiding this comment.
LGTM, I am not sure if we just should add the Py_LIMITED_API definition to the cython file, or whether Cython will limit itself to the limited API, but compile with the full one if we don't.
But beyond adding that, please feel free to merge (or if you know that it doesn't matter).
|
@charris: would this be worth back-porting? We haven't gotten complaints about the limited API, but it might prevent those complaints from appearing on older versions. |
xref cython/cython#5697
The change in
numpy/_core/include/numpy/arrayscalars.his the start of what will be needed, but I don't know if it is enough since the test I added crashed.Py_LIMITED_APIis a work-in-progress on Cython and it seems more is needed.