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

Support free threaded Python versions like '3.13t' #973

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

colesbury
Copy link

Python wheels, pyenv, and a number of other tools use 't' in the Python version number to identify free threaded builds. For example, '3.13t', '3.14.0a1', '3.14t-dev'.

This PR supports that syntax in actions/setup-python, strips the "t", and adds "-freethreading" to the architecture to select the correct Python version.

See #771 and actions/python-versions#319

Python wheels, pyenv, and a number of other tools use 't' in the Python
version number to identify free threaded builds. For example, '3.13t',
'3.14.0a1', '3.14t-dev'.

This PR supports that syntax in `actions/setup-python`, strips the "t",
and adds "-freethreading" to the architecture to select the correct
Python version.

See actions#771
@renxida
Copy link

renxida commented Nov 24, 2024

Meanwhile, if you can't wait, here at https://github.com/nod-ai/shark-ai/actions/workflows/ci_linux_x64_nogil-libshortfin.yml

we are using

    - name: Setup Python
      uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0
      with:
        python-version: "3.13-dev"
        nogil : true

@rgommers
Copy link

rgommers commented Nov 24, 2024

If anyone needs the functionality in this PR, I'd recommend to use https://github.com/Quansight-Labs/setup-python. That is a fork of this action with the sole purpose of providing the functionality in this PR (free-threading support) until this PR gets merged (see this issue for context).

Data point for reviewers: we've exercised this PR quite heavily by now in projects like NumPy and SciPy, on Linux, macOS and Windows (x86-64 and aarch64/arm64), and it's been working smoothly to date.

@priyagupta108
Copy link
Contributor

Hi @colesbury 👋,
Thank you for your valuable contribution!
During our testing, we observed that the changes in this PR do not support specifying the patch version (e.g., 3.13.1t) for the python-version input for the free-threaded binary. Please ensure that the python-version input values align with the existing input syntax.
Additionally, To keep the documentation up-to-date, please update this PR to incorporate the corresponding documentation updates.

Thank you!

@ddelange
Copy link

Also noting here that 3.13 and 3.13t currently don't live happily next to each other on Windows: Quansight-Labs#5 (comment)

@colesbury
Copy link
Author

Hi @priyagupta108, thank you for reviewing the PR. I've fixed the handling of versions like 3.13.1t and added a test for that. I've also updated the README and "advanced-usage" documentation.

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.

5 participants