8000 Support free threaded Python versions like '3.13t' by colesbury · Pull Request #973 · actions/setup-python · GitHub
[go: up one dir, main page]

Skip to content

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

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

Merged
merged 11 commits into from
Mar 4, 2025
Merged
Prev Previous commit
Next Next commit
Add free threading to advanced usage documentation
  • Loading branch information
colesbury committed Jan 22, 2025
commit c70f76ebc5899ddfa563913ad6ee343ab2e88624
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ steps:
- run: python my_script.py
```

**Free threaded Python**
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13t'
- run: python my_script.py
```

The `python-version` input is optional. If not supplied, the action will try to resolve the version from the default `.python-version` file. If the `.python-version` file doesn't exist Python or PyPy version from the PATH will be used. The default version of Python or PyPy in PATH varies between runners and can be changed unexpectedly so we recommend always setting Python version explicitly using the `python-version` or `python-version-file` inputs.

The action will first check the local [tool cache](docs/advanced-usage.md#hosted-tool-cache) for a [semver](https://github.com/npm/node-semver#versions) match. If unable to find a specific version in the tool cache, the action will attempt to download a version of Python from [GitHub Releases](https://github.com/actions/python-versions/releases) and for PyPy from the official [PyPy's dist](https://downloads.python.org/pypy/).
Expand Down
14 changes: 14 additions & 0 deletions docs/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ steps:
- run: python my_script.py
```

Use the **t** suffix to select the [free threading](https://docs.python.org/3/howto/free-threading-python.html) version of Python.
Free threaded Python is only available starting with the 3.13 release.

```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-vers 536F ion: '3.13t'
- run: python my_script.py
```

Pre-release free threading versions should be specified like `3.14.0ta3` or `3.14t-dev`.

You can also use several types of ranges that are specified in [semver](https://github.com/npm/node-semver#ranges), for instance:

- **[ranges](https://github.com/npm/node-semver#ranges)** to download and set up the latest available version of Python satisfying a range:
Expand Down
0