Skip to content
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

[FR] Implicitly disable py_limited_api on Python 3.13 freethreaded #4673

Open
1 task done
mgorny opened this issue Oct 9, 2024 · 0 comments
Open
1 task done

[FR] Implicitly disable py_limited_api on Python 3.13 freethreaded #4673

mgorny opened this issue Oct 9, 2024 · 0 comments
Labels
enhancement Needs Triage Issues that need to be evaluated for severity and status.

Comments

@mgorny
Copy link
Contributor

mgorny commented Oct 9, 2024

What's the problem this feature will solve?

Currently, enablng py_limited_api=True on Python 3.13 freethreaded results in hard failure.

Describe the solution you'd like

I think setuptools should fall back to building a regular (i.e. non-limited API) extension when Python 3.13 freethreading is used, just like it does for PyPy3 (that does not support the stable ABI). This also means removing Py_LIMITED_API macro from define_macros, which is a bit yucky.

Alternative Solutions

Right now, the main alternative is to special-case freethreading in every package separately, and do not enable the limited API if it's used. However, besides a lot of repetition, this means that every project would explicitly need to track the stable ABI support in freethreading builds, and update the special cases when it's implemented.

Alternatively, instead of removing py_limited_api and Py_LIMITED_API macros, we could change CPython to ignore it and use the regular API (just like PyPy does). However, this would mean that old versions of setuptools would still be producing abi3 wheels for that.

Additional context

Related to #4420, and python/cpython#111506 for the wider issue.

Code of Conduct

  • I agree to follow the PSF Code of Conduct
@mgorny mgorny added enhancement Needs Triage Issues that need to be evaluated for severity and status. labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests

1 participant