-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
API: allow building in cython with Py_LIMITED_API #25531
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
Conversation
except subprocess.CalledProcessError as p: | ||
print(f"{p.stdout=}") | ||
print(f"{p.stderr=}") | ||
raise |
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.
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 😄? |
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.
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.h
is the start of what will be needed, but I don't know if it is enough since the test I added crashed.Py_LIMITED_API
is a work-in-progress on Cython and it seems more is needed.