uv-build: The uv build backend

0.11.2 · active · verified Sun Mar 29

uv-build is the official PEP 517 build backend for uv, the fast Python package and project manager. It enables uv to efficiently create source distributions and binary wheels for Python projects. The package is a slimmed-down version of uv itself, containing only the necessary components for the build backend functionality. It is under active development with frequent releases, often multiple times a week, ensuring tight integration and performance with the main uv tool.

Warnings

Install

Imports

Quickstart

To use `uv-build`, you typically configure it in your `pyproject.toml` file under the `[build-system]` section. This tells build tools like `uv` how to build your project. After configuration, you use the `uv build` command to create your package distributions. The example demonstrates setting up a basic project and explicitly configuring `uv-build` as the backend.

mkdir my_python_project
cd my_python_project

# Initialize a uv project (this creates pyproject.toml)
uv init

# Edit pyproject.toml to specify uv-build as the build backend
# This content should be placed in pyproject.toml
# --- pyproject.toml ---
# [project]
# name = "my-package"
# version = "0.1.0"
# dependencies = []
#
# [build-system]
# requires = ["uv-build>=0.11.2"]
# build-backend = "uv_build"
# ---

# Build your package (creates sdist and wheel in ./dist)
uv build

# Optionally, publish to a registry (e.g., TestPyPI)
# uv publish --token $UV_PUBLISH_TOKEN --publish-url https://test.pypi.org/legacy/

view raw JSON →