Skip to content

Commit 81cda82

Browse files
author
IvanZosimov
committed
Fix review points
1 parent b152b04 commit 81cda82

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
This action provides the following functionalities for GitHub Actions users:
88

9-
- Optionally downloading and installing the requested version of Python/PyPy and adding it to the PATH
9+
- Optionally installing and adding to PATH a version of Python that is already installed in the runner's tool cache.
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.
11+
- Failing if a specific version of Python is not preinstalled or available for download.
1012
- Optionally caching dependencies for pip, pipenv and poetry
1113
- Registering problem matchers for error output
1214

@@ -18,7 +20,7 @@ See [action.yml](action.yml)
1820
```yaml
1921
steps:
2022
- uses: actions/checkout@v3
21-
- uses: actions/setup-python@v4 # <- v4 is a major release tag of the action: https://github.com/actions/setup-python/tags
23+
- uses: actions/setup-python@v4
2224
with:
2325
python-version: '3.10'
2426
- run: python my_script.py
@@ -49,7 +51,7 @@ Using `architecture` input it is possible to specify the required Python/PyPy in
4951

5052
## Caching packages dependencies
5153

52-
The action has built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching dependencies but requires less configuration settings. Supported package managers are `pip`, `pipenv` and `poetry`. The `cache` input is optional, and caching is turned off by default.
54+
The action has built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under the hood for caching dependencies but requires less configuration settings. Supported package managers are `pip`, `pipenv` and `poetry`. The `cache` input is optional, and caching is turned off by default.
5355

5456
The action defaults to searching for a dependency file (`requirements.txt` for pip, `Pipfile.lock` for pipenv or `poetry.lock` for poetry) in the repository, and uses its hash as a part of the cache key. Input `cache-dependency-path` is used for cases when multiple dependency files are used, they are located in different subdirectories or different files for the hash that want to be used.
5557

action.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
---
2-
name: 'Setup Python'
3-
description: 'Set up a specific version of Python and add the command-line tools to the PATH.'
4-
author: 'GitHub'
2+
name: "Setup Python"
3+
description: "Set up a specific version of Python and add the command-line tools to the PATH."
4+
author: "GitHub"
55
inputs:
66
python-version:
77
description: "Version range or exact version of Python/PyPy to use, using SemVer's version range syntax. Reads from .python-version if unset."
88
python-version-file:
99
description: "File containing the Python version to use. Example: .python-version"
1010
cache:
11-
description: 'Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry.'
11+
description: "Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry."
1212
required: false
1313
architecture:
1414
description: "The target architecture (x86, x64) of the Python/PyPy interpreter."
1515
check-latest:
16-
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec.'
16+
description: "Set this option if you want the action to check for the latest available version that satisfies the version spec."
1717
default: false
1818
token:
1919
description: "Used to pull python distributions from actions/python-versions. Since there's a default, this is typically not supplied by the user."
2020
default: ${{ github.token }}
2121
cache-dependency-path:
22-
description: 'Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies.'
22+
description: "Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies."
2323
update-environment:
24-
description: 'Set this option if you want the action to update environment variables.'
24+
description: "Set this option if you want the action to update environment variables."
2525
default: true
2626
outputs:
2727
python-version:
2828
description: "The installed Python/PyPy version. Useful when given a version range as input."
2929
cache-hit:
30-
description: 'A boolean value to indicate a cache entry was found'
30+
description: "A boolean value to indicate a cache entry was found"
3131
python-path:
3232
description: "The absolute path to the Python/PyPy executable."
3333
runs:

docs/advanced-usage.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Table of contents
1+
# Contents
22
- [Using python-version input](advanced-usage.md#using-python-version-file-input)
33
- [Specifying a Python version](advanced-usage.md#specifying-a-python-version)
44
- [Specifying a PyPy version](advanced-usage.md#specifying-a-pypy-version)
@@ -19,11 +19,9 @@
1919

2020
# Using python-version input
2121

22-
The `python-version` input is used to specify the required version of Python or PyPy.
23-
2422
## Specifying a Python version
2523

26-
If there is a specific version of Python that you need and you don't want to worry about any potential breaking changes due to patch updates (going from `3.7.5` to `3.7.6` for example), you should specify the **exact major, minor, and patch version** (such as `3.7.5`):
24+
If there is a specific version of Python that you need and you don't want to worry about any potential breaking changes due to patch updates (going from `3.7.5` to `3.7.6` for example), you should specify the ***exact major, minor, and patch version*** (such as `3.7.5`):
2725

2826
```yaml
2927
steps:
@@ -36,7 +34,7 @@ steps:
3634
- 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.
3735
- MSI installers are used on Windows for this, so runs will take a little longer to set up vs MacOS and Linux.
3836
39-
You can specify **only a major and minor version** if you are okay with the most recent patch version being used:
37+
You can specify ***only a major and minor version*** if you are okay with the most recent patch version being used:
4038
4139
```yaml
4240
steps:
@@ -50,7 +48,7 @@ steps:
5048
- The patch version that will be preinstalled, will generally be the latest and every time there is a new patch released, the older version that is preinstalled will be replaced.
5149
- Using the most recent patch version will result in a very quick setup since no downloads will be required since a locally installed version of Python on the runner will be used.
5250
53-
You can specify the version with **prerelease tag** to download and set up an accurate pre-release version of Python:
51+
You can specify the version with ***prerelease tag*** to download and set up an accurate pre-release version of Python:
5452
5553
```yaml
5654
steps:
@@ -61,7 +59,7 @@ steps:
6159
- run: python my_script.py
6260
```
6361
64-
It's also possible to use **x.y-dev syntax** to download and set up the latest patch version of Python, alpha and beta releases included. (for specified major & minor versions):
62+
It's also possible to use ***x.y-dev syntax*** to download and set up the latest patch version of Python, alpha and beta releases included. (for specified major & minor versions):
6563
6664
```yaml
6765
steps:
@@ -74,7 +72,7 @@ steps:
7472
7573
You can also use several types of ranges that are specified in [semver](https://github.com/npm/node-semver#ranges), for instance:
7674
77-
- **[hyphen ranges](https://github.com/npm/node-semver#hyphen-ranges-xyz---abc)** to download and set up the latest available version of Python (includes both pre-release and stable versions):
75+
- ***[hyphen ranges](https://github.com/npm/node-semver#hyphen-ranges-xyz---abc)*** to download and set up the latest available version of Python (includes both pre-release and stable versions):
7876
7977
```yaml
8078
steps:
@@ -85,7 +83,7 @@ steps:
8583
- run: python my_script.py
8684
```
8785
88-
- **[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):
86+
- ***[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):
8987
9088
```yaml
9189
steps:

0 commit comments

Comments
 (0)