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.
pip install uv-buildVerified import paths — ran on the pinned version, not inferred.
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.
Ensure your environment's certificate stores are up-to-date, or investigate specific certificate issues if network requests begin failing.
For projects with non-pure Python components, configure your `pyproject.toml` to use a different build backend (e.g., `hatchling.build_api` or `setuptools.build_meta`).
Always use `uv build --no-sources` before publishing your package to a public index to verify build integrity without local source overrides.
Treat `uv.lock` as a machine-generated file. Use `uv` CLI commands (`uv add`, `uv remove`, `uv lock --upgrade-package`) to manage dependencies, which will automatically update the lockfile.
Ensure that any shell commands are executed in a shell environment (e.g., using `subprocess` module in Python, or by running directly in a terminal), and that `.py` files contain valid Python syntax.
Ensure Python scripts only contain valid Python syntax. For executing shell commands, use Python's `subprocess` module (e.g., `subprocess.run(['mkdir', 'my_python_project'])`) or `os.system`.