mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-30 23:37:24 +00:00
Add python-version-file
to GitHub integration documentation (#6086)
This commit is contained in:
parent
d6c858b0d3
commit
d971d6b1da
1 changed files with 18 additions and 3 deletions
|
@ -109,15 +109,30 @@ steps:
|
|||
run: uv python install ${{ matrix.python-version }}
|
||||
```
|
||||
|
||||
Alternatively, the official GitHub `setup-python` action can be used. This is generally faster, but
|
||||
will not respect the project's pinned Python version.
|
||||
Alternatively, the official GitHub `setup-python` action can be used. This can be faster, because
|
||||
GitHub caches the Python versions alongside the runner.
|
||||
|
||||
Set the
|
||||
[`python-version-file`](https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-the-python-version-file-input)
|
||||
option to use the pinned version for the project:
|
||||
|
||||
```yaml title="example.yml"
|
||||
steps:
|
||||
- name: "Set up Python"
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.12
|
||||
python-version-file: ".python-version"
|
||||
```
|
||||
|
||||
Or, specify the `pyproject.toml` file to ignore the pin and use the latest version compatible with
|
||||
the project's `requires-python` constraint:
|
||||
|
||||
```yaml title="example.yml"
|
||||
steps:
|
||||
- name: "Set up Python"
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version-file: "pyproject.toml"
|
||||
```
|
||||
|
||||
## Syncing and running
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue