Skip to content
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

Add python 3.13 free-threaded build #320

Closed
bschoenmaeckers opened this issue Sep 6, 2024 · 5 comments · Fixed by #326
Closed

Add python 3.13 free-threaded build #320

bschoenmaeckers opened this issue Sep 6, 2024 · 5 comments · Fixed by #326

Comments

@bschoenmaeckers
Copy link

The free-threaded build of python is still in beta but it would be great to make it available so users can test it.

ref #263, #319

@zanieb
Copy link
Member

zanieb commented Sep 8, 2024

I'll start working on this.

@zanieb
Copy link
Member

zanieb commented Sep 8, 2024

So I got the builds working on macOS (woo) but I don't know how to tag them?

If we have cpython-3.13.0rc2-aarch64-apple-darwin-noopt-20240907T1906.tar.zst how are we supposed to add a free-threaded tag? e.g. 3.13.0rc2t and 3.13.0trc2 are both "invalid" versions.

Similarly, in uv we'll need a way for users to request these versions. I thought --python 3.13t made sense but the collision with pre-release tags is a problematic. We can definitely strip the t when parsing the version but I'm not sure if it's "the right thing".

@ncoghlan
Copy link

ncoghlan commented Sep 8, 2024

Fedora just called its free-threaded binary RPM python3.13-freethreading rather than trying to abbreviate at that level. The t flag is part of the ABI tag rather than part of the version number, so formats that are looking for the true version number won't accept it.

I'm not sure what the noopt in the cpython-3.13.0rc2-aarch64-apple-darwin-noopt-20240907T1906.tar.zst, but if it indicates the "default, with no options" build, then cpython-3.13.0rc2-aarch64-apple-darwin-freethreading-20240907T1906.tar.zst may work.

At request time, accepting python3.13t matches the installed binary name, so it seems like the most straightforward solution.

Edit: oh, I see what you mean with the second question. How to request an exact version (down to the minor release number, or even pre-release serial), while still adding the t suffix. I'd suggest requiring an extra underscore for those cases: 3.13.0rc2_t, 3.13.0_t, 3.14.0a1_t, etc. I started a Discourse thread for that idea here: https://discuss.python.org/t/suggested-convention-for-a-free-threading-build-marker-on-exact-python-versions/63279

Edit 2: Zanie clarified that noopt is "only default optimizations", rather than "only default options", so it isn't relevant here.

@indygreg
Copy link
Collaborator

indygreg commented Sep 8, 2024

It should go in the build configuration "field" denoted by a +. Eg. freethreaded+pgo

@zanieb
Copy link
Member

zanieb commented Sep 8, 2024

👍 cool thanks, that makes sense per the description at https://gregoryszorc.com/docs/python-build-standalone/main/running.html#obtaining-distributions

We'll need to figure out the ux in uv, I believe right now we only expose one build option variant to users at a time. But we can track that in astral-sh/uv#4828 and astral-sh/uv#7193.

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 a pull request may close this issue.

4 participants