Add support for finding free-threaded interpreters for --find-interpreters#3206
Conversation
ngoldbaum
left a comment
There was a problem hiding this comment.
Spotted a minor improvement for the changelog entry
There was a problem hiding this comment.
Pull request overview
Adds free-threaded CPython (3.14+) to --find-interpreter auto-discovery on both Unix and Windows, and stops including the experimental 3.13t in bundled sysconfig lookups. A new FREE_THREADED_MINIMUM_PYTHON_MINOR = 14 constant centralizes the cutoff. 3.13t is still buildable when requested explicitly via -i python3.13t.
Changes:
- Introduce
FREE_THREADED_MINIMUM_PYTHON_MINORand refactor Unix candidate generation intocpython_candidate_names(), which addspython3.{minor}tentries (gated onbridge.supports_free_threaded()andrequires-python). - Add a Windows fallback that probes
python3.{minor}t.exefor free-threaded Microsoft Store / PATH installs, reusingWindowsInterpreterFinderdedup logic. - Start bundled free-threaded sysconfig lookup at 3.14 instead of 3.13, update
test_lookup_targetsnapshots, addtest_cpython_candidate_names_free_threaded, document the abi3 +--find-interpreterinteraction, and add a changelog entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/python_interpreter/mod.rs | Adds FREE_THREADED_MINIMUM_PYTHON_MINOR = 14 constant. |
| src/python_interpreter/discovery.rs | New cpython_candidate_names() helper, Windows python3.{minor}t.exe fallback, updated snapshot tests, and a new unit test. |
| src/python_interpreter/config.rs | Uses the new constant so bundled free-threaded configs start at 3.14. |
| src/python_interpreter/resolver.rs | Documents that --find-interpreter cannot produce abi3 + free-threaded wheels (needs explicit -i python3.14t). |
| Changelog.md | Adds Unreleased entry describing the new behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
|
Looks like something broke unrelated to this change yesterday. I'll try to dig in later to unbreak CI... |
|
It looks like conda updated pip from 26.0.1 to 26.1.1 and 26.1.0 dropped support for Python 3.9. |
## 1.14.1 * Bump uraimo/run-on-arch-action to v3 to fix pytest job ([#3221](PyO3/maturin#3221)) * Fix platform tag logic to generate the same as cpython on AIX ([#3220](PyO3/maturin#3220)) * Bump pyo3-introspection ([#3227](PyO3/maturin#3227)) * Upgrade cargo-zigbuild & cargo-xwin ([#3228](PyO3/maturin#3228)) * Fix issues around crates enabling abi3 and abi3t features ([#3226](PyO3/maturin#3226)) * Add PEP 740 publish attestations to PyPI releases ([#3230](PyO3/maturin#3230)) * Set PYO3_PYTHON to run scripts for stable ABI builds ([#3233](PyO3/maturin#3233)) * Fix shell quoting in CI scripts ([#3231](PyO3/maturin#3231)) ## 1.14.0 * Support parent-relative pyproject metadata in sdists ([#3182](PyO3/maturin#3182)) * Update PyPI platform tag validation ([#3187](PyO3/maturin#3187)) * Maint: update setup emsdk action in generate-ci ([#3194](PyO3/maturin#3194)) * Fix: only shim bin wheels during auditwheel repair ([#3197](PyO3/maturin#3197)) * Fix: avoid editable ELF truncation from stale hardlinks ([#3199](PyO3/maturin#3199)) * Fix Pyodide Emscripten platform tags ([#3191](PyO3/maturin#3191)) * Use pax instead of GNU headers for tar ([#3203](PyO3/maturin#3203)) * Feat: add default exclude `__pycache__` and `*.pyc` files ([#3202](PyO3/maturin#3202)) * Add support for finding free-threaded interpreters for `--find-interpreters` ([#3206](PyO3/maturin#3206)) * Stubs: also generate them for mixed PyO3 projects ([#3211](PyO3/maturin#3211)) * Don't depend on CFFI on PyPy ([#3213](PyO3/maturin#3213)) * Support pyo3 abi3t features on Python3.15 and PyO3 0.29 ([#3113](PyO3/maturin#3113))
This is partially extracted from #3113.
Currently, free-threaded interpreters are not always considered for
--find-interpreters. It is included on Unix but not on Windows. This means that users need to explicitly do another build to produce 3.14t wheels. This also contributes to PyO3/maturin-action#368 and I'm planning to do a followup over there to fix that once this is merged.With this PR,
--find-interpretersalways picks up 3.14t and newer. I intentionally excluded 3.13t because PyO3 0.29 will refuse to build wheels for 3.13t. This also follows manylinux, which recently dropped 3.13t from the images.