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 is1.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, andrelease. cargo dev generate-all— regenerates auto-generated reference docs and JSON schemas used by IDEs.cargo xwin— Windows cross-compilation from Linux/macOS.cargo-xwinis required when running clippy forx86_64-pc-windows-msvcfrom 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 theuv-trampolineanduv-trampoline-builderversions 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 devis 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'sREADME.mdfrom 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 underscripts/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 thehyperfinetool. Example:$ uv run resolver --uv-pip --poetry --benchmark resolve-cold ../test/requirements/trio.inSee
BENCHMARKS.mdfor the methodology and the published numbers.tracing-durations-export— feature-flag incrates/uv/Cargo.tomlthat 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-facinguvcrate 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 theCargo.lockshipped in the source distribution after vendoring.dist-workspace.toml— config forcargo-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
Dockerfilebuilds a slim distroless image foruv.crates/uv-dev/builder.dockerfilepackages a sandbox in which to resolve untrusted dependency trees (sdists can run arbitrary code at build time).
IDE configuration
.editorconfigcovers tab widths and line endings.clippy.tomlconfigures clippy's pedantic level and ignored lints.rustfmt.tomlenables imports grouping and other workspace-wide formatting.ruff.tomlconfigures ruff for the in-repo Python..prettierrccontrols 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.