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: README.md
+20-20
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,17 @@
6
6
7
7
This action sets up a Python environment for use in actions by:
8
8
9
-
- optionally installing and adding to PATH a version of Python that is already installed in the tools 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 tools cache
11
-
- failing if a specific version of Python is not preinstalled or available for download
12
-
- registering problem matchers for error output
9
+
- optionally installing and adding to PATH a version of Python that is already installed in the tools 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 tools cache.
11
+
- failing if a specific version of Python is not preinstalled or available for download.
12
+
- registering problem matchers for error output.
13
13
14
14
# What's new
15
15
16
-
- Ability to download, install and set up Python packages from `actions/python-versions` that do not come preinstalled on runners
17
-
- Allows for pinning to a specific patch version of Python without the worry of it ever being removed or changed
18
-
- Automatic setup and download of Python packages if using a self-hosted runner
19
-
- Support for pre-release versions of Python
16
+
- Ability to download, install and set up Python packages from `actions/python-versions` that do not come preinstalled on runners.
17
+
- Allows for pinning to a specific patch version of Python without the worry of it ever being removed or changed.
18
+
- Automatic setup and download of Python packages if using a self-hosted runner.
19
+
- Support for pre-release versions of Python.
20
20
21
21
# Usage
22
22
@@ -122,14 +122,14 @@ Check out our detailed guide on using [Python with GitHub Actions](https://help.
122
122
123
123
`setup-python` is able to configure Python from two sources:
124
124
125
-
- Preinstalled versions of Python in the tools cache on GitHub-hosted runners
125
+
- Preinstalled versions of Python in the tools cache on GitHub-hosted runners.
126
126
- 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).
127
127
- For every minor version of Python, expect only the latest patch to be preinstalled.
128
128
- If `3.8.1` is installed for example, and `3.8.2` is released, expect `3.8.1` to be removed and replaced by `3.8.2` in the tools cache.
129
129
- If the exact patch version doesn't matter to you, specifying just the major and minor version will get you the latest preinstalled patch version. In the previous example, the version spec `3.8` will use the `3.8.2` Python version found in the cache.
130
-
- Downloadable Python versions from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases))
130
+
- Downloadable Python versions from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases)).
131
131
- All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/main/versions-manifest.json) file.
132
-
- If there is a specific version of Python that is not available, you can open an issue here
132
+
- If there is a specific version of Python that is not available, you can open an issue here.
133
133
134
134
# Hosted Tool Cache
135
135
@@ -174,22 +174,22 @@ If you are experiencing problems while configuring Python on your self-hosted ru
174
174
175
175
- The Python packages that are downloaded from `actions/python-versions` are originally compiled from source in `/opt/hostedtoolcache/` with the [--enable-shared](https://github.com/actions/python-versions/blob/94f04ae6806c6633c82db94c6406a16e17decd5c/builders/ubuntu-python-builder.psm1#L35) flag, which makes them non-relocatable.
176
176
- Create an environment variable called `AGENT_TOOLSDIRECTORY` and set it to `/opt/hostedtoolcache`. This controls where the runner downloads and installs tools.
177
-
- In the same shell that your runner is using, type `export AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`
177
+
- In the same shell that your runner is using, type `export AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`.
178
178
- A more permanent way of setting the environment variable is to create a `.env` file in the same directory as your runner and to add `AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`. This ensures the variable is always set if your runner is configured as a service.
179
179
- Create a directory called `hostedtoolcache` inside `/opt`.
180
180
- The user starting the runner must have write permission to the `/opt/hostedtoolcache` directory. It is not possible to start the Linux runner with `sudo` and the `/opt` directory usually requires root privileges to write to. Check the current user and group that the runner belongs to by typing `ls -l` inside the runners root directory.
181
181
- The runner can be granted write access to the `/opt/hostedtoolcache` directory using a few techniques:
182
-
- The user starting the runner is the owner, and the owner has write permission
183
-
- The user starting the runner is in the owning group, and the owning group has write permission
184
-
- All users have write permission
185
-
- One quick way to grant access is to change the user and group of `/opt/hostedtoolcache` to be the same as the runners using `chown`
- 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://help.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service#checking-the-status-of-the-service).
188
188
189
189
### Mac
190
190
191
191
- The same setup that applies to `Linux` also applies to `Mac`, just with a different tools cache directory.
192
-
- Create a directory called `/Users/runner/hostedtoolcache`
192
+
- Create a directory called `/Users/runner/hostedtoolcache`.
193
193
- Set the `AGENT_TOOLSDIRECTORY` environment variable to `/Users/runner/hostedtoolcache`.
194
194
- Change the permissions of `/Users/runner/hostedtoolcache` so that the runner has write access.
195
195
@@ -200,8 +200,8 @@ If you are experiencing problems while configuring Python on your self-hosted ru
200
200
201
201
# License
202
202
203
-
The scripts and documentation in this project are released under the [MIT License](LICENSE)
203
+
The scripts and documentation in this project are released under the [MIT License](LICENSE).
204
204
205
205
# Contributions
206
206
207
-
Contributions are welcome! See our [Contributor's Guide](docs/contributors.md)
207
+
Contributions are welcome! See our [Contributor's Guide](docs/contributors.md).
0 commit comments