Open-Source Wikis

/

uv

/

How to contribute

/

Tooling

astral-sh/uv

Tooling

The supporting tools and CI infrastructure that keep uv buildable and testable across platforms.

Build tools

  • Cargo — the workspace is defined in the root Cargo.toml. The MSRV is 1.93.0 (rust-toolchain.toml). Runtime crates pin to edition 2024.
  • Custom profiles — see Development workflow for the full table. The most useful are dev, fast-build, profiling, and release.
  • cargo dev generate-all — regenerates auto-generated reference docs and JSON schemas used by IDEs.
  • cargo xwin — Windows cross-compilation from Linux/macOS. cargo-xwin is required when running clippy for x86_64-pc-windows-msvc from Unix.
  • scripts/cargo.sh / scripts/cargo.cmd — thin wrappers that invoke the workspace cargo with consistent flags.

Linters

The full list, all gated by .github/workflows/check-*.yml:

Tool What it checks
cargo fmt --all Rust formatting (rustfmt.toml)
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings Rust lints
cargo shear Unused Rust dependencies
uvx ruff format . / uvx ruff check . Python formatting/lints (in python/, scripts/, crates/uv-python/python/)
uvx ty check python/uv Python type checks
npx prettier --write . Markdown, YAML, JSON formatting (.prettierrc, .prettierignore)
shellcheck Shell scripts under scripts/
uvx typos Spell-check (_typos.toml)
cargo xwin clippy ... Windows compile check from Unix

.pre-commit-config.yaml wires most of these into pre-commit hooks. Every CI run also runs them via the check-* workflows.

A couple of lint-related tools used internally:

  • scripts/check-trampoline-version-consistency.py — keeps the uv-trampoline and uv-trampoline-builder versions in sync.
  • scripts/check_uv_wheel_contents.py — verifies that the wheel uv distributes contains exactly the expected files.
  • scripts/check_embedded_python.py — sanity check that managed Python builds embed the correct interpreter.

Code generation

  • cargo dev is a small in-tree dev tool (crates/uv-dev/) used to regenerate documentation and the JSON schema (uv.schema.json) for the configuration surface.
  • scripts/generate-crate-readmes.py — regenerates each crate's README.md from the workspace metadata. The headers warn <!-- This file is generated. DO NOT EDIT -->.
  • scripts/sync-python-version-constants.py — keeps the supported Python versions in sync between the source, fixtures, and CI.
  • scripts/sync_scenarios.sh — regenerates the resolver scenario tests under scripts/scenarios/.
  • scripts/update_schemastore.py — opens a PR against SchemaStore when the JSON schema changes.

CI verifies that all generated files are committed up-to-date via .github/workflows/check-generated-files.yml.

Benchmarking

  • scripts/benchmark/ is a Python package (managed by uv) that runs benchmark workloads against uv (and optionally against pip/poetry/pdm) using the hyperfine tool. Example:

    $ uv run resolver --uv-pip --poetry --benchmark resolve-cold ../test/requirements/trio.in

    See BENCHMARKS.md for the methodology and the published numbers.

  • tracing-durations-export — feature-flag in crates/uv/Cargo.toml that emits per-span durations for visualization.

  • scripts/popular_packages/pypi_10k_most_dependents.txt — a corpus of 10,000 popular PyPI packages used for resolver stress tests.

Release tooling

  • scripts/release.sh — orchestrates a release: bumps versions, generates a changelog entry, and opens a PR. Editing the changelog by hand is expected.
  • scripts/bump-workspace-crate-versions.py — bumps the workspace member versions in the right order (the user-facing uv crate has its own version line).
  • scripts/setup-crates-io-publish.py — builds the crates.io publish plan; the actual publish runs in CI (.github/workflows/publish-crates.yml).
  • scripts/check-release-artifact-sboms.sh — verifies CycloneDX SBOMs attached to release artifacts.
  • scripts/repair-sdist-cargo-lock.py — fixes up the Cargo.lock shipped in the source distribution after vendoring.
  • dist-workspace.toml — config for cargo-dist, which cross-builds and packages the binary releases.

CI workflows

.github/workflows/ contains 28 workflows. Key ones:

Workflow Trigger What it runs
ci.yml push, PR Top-level umbrella that calls the others.
check-fmt.yml push, PR cargo fmt.
check-lint.yml push, PR cargo clippy, cargo shear, plus Python and shell linters.
check-docs.yml push, PR Mkdocs build of docs/.
check-generated-files.yml push, PR Re-runs generators and asserts no diff.
check-publish.yml push, PR Dry-run of cargo publish.
check-release.yml push, PR Validates release scripts.
check-zizmor.yml push, PR Runs zizmor on the workflow files themselves.
test.yml push, PR Cross-platform unit + integration tests via nextest.
test-integration.yml scheduled, manual Long-running integration tests.
test-system.yml scheduled, manual Real-system Python tests.
test-smoke.yml release Fast end-to-end binary check on each platform.
test-windows-trampolines.yml push, PR Trampoline cross-builds and tests via Wine/QEMU.
test-ecosystem.yml scheduled Resolves and installs popular PyPI packages.
bench.yml manual Triggered to run benchmarks.
build-dev-binaries.yml push, PR Pre-built debug binaries for downstream consumption.
build-release-binaries.yml release Cargo-dist driven release builds.
build-docker.yml release Multi-arch Docker images.
release.yml manual The actual release dispatcher.
publish-crates.yml release Publishes workspace crates to crates.io.
publish-docs.yml release Pushes built docs to the astral-sh/docs repo.
publish-mirror.yml scheduled Mirrors managed-Python downloads to the Astral CDN.
publish-pypi.yml release Builds and uploads the uv PyPI wheel.
publish-versions.yml release Updates the version manifest used by uv self update.
sync-python-releases.yml scheduled Re-runs fetch-download-metadata.py for new Python builds.

Docker

  • Dockerfile builds a slim distroless image for uv.
  • crates/uv-dev/builder.dockerfile packages a sandbox in which to resolve untrusted dependency trees (sdists can run arbitrary code at build time).

IDE configuration

  • .editorconfig covers tab widths and line endings.
  • clippy.toml configures clippy's pedantic level and ignored lints.
  • rustfmt.toml enables imports grouping and other workspace-wide formatting.
  • ruff.toml configures ruff for the in-repo Python.
  • .prettierrc controls Prettier's formatting.

SchemaStore integration

uv.schema.json (~119 KB) at the repo root is the JSON schema for uv.toml and the [tool.uv] table in pyproject.toml. SchemaStore-aware editors (VS Code, neovim) get autocompletion and validation for uv config out of the box. The schema is regenerated by cargo dev generate-json-schema and updated upstream by scripts/update_schemastore.py.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Tooling – uv wiki | Factory