What's the problem this feature will solve?
The steering council approved PEP 803 and Python 3.15 will support a new abi3t ABI. Extensions built using this ABI can be imported on both the free-threaded and GIL-enabled builds of CPython.
Adding support for building these extensions and wheels will allow projects using setuptools to reduce their maintenance burden and build one wheel for both Python 3.15 builds and automatically support 3.16 and newer when those builds are released.
See PEP 803 for more details: https://peps.python.org/pep-0803/
Describe the solution you'd like
There are two possible ways of getting this done.
Require a free-threaded interpreter to build abi3t wheels
The main benefit of this approach is it doesn't require any new UI in setuptools. We would repurpose the py_limited_api keyword argument for Extension and bdist_wheel option so that if they are set and the build is happening with a free-threaded interpreter, setuptools will produce .abi3t.so extension files on posix platforms and abi3t.abi3 wheels on all platforms.
This is the approach taken in #5193.
Add new UI for choosing between abi3 and abi3t builds.
There is nothing special about the free-threaded interpreter for these builds and it's possible to produce abi3t extensions and wheels using a GIL-enabled interpreter. But because we don't want to break existing abi3 builds on GIL-enabled interpreters, I think we would need to have some way of opting in to abi3t builds. This probably requires a new Extension keyword argument.
Alternative Solutions
I'm not sure there is an alternative for users of setuptools who want to do these builds.
Additional context
I'm available on the PyPA discord if you want to have lower-latency chats about this topic.
Code of Conduct
What's the problem this feature will solve?
The steering council approved PEP 803 and Python 3.15 will support a new abi3t ABI. Extensions built using this ABI can be imported on both the free-threaded and GIL-enabled builds of CPython.
Adding support for building these extensions and wheels will allow projects using setuptools to reduce their maintenance burden and build one wheel for both Python 3.15 builds and automatically support 3.16 and newer when those builds are released.
See PEP 803 for more details: https://peps.python.org/pep-0803/
Describe the solution you'd like
There are two possible ways of getting this done.
Require a free-threaded interpreter to build abi3t wheels
The main benefit of this approach is it doesn't require any new UI in setuptools. We would repurpose the
py_limited_apikeyword argument forExtensionandbdist_wheeloption so that if they are set and the build is happening with a free-threaded interpreter, setuptools will produce.abi3t.soextension files on posix platforms andabi3t.abi3wheels on all platforms.This is the approach taken in #5193.
Add new UI for choosing between abi3 and abi3t builds.
There is nothing special about the free-threaded interpreter for these builds and it's possible to produce
abi3textensions and wheels using a GIL-enabled interpreter. But because we don't want to break existingabi3builds on GIL-enabled interpreters, I think we would need to have some way of opting in to abi3t builds. This probably requires a newExtensionkeyword argument.Alternative Solutions
I'm not sure there is an alternative for users of setuptools who want to do these builds.
Additional context
I'm available on the PyPA discord if you want to have lower-latency chats about this topic.
Code of Conduct