mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-09-02 21:59:22 +00:00
Read Python version from .tool-versions (#996)
## Summary - read the Python version from an explicitly selected `.tool-versions` file - preserve `python-version` and existing `UV_PYTHON` precedence - add parser, input, and workflow coverage and update documentation and bundled action artifacts ## Validation - `npm run all` - `actionlint .github/workflows/test.yml` - `uvx zizmor .github/workflows/test.yml` Closes #983 Refs: pi-session 019ff01a-544c-79f3-8f73-a00132af39f5
This commit is contained in:
@@ -85,7 +85,10 @@ You can use the `version-file` input to specify a file that contains the version
|
||||
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`.
|
||||
|
||||
[asdf](https://asdf-vm.com/) `.tool-versions` is also supported, but without the `ref` syntax.
|
||||
[asdf](https://asdf-vm.com/) `.tool-versions` is also supported for selecting uv. If neither
|
||||
`python-version` nor `UV_PYTHON` is set, the `python` entry from the selected file is also exported
|
||||
as `UV_PYTHON`. Only a single Python version is supported; multiple fallback versions and the asdf
|
||||
`ref:`, `path:`, and `system` forms are ignored with a warning.
|
||||
|
||||
```yaml
|
||||
- name: Install uv based on the version defined in pyproject.toml
|
||||
|
||||
Reference in New Issue
Block a user