Add input version-file (#486)

Closes: #411
This commit is contained in:
Kevin Stillhammer
2025-07-17 20:22:18 +02:00
committed by GitHub
parent c893ac1cb2
commit b75ff7d7b8
13 changed files with 369 additions and 136 deletions

View File

@ -15,6 +15,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
- [Install the latest version](#install-the-latest-version)
- [Install a specific version](#install-a-specific-version)
- [Install a version by supplying a semver range or pep440 specifier](#install-a-version-by-supplying-a-semver-range-or-pep440-specifier)
- [Install a version defined in a requirements or config file](#install-a-version-defined-in-a-requirements-or-config-file)
- [Python version](#python-version)
- [Activate environment](#activate-environment)
- [Working directory](#working-directory)
@ -92,6 +93,19 @@ to install the latest version that satisfies the range.
version: ">=0.4.25,<0.5"
```
### Install a version defined in a requirements or config file
You can use the `version-file` input to specify a file that contains the version of uv to install.
This can either be a `pyproject.toml` or `uv.toml` file which defines a `required-version` or
uv defined as a dependency in `pyproject.toml` or `requirements.txt`.
```yaml
- name: Install uv based on the version defined in pyproject.toml
uses: astral-sh/setup-uv@v6
with:
version-file: "pyproject.toml"
```
### Python version
You can use the input `python-version` to set the environment variable `UV_PYTHON` for the rest of your workflow