# uv

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> The uv package installer and a Python for it, which Ringleader uses to install pypi packages.


Installs [uv](https://docs.astral.sh/uv/), Astral's Python package installer, and one
Python for it to build tools on. Ringleader uses uv to install every `pypi`
package (see [package installation](https://docs-stg.ringleader.dev/workstations/packages-tools-settings/package-installation/)), and you
can run `uv` yourself.

```yaml
devtools:
  - name: uv
```

You do not have to declare this devtool to install `pypi` packages. When a config declares
one and the workstation has no `uv`, Ringleader adds this devtool with its defaults. If
that is all you need, you are done. Declare `uv` yourself to choose the uv release or the
Python.

## Version behavior

| `version` | Result |
|-----------|--------|
| omitted | the uv release that Ringleader tests, checked against uv's published checksum |
| a uv release such as `0.13.5` | that release, downloaded for the workstation's architecture without a checksum check |

On Debian and Ubuntu the download is uv's glibc build, and on Alpine it is the musl
build. Unlike most devtools, `uv` compares the installed release with `version` on every
setup run, so changing `version` replaces the uv a workstation already has.

## Updates

With `updatePolicy: latest` and no `version`, uv takes the
[Ringleader default route](https://docs-stg.ringleader.dev/reference/tools/devtools/#update-routes). It moves when an update to
Ringleader raises the default release.
This moves the `uv` command. When it moves, the workstation reinstalls your `pypi`
packages at the versions they already have, as [Update routes](https://docs-stg.ringleader.dev/reference/tools/devtools/#update-routes) describes.

## Python selection

`config.python` names the Python that `pypi` packages build on. It is a minor version
written as a string, and it defaults to `"3.14"`:

```yaml
devtools:
  - name: uv
    config:
      python: "3.13"
```

The value must be `3.` and a number, such as `"3.13"`. A patch release (`"3.13.2"`), a
range or a name is refused when you apply the config.

The Python installs into `/opt/ringleader/packages/pypi/python/`, shared by every
`pypi` package. It exists for the tools Ringleader installs and adds no `python3`
command to your PATH. For a Python of your own, see [`python`](https://docs-stg.ringleader.dev/reference/tools/devtools/python/).

Changing `config.python` installs the new Python and rebuilds every `pypi` package on it
at the version it has now. Ringleader removes a Python once no package uses it.

## Example

A config that installs a linter and a formatter from PyPI on Python 3.13:

```yaml
apiVersion: workstations.ringleader.dev/v1
kind: WorkstationConfig
metadata:
  name: python-tools
  namespace: dev
spec:
  selector:
    matchLabels:
      tier: dev
  devtools:
    - name: uv
      config:
        python: "3.13"
  packages:
    - type: pypi
      name: ruff
      version: ">=0.6,<0.7"
    - type: pypi
      name: black
```

## Notes

- Under a strict egress policy, uv needs `github.com` for its own download and for
  Pythons, plus `pypi.org` and `files.pythonhosted.org` for packages. GitHub serves
  release downloads from `*.githubusercontent.com`.
- The workstation is considered to have this devtool once `uv` resolves on PATH.
- Works on Debian, Ubuntu and Alpine.

