mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-03-13 01:26:47 +00:00
82 lines
2.7 KiB
Markdown
82 lines
2.7 KiB
Markdown
# Customization
|
|
|
|
This document covers advanced customization options including checksum validation, custom manifests, and problem matchers.
|
|
|
|
## Validate checksum
|
|
|
|
You can specify a checksum to validate the downloaded executable. Checksums up to the default version
|
|
are automatically verified by this action. The sha256 hashes can be found on the
|
|
[releases page](https://github.com/astral-sh/uv/releases) of the uv repo.
|
|
|
|
```yaml
|
|
- name: Install a specific version and validate the checksum
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
version: "0.3.1"
|
|
checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"
|
|
```
|
|
|
|
## Manifest file
|
|
|
|
By default, setup-uv reads version metadata from
|
|
[`astral-sh/versions`](https://github.com/astral-sh/versions) (NDJSON format).
|
|
|
|
The `manifest-file` input lets you override that source with your own URL, for example to test
|
|
custom uv builds or alternate download locations.
|
|
|
|
### Format
|
|
|
|
The manifest file must be in NDJSON format, where each line is a JSON object representing a version and its artifacts. For example:
|
|
|
|
```json
|
|
{"version":"0.10.7","artifacts":[{"platform":"x86_64-unknown-linux-gnu","variant":"default","url":"https://example.com/uv-x86_64-unknown-linux-gnu.tar.gz","archive_format":"tar.gz","sha256":"..."}]}
|
|
{"version":"0.10.6","artifacts":[{"platform":"x86_64-unknown-linux-gnu","variant":"default","url":"https://example.com/uv-x86_64-unknown-linux-gnu.tar.gz","archive_format":"tar.gz","sha256":"..."}]}
|
|
```
|
|
|
|
setup-uv currently only supports `default` as the `variant`.
|
|
|
|
The `archive_format` field is currently ignored.
|
|
|
|
### Legacy format: JSON array (deprecated)
|
|
|
|
The previous JSON array format is still supported for compatibility, but deprecated and will be
|
|
removed in a future major release.
|
|
|
|
```json
|
|
[
|
|
{
|
|
"version": "0.7.13",
|
|
"artifactName": "uv-aarch64-apple-darwin.tar.gz",
|
|
"arch": "aarch64",
|
|
"platform": "apple-darwin",
|
|
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.7.13/uv-aarch64-apple-darwin.tar.gz"
|
|
}
|
|
]
|
|
```
|
|
|
|
```yaml
|
|
- name: Use a custom manifest file
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
manifest-file: "https://example.com/my-custom-manifest.ndjson"
|
|
```
|
|
|
|
> [!NOTE]
|
|
> When you use a custom manifest file and do not set the `version` input, setup-uv installs the
|
|
> latest version from that custom manifest.
|
|
|
|
## Add problem matchers
|
|
|
|
This action automatically adds
|
|
[problem matchers](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md)
|
|
for python errors.
|
|
|
|
You can disable this by setting the `add-problem-matchers` input to `false`.
|
|
|
|
```yaml
|
|
- name: Install the latest version of uv without problem matchers
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
add-problem-matchers: false
|
|
```
|