UV & Ruff
Status
Section titled “Status”Version: 1.0.0 | Tests: Passing
{
"features": {
"ghcr.io/infrashift/trusted-devcontainer-features/uv-ruff:latest": {
"target_uv_version": "0.10.3",
"target_ruff_version": "0.15.1"
}
}
} Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
target_uv_version | string | 0.10.3 | Select a supported UV version |
target_uv_checksum | string | "" | SHA256 checksum for the UV binary |
target_ruff_version | string | 0.15.1 | Select a supported Ruff version |
Dependencies
Section titled “Dependencies”None — this feature is independent and has no dependencies.
How It Works
Section titled “How It Works”This feature installs two tools from Astral: UV, a fast Python package manager and project tool, and Ruff, a fast Python linter and formatter. The Ansible playbook first downloads the UV tarball from the official GitHub releases for the specified version, optionally verifies the SHA256 checksum if one is provided via the target_uv_checksum option, and extracts it to ~/.local/bin.
Once UV is installed, the playbook uses it to install Ruff via uv tool install ruff@<version>. This approach leverages UV’s tool management capability to install Ruff in an isolated environment while making the ruff binary available on PATH. The VS Code Ruff extension is recommended for integrated linting and formatting feedback in the editor.
UV serves double duty in this feature collection. It is both an end-user tool for managing Python packages and projects, and the mechanism used by other features to bootstrap their installations. The Python feature uses uv python install to set up managed Python versions, and the ansible-core feature uses uv run to create isolated virtual environments. Because of this foundational role, uv-ruff has no dependencies of its own and sits at the base of the dependency chain for all Python-related features.
Both UV and Ruff are written in Rust and are known for their exceptional speed compared to traditional Python tooling. UV is a drop-in replacement for pip, pip-tools, and virtualenv, while Ruff replaces Flake8, isort, pyupgrade, and dozens of other Python linters with a single tool that runs orders of magnitude faster.