Skip to content

feat: create free-threaded python wheels#1553

Draft
timsaucer wants to merge 7 commits into
apache:mainfrom
timsaucer:feat/freethreaded-python
Draft

feat: create free-threaded python wheels#1553
timsaucer wants to merge 7 commits into
apache:mainfrom
timsaucer:feat/freethreaded-python

Conversation

@timsaucer
Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #1324

Rationale for this change

Starting in Python 3.14 free-threaded support is no longer experimental.

What changes are included in this PR?

Update build to support free-threaded Python wheels.

Are there any user-facing changes?

None

timsaucer and others added 7 commits May 20, 2026 13:12
The free-threaded matrix entries skip `uv sync` to avoid resolving
project dependencies against cp313t/cp314t (many dev deps lack
free-threaded wheels), so `uv run --no-project maturin` failed on
macOS/Windows with "Failed to spawn: `maturin`". Switch to
`uvx maturin@1.8.1`, which runs maturin in an isolated tool env
independent of the project venv and matches the pin used by
maturin-action for manylinux builds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
maturin's `--interpreter python3.14t` fails on Windows because the
free-threaded build ships as plain `python.exe` (no `tN` suffix). Look
up `sys.executable` of the python on PATH (which actions/setup-python
prepends with the free-threaded install), assert
`Py_GIL_DISABLED == 1` so a misconfigured PATH can't silently build a
GIL wheel, and normalize backslashes to forward slashes so the path
survives re-expansion in the downstream `run:` line.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Windows free-threaded Python does not expose `abiflags` in sysconfig,
so PyO3's default Windows linkage path fails with "A python 3
interpreter on Windows does not define abiflags in its sysconfig ಠ_ಠ"
when building cp31Xt wheels. Enabling the `generate-import-lib` PyO3
feature switches Windows builds to a generated import library
(provided by the `python3-dll-a` crate) that does not depend on a
fully populated sysconfig. It is a no-op on macOS and Linux and is
compatible with the existing `abi3` feature.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
maturin 1.8.1 errors out on Windows free-threaded interpreters with
"A python 3 interpreter on Windows does not define abiflags in its
sysconfig" even when given a valid `python.exe`. Newer maturin
releases handle the missing abiflags gracefully for cp31Xt builds.
Bump both the `uvx maturin@` pin used for native macOS/Windows wheels
and the `maturin-version` passed to PyO3/maturin-action for the
manylinux containers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The mac/Windows matrix shared a single name template that prepended
"macOS arm64 & Windows" to every entry, which got truncated in the
GitHub UI sidebar and made it hard to tell macOS and Windows runs
apart. Rename all wheel build jobs to the same pattern so the OS,
architecture, and python tag are visible at a glance:

- Linux x86_64 / arm64
- macOS arm64 / x86_64
- Windows x86_64

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Add support for free threaded python

1 participant