Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/actions/setup-python into dist
Browse files Browse the repository at this point in the history
  • Loading branch information
Shegox committed Jan 26, 2024
2 parents 41581bf + 871daa9 commit 210d2b3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -19,7 +19,7 @@ See [action.yml](action.yml)
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python my_script.py
Expand All @@ -29,7 +29,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 'pypy3.9'
- run: python my_script.py
Expand All @@ -39,7 +39,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 'graalpy-22.3'
- run: python my_script.py
Expand Down Expand Up @@ -74,7 +74,7 @@ The action defaults to searching for a dependency file (`requirements.txt` or `p
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
Expand All @@ -93,7 +93,7 @@ See examples of using `cache` and `cache-dependency-path` for `pipenv` and `poet
- [Check latest version](docs/advanced-usage.md#check-latest-version)
- [Caching packages](docs/advanced-usage.md#caching-packages)
- [Outputs and environment variables](docs/advanced-usage.md#outputs-and-environment-variables)
- [Available versions of Python and PyPy](advanced-usage.md#available-versions-of-python-pypy-and-graalpy)
- [Available versions of Python, PyPy and GraalPy](docs/advanced-usage.md#available-versions-of-python-pypy-and-graalpy)
- [Hosted tool cache](docs/advanced-usage.md#hosted-tool-cache)
- [Using `setup-python` with a self-hosted runner](docs/advanced-usage.md#using-setup-python-with-a-self-hosted-runner)
- [Using `setup-python` on GHES](docs/advanced-usage.md#using-setup-python-on-ghes)
Expand Down
60 changes: 30 additions & 30 deletions docs/advanced-usage.md
Expand Up @@ -2,7 +2,7 @@
- [Using the python-version input](advanced-usage.md#using-the-python-version-input)
- [Specifying a Python version](advanced-usage.md#specifying-a-python-version)
- [Specifying a PyPy version](advanced-usage.md#specifying-a-pypy-version)
- [Specifying multiple Python and PyPy versions](advanced-usage.md#specifying-multiple-python/pypy-version)
- [Specifying multiple Python/PyPy versions](advanced-usage.md#specifying-multiple-pythonpypy-versions)
- [Matrix Testing](advanced-usage.md#matrix-testing)
- [Using the python-version-file input](advanced-usage.md#using-the-python-version-file-input)
- [Check latest version](advanced-usage.md#check-latest-version)
Expand Down Expand Up @@ -32,7 +32,7 @@ If there is a specific version of Python that you need and you don't want to wor
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7.5'
- run: python my_script.py
Expand All @@ -46,7 +46,7 @@ You can specify **only a major and minor version** if you are okay with the most
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7'
- run: python my_script.py
Expand All @@ -60,7 +60,7 @@ You can specify the version with **prerelease tag** to download and set up an ac
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12.0-alpha.1'
- run: python my_script.py
Expand All @@ -71,7 +71,7 @@ It's also possible to use **x.y-dev syntax** to download and set up the latest p
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12-dev'
- run: python my_script.py
Expand All @@ -84,7 +84,7 @@ You can also use several types of ranges that are specified in [semver](https://
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '>=3.9 <3.10'
- run: python my_script.py
Expand All @@ -95,7 +95,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12.0-alpha - 3.12.0'
- run: python my_script.py
Expand All @@ -106,7 +106,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: python my_script.py
Expand Down Expand Up @@ -139,14 +139,14 @@ jobs:
- 'pypy3.7-v7.3.3' # Python 3.7 and PyPy 7.3.3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python my_script.py
```
More details on PyPy syntax can be found in the [Available versions of PyPy](#pypy) section.

### Specifying multiple Python/PyPy version
### Specifying multiple Python/PyPy versions
The python-version input can get multiple python/pypy versions. The last specified version will be used as a default one.

Download and set up multiple Python versions:
Expand All @@ -157,7 +157,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: |
3.8
Expand All @@ -174,7 +174,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: |
pypy-3.7-v7.3.x
Expand All @@ -191,7 +191,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: |
3.8
Expand All @@ -217,7 +217,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -242,7 +242,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
Expand All @@ -258,7 +258,7 @@ jobs:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version-file: '.python-version' # Read python version from a file .python-version
- run: python my_script.py
Expand All @@ -267,7 +267,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml' # Read python version from a file pyproject.toml
- run: python my_script.py
Expand All @@ -282,7 +282,7 @@ If `check-latest` is set to `true`, the action first checks if the cached versio
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7'
check-latest: true
Expand All @@ -297,7 +297,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pipenv'
Expand All @@ -312,7 +312,7 @@ steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'poetry'
Expand All @@ -324,7 +324,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pipenv'
Expand All @@ -339,7 +339,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
Expand All @@ -351,7 +351,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
Expand All @@ -366,7 +366,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand All @@ -389,7 +389,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
id: cp310
with:
python-version: "3.8.0 - 3.10.0"
Expand All @@ -406,7 +406,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
id: cp310
with:
python-version: "3.10"
Expand All @@ -422,7 +422,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
id: cp310
with:
python-version: "3.8.0"
Expand Down Expand Up @@ -453,7 +453,7 @@ Such a requirement on side-effect could be because you don't want your composite
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
id: cp310
with:
python-version: '3.10'
Expand Down Expand Up @@ -586,7 +586,7 @@ Here are the steps you need to follow to avoid the rate limit:

```yml
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
token: ${{ secrets.GH_GITHUB_COM_TOKEN }}
Expand Down Expand Up @@ -618,7 +618,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python_version }}"
allow-prereleases: true
Expand Down

0 comments on commit 210d2b3

Please sign in to comment.