mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-10-02 00:35:59 +00:00
Add a Python architecture input
This commit is contained in:
23
README.md
23
README.md
@@ -15,6 +15,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
|
||||
- [Inputs](#inputs)
|
||||
- [Outputs](#outputs)
|
||||
- [Python version](#python-version)
|
||||
- [Python architecture](#python-architecture)
|
||||
- [Working directory](#working-directory)
|
||||
- [Advanced Configuration](#advanced-configuration)
|
||||
- [How it works](#how-it-works)
|
||||
@@ -56,6 +57,9 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
|
||||
# The version of Python to set UV_PYTHON to (overrides the Python version from .tool-versions)
|
||||
python-version: ""
|
||||
|
||||
# The Python architecture to set UV_PYTHON_ARCH to, e.g., x86_64 or aarch64
|
||||
python-arch: ""
|
||||
|
||||
# Use uv venv to activate a venv ready to be used by later steps
|
||||
activate-environment: "false"
|
||||
|
||||
@@ -193,6 +197,25 @@ jobs:
|
||||
run: uv run --frozen pytest
|
||||
```
|
||||
|
||||
### Python architecture
|
||||
|
||||
Use `python-arch` to set `UV_PYTHON_ARCH` for the rest of the job. This selects the Python
|
||||
architecture independently of the version, including versions requested by `.python-version`.
|
||||
An explicit architecture or interpreter path in a Python request takes precedence.
|
||||
|
||||
```yaml
|
||||
- uses: astral-sh/setup-uv@main
|
||||
with:
|
||||
python-version: "3.14"
|
||||
python-arch: x86_64
|
||||
- run: uv run --frozen pytest
|
||||
```
|
||||
|
||||
The input overrides an existing `UV_PYTHON_ARCH` value. When it is omitted, the action respects
|
||||
`UV_PYTHON_ARCH` from the environment. Both forms require a uv version that supports the variable;
|
||||
the action reports an error if the installed version does not support it. The selected architecture
|
||||
is included in the [cache key](docs/caching.md#cache-key).
|
||||
|
||||
### Working directory
|
||||
|
||||
You can set the working directory with the `working-directory` input.
|
||||
|
||||
Reference in New Issue
Block a user