diff --git a/README.md b/README.md index 6ffab1fa..5e73889a 100644 --- a/README.md +++ b/README.md @@ -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/). diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index 774bcefe..dc8665d3 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -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-version: '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: