mirror of
https://github.com/actions/setup-python.git
synced 2024-12-27 09:55:23 +01:00
Update README.md (#145)
This commit is contained in:
parent
878156f1de
commit
41b7212b16
1 changed files with 20 additions and 20 deletions
40
README.md
40
README.md
|
@ -6,17 +6,17 @@
|
||||||
|
|
||||||
This action sets up a Python environment for use in actions by:
|
This action sets up a Python environment for use in actions by:
|
||||||
|
|
||||||
- optionally installing and adding to PATH a version of Python that is already installed in the tools cache
|
- optionally installing and adding to PATH a version of Python that is already installed in the tools cache.
|
||||||
- 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
|
- 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.
|
||||||
- failing if a specific version of Python is not preinstalled or available for download
|
- failing if a specific version of Python is not preinstalled or available for download.
|
||||||
- registering problem matchers for error output
|
- registering problem matchers for error output.
|
||||||
|
|
||||||
# What's new
|
# What's new
|
||||||
|
|
||||||
- Ability to download, install and set up Python packages from `actions/python-versions` that do not come preinstalled on runners
|
- Ability to download, install and set up Python packages from `actions/python-versions` that do not come preinstalled on runners.
|
||||||
- Allows for pinning to a specific patch version of Python without the worry of it ever being removed or changed
|
- Allows for pinning to a specific patch version of Python without the worry of it ever being removed or changed.
|
||||||
- Automatic setup and download of Python packages if using a self-hosted runner
|
- Automatic setup and download of Python packages if using a self-hosted runner.
|
||||||
- Support for pre-release versions of Python
|
- Support for pre-release versions of Python.
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
|
@ -122,14 +122,14 @@ Check out our detailed guide on using [Python with GitHub Actions](https://help.
|
||||||
|
|
||||||
`setup-python` is able to configure Python from two sources:
|
`setup-python` is able to configure Python from two sources:
|
||||||
|
|
||||||
- Preinstalled versions of Python in the tools cache on GitHub-hosted runners
|
- Preinstalled versions of Python in the tools cache on GitHub-hosted runners.
|
||||||
- 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).
|
- 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).
|
||||||
- For every minor version of Python, expect only the latest patch to be preinstalled.
|
- For every minor version of Python, expect only the latest patch to be preinstalled.
|
||||||
- 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.
|
- 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.
|
||||||
- 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.
|
- 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.
|
||||||
- Downloadable Python versions from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases))
|
- Downloadable Python versions from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases)).
|
||||||
- All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/main/versions-manifest.json) file.
|
- All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/main/versions-manifest.json) file.
|
||||||
- If there is a specific version of Python that is not available, you can open an issue here
|
- If there is a specific version of Python that is not available, you can open an issue here.
|
||||||
|
|
||||||
# Hosted Tool Cache
|
# Hosted Tool Cache
|
||||||
|
|
||||||
|
@ -174,22 +174,22 @@ If you are experiencing problems while configuring Python on your self-hosted ru
|
||||||
|
|
||||||
- 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.
|
- 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.
|
||||||
- Create an environment variable called `AGENT_TOOLSDIRECTORY` and set it to `/opt/hostedtoolcache`. This controls where the runner downloads and installs tools.
|
- Create an environment variable called `AGENT_TOOLSDIRECTORY` and set it to `/opt/hostedtoolcache`. This controls where the runner downloads and installs tools.
|
||||||
- In the same shell that your runner is using, type `export AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`
|
- In the same shell that your runner is using, type `export AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache`.
|
||||||
- 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.
|
- 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.
|
||||||
- Create a directory called `hostedtoolcache` inside `/opt`.
|
- Create a directory called `hostedtoolcache` inside `/opt`.
|
||||||
- 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.
|
- 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.
|
||||||
- The runner can be granted write access to the `/opt/hostedtoolcache` directory using a few techniques:
|
- The runner can be granted write access to the `/opt/hostedtoolcache` directory using a few techniques:
|
||||||
- The user starting the runner is the owner, and the owner has write permission
|
- The user starting the runner is the owner, and the owner has write permission.
|
||||||
- The user starting the runner is in the owning group, and the owning group has write permission
|
- The user starting the runner is in the owning group, and the owning group has write permission.
|
||||||
- All users have write permission
|
- All users have write permission.
|
||||||
- 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`
|
- 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`.
|
||||||
- `sudo chown runner-user:runner-group opt/hostedtoolcache/`
|
- `sudo chown runner-user:runner-group opt/hostedtoolcache/`.
|
||||||
- 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).
|
- 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).
|
||||||
|
|
||||||
### Mac
|
### Mac
|
||||||
|
|
||||||
- The same setup that applies to `Linux` also applies to `Mac`, just with a different tools cache directory.
|
- The same setup that applies to `Linux` also applies to `Mac`, just with a different tools cache directory.
|
||||||
- Create a directory called `/Users/runner/hostedtoolcache`
|
- Create a directory called `/Users/runner/hostedtoolcache`.
|
||||||
- Set the `AGENT_TOOLSDIRECTORY` environment variable to `/Users/runner/hostedtoolcache`.
|
- Set the `AGENT_TOOLSDIRECTORY` environment variable to `/Users/runner/hostedtoolcache`.
|
||||||
- Change the permissions of `/Users/runner/hostedtoolcache` so that the runner has write access.
|
- Change the permissions of `/Users/runner/hostedtoolcache` so that the runner has write access.
|
||||||
|
|
||||||
|
@ -200,8 +200,8 @@ If you are experiencing problems while configuring Python on your self-hosted ru
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
||||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
The scripts and documentation in this project are released under the [MIT License](LICENSE).
|
||||||
|
|
||||||
# Contributions
|
# Contributions
|
||||||
|
|
||||||
Contributions are welcome! See our [Contributor's Guide](docs/contributors.md)
|
Contributions are welcome! See our [Contributor's Guide](docs/contributors.md).
|
||||||
|
|
Loading…
Reference in a new issue