Skip to content

Support free-threaded Python aliases - #2294

Open
juliosuas wants to merge 1 commit into
pypa:masterfrom
juliosuas:fix/free-threaded-python-aliases
Open

Support free-threaded Python aliases#2294
juliosuas wants to merge 1 commit into
pypa:masterfrom
juliosuas:fix/free-threaded-python-aliases

Conversation

@juliosuas

Copy link
Copy Markdown

Fixes #1931.

This adds the common free-threaded aliases 3.13t and 3.14t to the Python distribution list, resolving them to the existing CPython standalone freethreaded artifacts.

A couple of details are covered here:

  • get_distribution("3.13t") keeps the requested alias as the distribution name while resolving sources from the base 3.13 distribution with variant_gil="freethreaded".
  • Free-threaded standalone archives use the full archive layout, so their Python executable is under python/install/bin/python3.
  • Installed distribution discovery no longer hard-filters directory names against the base distribution table, allowing installed 3.13t / 3.14t directories to be discovered from their metadata.

Tests:

PATH="$PWD/.venv/bin:$PATH" PYTHONPATH=src .venv/bin/python -m pytest tests/python/test_resolve.py tests/python/test_core.py -q -m "not requires_internet"
PATH="$PWD/.venv/bin:$PATH" PYTHONPATH=src .venv/bin/python -m pytest "tests/python/test_core.py::test_installation[3.13t]" "tests/python/test_core.py::test_installation[3.14t]" -q
PATH="$PWD/.venv/bin:$PATH" ruff check src/hatch/python/resolve.py src/hatch/python/core.py src/hatch/python/distributions.py tests/python/test_resolve.py tests/python/test_core.py
PATH="$PWD/.venv/bin:$PATH" ruff format --check src/hatch/python/resolve.py src/hatch/python/core.py src/hatch/python/distributions.py tests/python/test_resolve.py tests/python/test_core.py

@juliosuas
juliosuas force-pushed the fix/free-threaded-python-aliases branch from 9172e64 to 1ddd74c Compare June 3, 2026 10:31
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.

Support creating a free-threaded environment

1 participant