You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This action provides the following functionalities for GitHub Actions users:
7
+
This action provides the following functionality for GitHub Actions users:
8
8
9
9
- Optionally installing and adding to PATH a version of Python that is already installed in the runner's tool cache.
10
10
- Downloading, installing and adding to PATH an available version of Python from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases)) if a specific version is not available in the runner's tool cache.
@@ -35,19 +35,19 @@ steps:
35
35
python-version: 'pypy3.9'
36
36
- run: python my_script.py
37
37
```
38
-
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/PyPy version from the PATH will be used. The default version of Python/PyPy in PATH varies between runners and can be changed unexpectedly so we recommend always using `setup-python`.
38
+
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 using `setup-python`.
39
39
40
40
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/).
41
41
42
-
For information regarding locally cached versions of Python/PyPy on GitHub hosted runners, check out [GitHub Actions Virtual Environments](https://github.com/actions/virtual-environments).
42
+
For information regarding locally cached versions of Python or PyPy on GitHub hosted runners, check out [GitHub Actions Virtual Environments](https://github.com/actions/virtual-environments).
43
43
44
44
## Supported version syntax
45
45
46
46
The `python-version` input supports the [Semantic Versioning Specification](https://semver.org/) and some special version notations (e.g. `semver ranges`, `x.y-dev syntax`, etc.), for detailed examples please refer to the section: [Using python-version input](docs/advanced-usage.md#using-python-version-input) of the [Advanced usage](docs/advanced-usage.md) guide.
47
47
48
48
## Supported architectures
49
49
50
-
Using `architecture` input it is possible to specify the required Python/PyPy interpreter architecture: `x86`or `x64`. If the input is not specified the architecture defaults to `x64`.
50
+
Using `architecture` input it is possible to specify the required Python or PyPy interpreter architecture: `x86`or `x64`. If the input is not specified the architecture defaults to `x64`.
Copy file name to clipboardExpand all lines: docs/advanced-usage.md
+15-15
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@
14
14
-[Using `setup-python` with a self-hosted runner](advanced-usage.md#using-setup-python-with-a-self-hosted-runner)
15
15
-[Windows](advanced-usage.md#windows)
16
16
-[Linux](advanced-usage.md#linux)
17
-
-[MacOS](advanced-usage.md#macos)
17
+
-[macOS](advanced-usage.md#macos)
18
18
-[Using `setup-python` on GHES](advanced-usage.md#using-setup-python-on-ghes)
19
19
20
20
# Using python-version input
@@ -32,8 +32,8 @@ steps:
32
32
- run: python my_script.py
33
33
```
34
34
35
-
- The only downside to this is that set-up will take a little longer since the exact version will have to be downloaded if the exact version is not already installed on the runner due to more recent versions.
36
-
- MSI installers are used on Windows for this, so runs will take a little longer to set up vs MacOS and Linux.
35
+
- The only downside to this is that setup may take a little longer. If the exact version is not already installed on the runner due to more recent versions, the exact version will have to be downloaded.
36
+
- MSI installers are used on Windows for this, so runs will take a little longer to set up vs macOS and Linux.
37
37
38
38
You can specify **only a major and minor version** if you are okay with the most recent patch version being used:
39
39
@@ -131,7 +131,7 @@ More details on PyPy syntax can be found in the [Available versions of PyPy](#py
131
131
132
132
## Matrix Testing
133
133
134
-
Using `setup-python` it's possible to use [matrix syntax](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix) to install several versions of Python/PyPy:
134
+
Using `setup-python` it's possible to use [matrix syntax](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix) to install several versions of Python or PyPy:
135
135
136
136
```yaml
137
137
jobs:
@@ -178,7 +178,7 @@ jobs:
178
178
179
179
# Using python-version-file input
180
180
181
-
`setup-python` action can read Python/PyPy version from a version file. `python-version-file` input is used for specifying the path to the version file. If the file that was supplied to `python-version-file` input doesn't exist, the action will fail with error.
181
+
`setup-python` action can read Python or PyPy version from a version file. `python-version-file` input is used for specifying the path to the version file. If the file that was supplied to `python-version-file` input doesn't exist, the action will fail with error.
182
182
183
183
>In case both `python-version` and `python-version-file` inputs are supplied, the `python-version-file` input will be ignored due to its lower priority.
184
184
@@ -192,9 +192,9 @@ steps:
192
192
```
193
193
# Check latest version
194
194
195
-
The `check-latest` flag defaults to `false`. Use the default or set `check-latest` to `false` if you prefer stability and if you want to ensure a specific `Python/PyPy` version is always used.
195
+
The `check-latest` flag defaults to `false`. Use the default or set `check-latest` to `false` if you prefer stability and if you want to ensure a specific `Python or PyPy` version is always used.
196
196
197
-
If `check-latest` is set to `true`, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, a `Python/PyPy` version will then be downloaded. Set `check-latest` to `true` if you want the most up-to-date `Python/PyPy` version to always be used.
197
+
If `check-latest` is set to `true`, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, a `Python or PyPy` version will then be downloaded. Set `check-latest` to `true` if you want the most up-to-date `Python or PyPy` version to always be used.
198
198
199
199
```yaml
200
200
steps:
@@ -205,7 +205,7 @@ steps:
205
205
check-latest: true
206
206
- run: python my_script.py
207
207
```
208
-
> Setting `check-latest` to `true` has performance implications as downloading `Python/PyPy` versions is slower than using cached versions.
208
+
> Setting `check-latest` to `true` has performance implications as downloading `Python or PyPy` versions is slower than using cached versions.
209
209
210
210
211
211
# Caching packages data
@@ -284,7 +284,7 @@ steps:
284
284
285
285
### `python-version`
286
286
287
-
Using **python-version** output it's possible to get the installed by action Python/PyPy version. This output is useful when the input `python-version` is given as a range (e.g. 3.8.0 - 3.10.0 ), but down in a workflow you need to operate with the exact installed version (e.g. 3.10.1).
287
+
Using **python-version** output it's possible to get the installed by action Python or PyPy version. This output is useful when the input `python-version` is given as a range (e.g. 3.8.0 - 3.10.0 ), but down in a workflow you need to operate with the exact installed version (e.g. 3.10.1).
288
288
289
289
```yaml
290
290
jobs:
@@ -301,7 +301,7 @@ jobs:
301
301
302
302
### `python-path`
303
303
304
-
**python-path** output is available with the absolute path of the Python/PyPy interpreter executable if you need it:
304
+
**python-path** output is available with the absolute path of the Python or PyPy interpreter executable if you need it:
305
305
306
306
```yaml
307
307
jobs:
@@ -347,10 +347,10 @@ These environment variables become available after setup-python action execution
347
347
## Using `update-environment` flag
348
348
349
349
The `update-environment` flag defaults to `true`.
350
-
With this setting, the action will add/update environment variables (e.g. `PATH`, `PKG_CONFIG_PATH`, `pythonLocation`) for Python/PyPy to just work out of the box.
350
+
With this setting, the action will add/update environment variables (e.g. `PATH`, `PKG_CONFIG_PATH`, `pythonLocation`) for Python or PyPy to just work out of the box.
351
351
352
352
If `update-environment` is set to `false`, the action will not add/update environment variables.
353
-
This can prove useful if you want the only side-effect to be to ensure Python/PyPy is installed and rely on the `python-path` output to run executable.
353
+
This can prove useful if you want the only side-effect to be to ensure Python or PyPy is installed and rely on the `python-path` output to run executable.
354
354
Such a requirement on side-effect could be because you don't want your composite action messing with your user's workflows.
355
355
356
356
```yaml
@@ -378,7 +378,7 @@ Such a requirement on side-effect could be because you don't want your composite
378
378
- All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/main/versions-manifest.json) file.
379
379
- If there is a specific version of Python that is not available, you can open an issue here
380
380
381
-
>**Note:** Python versions used in this action are generated in the [python-versions](https://github.com/actions/python-versions) repository. For MacOS and Ubuntu images, python versions are built from the source code. For Windows, the python-versions repository uses installation executable. For more information please refer to the [python-versions](https://github.com/actions/python-versions) repository.
381
+
>**Note:** Python versions used in this action are generated in the [python-versions](https://github.com/actions/python-versions) repository. For macOS and Ubuntu images, python versions are built from the source code. For Windows, the python-versions repository uses installation executable. For more information please refer to the [python-versions](https://github.com/actions/python-versions) repository.
382
382
383
383
## PyPy
384
384
@@ -447,9 +447,9 @@ One quick way to grant access is to change the user and group of the non-default
447
447
> If your runner is configured as a service and you run into problems, make sure the user that the service is running as is correct. For more information, you can [check the status of your self-hosted runner](https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service#checking-the-status-of-the-service).
448
448
449
449
450
-
## MacOS
450
+
## macOS
451
451
452
-
The Python packages for MacOS that are downloaded from `actions/python-versions` are originally compiled from the source in `/Users/runner/hostedtoolcache`. Due to the fixed shared library path, these Python packages are non-relocatable and require to be installed only in `/Users/runner/hostedtoolcache`. Before the use of `setup-python` on the MacOS self-hosted runner:
452
+
The Python packages for macOS that are downloaded from `actions/python-versions` are originally compiled from the source in `/Users/runner/hostedtoolcache`. Due to the fixed shared library path, these Python packages are non-relocatable and require to be installed only in `/Users/runner/hostedtoolcache`. Before the use of `setup-python` on the macOS self-hosted runner:
453
453
454
454
- Create a directory called `/Users/runner/hostedtoolcache`
455
455
- Change the permissions of `/Users/runner/hostedtoolcache` so that the runner has write access
0 commit comments