FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-146636: PEP 803: add Py_TARGET_ABI3T and .abi3t.so extension by encukou · Pull Request #146637 · python/cpython · GitHub

/ cpython Public

gh-146636: PEP 803: add Py_TARGET_ABI3T and .abi3t.so extension - #146637

Merged
encukou merged 10 commits into
python:mainfrom
encukou:abi3t-so-extension
Apr 1, 2026
Merged

gh-146636: PEP 803: add Py_TARGET_ABI3T and .abi3t.so extension#146637
encukou merged 10 commits into
python:mainfrom
encukou:abi3t-so-extension

Conversation

encukou commented Mar 30, 2026
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

bedevere-app Bot mentioned this pull request Mar 30, 2026
9 tasks
Comment thread Doc/c-api/stable.rst
encukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 31, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit db32325 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F146637%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 31, 2026
encukou marked this pull request as ready for review March 31, 2026 15:50
Comment thread Include/patchlevel.h Outdated

vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM.

Please document changes in the commit message:

  • Add Py_TARGET_ABI3T macro.
  • Add ".abi3t.so" to importlib EXTENSION_SUFFIXES.
  • Remove ".abi3.so" from importlib EXTENSION_SUFFIXES on Free Threading.

vstinner commented Apr 1, 2026

Copy link
Copy Markdown
Member

I tested manually building test_cext with Py_TARGET_ABI3T and rename the extension to test_cext.abi3t.so:

./python -m venv env
env/bin/python -m pip install setuptools 
cd Lib/test/test_cext/
CPYTHON_TEST_EXT_NAME=test_cext CPYTHON_TEST_ABI3T=1 ../../../env/bin/python setup.py build_ext 
cd build/lib.linux-x86_64-cpython-315-pydebug/
mv test_cext.cpython-315d-x86_64-linux-gnu.so test_cext.abi3t.so
cd ../../../../..
PYTHONPATH=Lib/test/test_cext/build/lib.linux-x86_64-cpython-315-pydebug/ ./python -c 'import test_cext; print(test_cext.__file__)'

Output:

Lib/test/test_cext/build/lib.linux-x86_64-cpython-315-pydebug/test_cext.abi3t.so

It works as expected (I can import the C extension named .abi3t.so).

Note: I used a debug build of Python which is not good to use the stable ABI, but it was for a quick test :-)

encukou merged commit 2452324 into python:main Apr 1, 2026
139 of 143 checks passed
encukou deleted the abi3t-so-extension branch April 1, 2026 14:15
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Apr 16, 2026
…pythonGH-146637)

- Add Py_TARGET_ABI3T macro.
- Add ".abi3t.so" to importlib EXTENSION_SUFFIXES.
- Remove ".abi3.so" from importlib EXTENSION_SUFFIXES on Free Threading.
- Adjust tests

This is part of the implementation for PEP-803.
Detailed documentation to come later.

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…pythonGH-146637)

- Add Py_TARGET_ABI3T macro.
- Add ".abi3t.so" to importlib EXTENSION_SUFFIXES.
- Remove ".abi3.so" from importlib EXTENSION_SUFFIXES on Free Threading.
- Adjust tests

This is part of the implementation for PEP-803.
Detailed documentation to come later.

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL