Skip to content

gh-146636: Add Free-threaded Stable ABI migration guide - #150580

Merged
encukou merged 27 commits into
python:mainfrom
encukou:abi3t-migration-sq
Jun 3, 2026
Merged

gh-146636: Add Free-threaded Stable ABI migration guide#150580
encukou merged 27 commits into
python:mainfrom
encukou:abi3t-migration-sq

Conversation

@encukou

@encukouencukou commented May 29, 2026

Copy link
Copy Markdown
Member

clin1234and others added 20 commits May 17, 2026 05:33
This document provides detailed instructions on how to use the Free Threading Stable ABI in CPython, including guidelines for module initialization, API usage, and thread safety considerations.
Clarified access restrictions on PyObject members and recommended functions for type and reference count manipulation.
Clarified that direct access to PyObject members is prohibited.
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Updated documentation to clarify the identification of free-threaded limited API builds in C, including changes to macros and initialization methods.
Updated the documentation to clarify the use of the stable ABI and GIL management in Python extensions, including changes to member access and initialization methods.
Removed sections on API guidelines, critical sections, and thread safety from the documentation.
@read-the-docs-community

read-the-docs-communityBot commented May 29, 2026

Copy link
Copy Markdown

Comment threadDoc/howto/abi3t-migration.rst Outdated
@ngoldbaum

Copy link
Copy Markdown
Contributor

Thanks, this looks great! I'll probably use the tables in my EuroPython talk.

I'm hopeful that we'll be able to ship abi3t support in the next releases of PyO3 and Maturin (see PyO3/pyo3#5807 and PyO3/maturin#3113).

I am also planning to add a section to the free-threaded guide about building abi3t extensions, including practicalities like dealing with bindings generators and the NumPy C API. When that is ready, maybe we can just link there for all the ecosystem-wide details that don't belong in the CPython docs?

Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
encukouand others added 3 commits June 1, 2026 14:15
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Co-authored-by: Stan Ulbrych <stan@python.org>
@encukou

Copy link
Copy Markdown
MemberAuthor

Thanks for the reviews and suggestions!

I am also planning to add a section to the free-threaded guide about building abi3t extensions, including practicalities like dealing with bindings generators and the NumPy C API. When that is ready, maybe we can just link there for all the ecosystem-wide details that don't belong in the CPython docs?

That sounds great!

Comment threadDoc/howto/abi3t-migration.rst
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
Comment threadDoc/howto/abi3t-migration.rst Outdated
encukouand others added 2 commits June 2, 2026 13:41
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
@encukou

Copy link
Copy Markdown
MemberAuthor

I'll merge now; any improvements can go in separate PRs.

@encukou
encukou merged commit c720e18 into python:mainJun 3, 2026
30 checks passed
@encukouencukou added awaiting core review needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 3, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@encukou
encukou deleted the abi3t-migration-sq branch June 3, 2026 12:02
@bedevere-app

Copy link
Copy Markdown

GH-150844 is a backport of this pull request to the 3.15 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jun 3, 2026
hugovk added a commit that referenced this pull request Jun 3, 2026
…0580) (#150844)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Charlie Lin <tuug@gmx.us>
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
philthompson10 pushed a commit to philthompson10/cpython that referenced this pull request Jun 17, 2026
…GH-150580)
Co-authored-by: Charlie Lin <tuug@gmx.us>
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Sign up for freeto 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

@encukou@ngoldbaum@hugovk@da-woods@StanFromIreland@clin1234