Skip to content

python: add support for the CPython stable ABI (cp310-abi3 wheels)#244

Open
danceratopz wants to merge 2 commits into
chfast:masterfrom
danceratopz:add-abi3
Open

python: add support for the CPython stable ABI (cp310-abi3 wheels)#244
danceratopz wants to merge 2 commits into
chfast:masterfrom
danceratopz:add-abi3

Conversation

@danceratopz

@danceratopz danceratopz commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

The cffi-generated extension module is already compiled against the stable ABI (Py_LIMITED_API is cffi's default): the shipped modules are _ethash.abi3.so, and the Windows .pyd links python3.dll. Only the wheel tags are per-version, because bdist_wheel is never told about the limited API.

  • Add setup.cfg with [bdist_wheel] py_limited_api = cp310 (matching python_requires='>=3.10'), so wheels are tagged cp310-abi3: a single wheel per platform covers CPython 3.10 and all later versions, including 3.14.
  • Collapse the per-version loop in scripts/ci/python_build_wheels.sh to a single interpreter per platform. auditwheel repair preserves the abi3 tag.
  • Add the Programming Language :: Python :: 3.14 classifier.

Verified: uv build --wheel produces ethash-1.1.0-cp310-abi3-linux_x86_64.whl, which installs and passes the binding tests on CPython 3.14 in a container without cmake or a C toolchain. (abi3 does not apply to free-threaded builds or PyPy; those keep using the sdist.)

Fixes the sdist fallback described in ethereum/execution-specs#3173.

The cffi-generated extension module has always been compiled with
Py_LIMITED_API (cffi's default): the shipped modules are named
_ethash.abi3.so and the Windows .pyd links python3.dll. The wheels were
just tagged with the interpreter that built them, so each release only
covered the Python versions it was built for and newer versions (e.g.
3.14) fall back to an sdist build requiring cmake and a C toolchain.

Tell bdist_wheel about the limited API so wheels are tagged cp310-abi3,
matching python_requires='>=3.10'. A single wheel per platform now
covers Python 3.10 and all later versions, so build with only one
interpreter per platform in CI. Note the abi3 tag does not apply to
free-threaded builds; those still use the sdist.

@chfast chfast left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the release 1.1.1 from the PR. We will do the release after.

And cut the PR description to the merit (add support for python stable API).

The version number and release date are decided at release time.
@danceratopz danceratopz changed the title python: tag wheels as cp310-abi3 (adds Python 3.14 wheel support) python: add support for the CPython stable ABI (cp310-abi3 wheels) Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants