researchcloud-items

Installation scripts for SURF ResearchCloud catalog components

View the Project on GitHub UtrechtUniversity/researchcloud-items

Role uv

back to index

Summary

uv is an extremely fast Python version, package and project manager, written in Rust. This role:

  1. Installs uv (if it is not already present).
  2. Installs desired versions of python with uv.
  3. Creates virtual envs with specified python versions.

Note that the SRC-External component, which is executed on most if not all workspaces, already installs uv (as of February 2025). Actual installation of uv is therefore skipped by this role to save time, unless a special variable is toggled (see below).

Requires

Description

This role will install uv using pipx, to the default location defined by the pipx role. A link to the uv binary installed by pipx is placed in /usr/local/bin/, so uv is on the PATH for each user.

Aditionally, a script /usr/local/bin/uv_pip is installed, which is essentially an alias for uv pip. This is for convenience of use in Ansible playbook: it e.g. allows passing uv_pip as the executable for a call to Ansible’s pip module.

The role also supports creating venvs and installing desired Python versions (see below).

The role will set a fact uv_python_paths, which contains a dict containing the location of the python interpreter for each requested versions. For example:

uv_python_paths: {
    '3.11': '/root/.local/share/uv/cpython-xxxxx/bin/python3'
}

Variables

See also

History

2024-2025 Written by Dawa Ometto (Utrecht University)

back to index