-
-
Notifications
You must be signed in to change notification settings - Fork 538
Feat: free-threaded python support #3526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: free-threaded python support #3526
Conversation
The approach looks good 😁 |
233dba0
to
f00b109
Compare
d804cfb
to
5a4298b
Compare
@gaborbernat that's interesting. The readthedocs build is failing because it's installing Now the question is how to best proceed. WDYT? Give the attribute a default value? Accept breaking the API? Something else entirely? |
This 😊 |
6d51f85
to
bcc9f37
Compare
7f6329f
to
04f2bd4
Compare
Signed-off-by: Bernát Gábor <[email protected]>
04f2bd4
to
4ccf8ad
Compare
Signed-off-by: Bernát Gábor <[email protected]>
I was about to pick this up again. Thanks for continuing. There was also another test I was about to adjust. Further, I wanted to discuss the fact that |
Yeah made it a dataclass. I'm fine breaking unpacking here.
Feel free to put in a new PR if there's anything else we can improve. Thanks! |
I am trying to use this, and noticed that if I do e.g. |
PR welcome 😁 |
@astrofrog I cannot reproduce the issue. Here's what I tried (inside a export DEBIAN_FRONTEND=noninteractive
cd /root
apt update
apt install -y locales
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
export LANG=en_US.UTF-8
apt-get install -y --no-install-recommends build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev ca-certificates vim git software-properties-common tar
curl -fsSL https://pyenv.run | bash
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - bash)"
pyenv install 3.13
pyenv install 3.12
pyenv global 3.13 3.12
pyenv rehash
python3.12 -m pip install tox
mkdir -p /root/tmp
cd /root/tmp
cat << EOF > pyproject.toml
[project]
name = "foo"
version = "0.0.1"
[build-system]
requires = ["setuptools >= 77.0.3"]
build-backend = "setuptools.build_meta"
[tool.tox]
requires = ["tox>=4.26"]
env_list = ["py313-test"]
[tool.tox.env.py313-test]
commands = [
["python", "-VV"]
]
EOF
# works, prints "Python 3.13.4 (main, Jun 7 2025, 13:03:46) [GCC 13.3.0]"
python3.12 -m tox
sed -i 's/py313-test/py313t-test/' pyproject.toml
# fails as expected with "py313t: skipped because could not find python interpreter with spec(s): py313t"
python3.12 -m tox |
This PR adds support for experimental no-GIL CPython builds (aka. free-threaded).
It gives special semantics to factors like
py313t
which will then only select free-threaded Python 3.13.Note
This also means that factors like
py313
will no longer match free-threaded CPython builds.Related pypa/virtualenv#2809,
Closes: #3391
tox -e fix
)docs/changelog
folderPlease be aware that
py313
potentially also picking a free-threaded CPython build, that would break and they'd have to update their tox factor name topy313t
. I'm not sure there's a design that circumvents that.