Skip to content

Pass the free-threaded Python ABI to PyO3 - #77

Merged
dzbarsky merged 1 commit into
mainfrom
codex/pyo3-free-threaded
Oct 2, 2026
Merged

dzbarsky merged 1 commit into
mainfrom
codex/pyo3-free-threaded

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Oct 2, 2026

Copy link
Copy Markdown
Member

Append t to PYO3_CROSS_PYTHON_VERSION when the Python runtime advertises the free-threaded ABI. PyO3 needs that suffix to select the correct object layout when PYO3_NO_PYTHON disables interpreter detection.

Validation: three temporary analysis tests invoking the real pyo3_toolchain with mock Python toolchains pass for regular Python, free-threaded Python, and runtimes without abi_flags. Buildifier and git diff --check pass. The existing PyO3 integration package is excluded by the root .bazelignore, so a full Python-extension build was not run.

-zbarskybot

Append t to PYO3_CROSS_PYTHON_VERSION when the Python runtime ABI flags contain t. PyO3 needs this suffix to select the free-threaded ABI because the toolchain disables interpreter detection with PYO3_NO_PYTHON. Default missing ABI flags to an empty string for older Python runtime providers.
@dzbarsky
dzbarsky merged commit 3eb80ee into main Oct 2, 2026
3 checks passed
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.

1 participant