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
* docs: fix outputs python-version example and description
Description was lacking words, example was misleading (id was set to cp310 which clearly was a reference to CPython 3.10, but the id is referring to the setup-python action!
* docs: copy-editing in advanced-usage.md
Signed-off-by: Stephen L. <lrq3000@gmail.com>
* docs: add example if statement in advanced-usage.md
Signed-off-by: Stephen L. <lrq3000@gmail.com>
* docs: implement changes suggested by @mahabaleshwars (deprecate pypy2.7, 3.7, 3.8, tweak example, remove wildcard *)
Signed-off-by: Stephen L. <LRQ3000@gmail.com>
---------
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Signed-off-by: Stephen L. <LRQ3000@gmail.com>
Copy file name to clipboardexpand all lines: docs/advanced-usage.md
+18-17
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ steps:
101
101
- run: python my_script.py
102
102
```
103
103
104
-
- **[x-ranges](https://github.com/npm/node-semver#x-ranges-12x-1x-12-)** to specify the latest stable version of Python (for specified major version):
104
+
- **[x-ranges](https://github.com/npm/node-semver#x-ranges-12x-1x-12-)** to specify the latest stable version of Python (for the specified major version):
105
105
106
106
```yaml
107
107
steps:
@@ -120,7 +120,6 @@ The `-v<pypy_version>` parameter is optional and can be skipped. The latest PyPy
120
120
```
121
121
pypy3.10 or pypy-3.10 # the latest available version of PyPy that supports Python 3.10
122
122
pypy3.9 or pypy-3.9 # the latest available version of PyPy that supports Python 3.9
123
-
pypy2.7 or pypy-2.7 # the latest available version of PyPy that supports Python 2.7
124
123
pypy3.7-v7.3.3 or pypy-3.7-v7.3.3 # Python 3.7 and PyPy 7.3.3
125
124
pypy3.7-v7.x or pypy-3.7-v7.x # Python 3.7 and the latest available PyPy 7.x
126
125
pypy3.7-v7.3.3rc1 or pypy-3.7-v7.3.3rc1 # Python 3.7 and preview version of PyPy
@@ -145,7 +144,7 @@ jobs:
145
144
python-version: ${{ matrix.python-version }}
146
145
- run: python my_script.py
147
146
```
148
-
More details on PyPy syntax can be found in the [Available versions of PyPy](#pypy) section.
147
+
More details on the syntax for PyPy can be found in the [Available versions of PyPy](#pypy) section.
149
148
150
149
### Specifying multiple Python/PyPy versions
151
150
The python-version input can get multiple python/pypy versions. The last specified version will be used as a default one.
@@ -205,15 +204,15 @@ jobs:
205
204
206
205
### Matrix Testing
207
206
208
-
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:
207
+
Using `setup-python` it's possible to use the [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:
if: ${{ matrix.python-version != 'pypy3.9' }} # Use single quotes in expressions for input `python-version`
250
251
run: python --version
251
252
```
252
253
253
254
## Using the `python-version-file` input
254
255
255
-
`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.
256
+
`setup-python`action can read the Python or PyPy version from a version file. `python-version-file` input is used to specify 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 an error.
256
257
257
258
>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.
258
259
@@ -289,7 +290,7 @@ steps:
289
290
check-latest: true
290
291
- run: python my_script.py
291
292
```
292
-
> Setting `check-latest` to `true` has performance implications as downloading `Python or PyPy` versions is slower than using cached versions.
293
+
> Setting `check-latest` to `true` impacts performance as downloading `Python or PyPy` versions is slower than using cached versions.
293
294
294
295
295
296
## Caching packages
@@ -383,7 +384,7 @@ steps:
383
384
384
385
### `python-version`
385
386
386
-
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.12.0), but down in a workflow you need to operate with the exact installed version (e.g. 3.12.1).
387
+
Using **python-version** output, it's possible to get the precise Python or PyPy version installed by the action. This output is useful when the input `python-version` is given as a range (e.g. 3.9.0 - 3.12.0, 3.x ), but down the line you need to operate (such as in an `if:` statement) with the exact installed version (e.g. 3.12.0).
**python-path** output is available with the absolute path of the Python or PyPy interpreter executable if you need it:
404
+
**python-path** output is available to get the absolute path of the Python or PyPy interpreter executable:
404
405
405
406
```yaml
406
407
jobs:
@@ -449,7 +450,7 @@ The `update-environment` flag defaults to `true`.
449
450
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.
450
451
451
452
If `update-environment` is set to `false`, the action will not add/update environment variables.
452
-
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.
453
+
This can prove useful if you only want the side-effect to ensure that Python or PyPy is installed and rely on the `python-path` output to run the executable.
453
454
Such a requirement on side-effect could be because you don't want your composite action messing with your user's workflows.
454
455
455
456
```yaml
@@ -469,7 +470,7 @@ Such a requirement on side-effect could be because you don't want your composite
469
470
470
471
- Preinstalled versions of Python in the tool cache on GitHub-hosted runners.
471
472
- For detailed information regarding the available versions of Python that are installed, see [Supported software](https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners#supported-software).
472
-
- For every minor version of Python, expect only the latest patch to be preinstalled.
473
+
- For every minor versions of Python, expect only the latest patch to be preinstalled.
473
474
- If `3.12.1` is installed for example, and `3.12.2` is released, expect `3.12.1` to be removed and replaced by `3.12.2` in the tool cache.
474
475
- If the exact patch version doesn't matter to you, specifying just the major and minor versions will get you the latest preinstalled patch version. In the previous example, the version spec `3.12` will use the `3.12.2` Python version found in the cache.
475
476
- Use `-dev` instead of a patch number (e.g., `3.14-dev`) to install the latest patch version release for a given minor version, *alpha and beta releases included*.
@@ -534,11 +535,11 @@ If you have a supported self-hosted runner and you would like to use `setup-pyth
534
535
535
536
### Linux
536
537
537
-
By default runner downloads and installs tools into the folder set up by `RUNNER_TOOL_CACHE` environment variable. The environment variable called `AGENT_TOOLSDIRECTORY` can be set to change this location for Linux self-hosted runners:
538
+
By default, the runner downloads and installs tools into the folder set up by `RUNNER_TOOL_CACHE` environment variable. The environment variable called `AGENT_TOOLSDIRECTORY` can be set to change this location for Linux self-hosted runners:
538
539
- In the same shell that your runner is using, type `export AGENT_TOOLSDIRECTORY=/path/to/folder`.
539
540
- More permanent way of setting the environment variable is to create an `.env` file in the same directory as your runner and to add `AGENT_TOOLSDIRECTORY=/path/to/folder`. This ensures the variable is always set if your runner is configured as a service.
540
541
541
-
If you're using a non-default tool cache directory be sure that the user starting the runner has write permission to the new tool cache directory. To check the current user and group that the runner belongs type `ls -l` inside the runner's root directory.
542
+
If you're using a non-default tool cache directory be sure that the user starting the runner has write permission to the new tool cache directory. To check the current user and group that the runner belongs, type `ls -l` inside the runner's root directory.
542
543
543
544
The runner can be granted write access to any directory using a few techniques:
544
545
- The user starting the runner is the owner, and the owner has write permission.
0 commit comments