pypa / pypa/setuptools

[FR] Support building extensions and wheels with the abi3t ABI (PEP 803)

Open
#5,205 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Needs Triage
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

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 https://github.com/pypa/setuptools/pull/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
  • I agree to follow the PSF Code of Conduct

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading PEP 803 and the referenced pull request #5193. Inspect the Extension py_limited_api keyword and bdist_wheel option, then determine how abi3t extension and wheel names should be produced without breaking existing abi3 builds. Done means setuptools can build the requested abi3t artifacts for the supported interpreter modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.