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
Copy file name to clipboardExpand all lines: docs/advanced-usage.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -278,9 +278,9 @@ jobs:
278
278
279
279
## Using the `python-version-file` input
280
280
281
-
`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.
281
+
`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.
282
282
283
-
>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.
283
+
>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. The .tool-versions file supports version specifications in accordance with asdf standards, adhering to Semantic Versioning ([semver](https://semver.org)).
284
284
285
285
```yaml
286
286
steps:
@@ -300,6 +300,15 @@ steps:
300
300
- run: python my_script.py
301
301
```
302
302
303
+
```yaml
304
+
steps:
305
+
- uses: actions/checkout@v4
306
+
- uses: actions/setup-python@v5
307
+
with:
308
+
python-version-file: '.tool-versions' # Read python version from a file .tool-versions
309
+
- run: python my_script.py
310
+
```
311
+
303
312
## Check latest version
304
313
305
314
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.
0 commit comments