Registry / devops / uv-build

uv-build

JSON →
library0.12.6pypypi✓ verified 27d ago

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-build
INSTALL
IMPORT
SIG · UV-BUILD
U
uv-build
devopspythonv0.12.6
Install
1.8s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.12.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

uv-build as a backend
uv-build is a PEP 517 build backend and is not typically imported directly in user-facing Python code. It is invoked implicitly by build frontends like the `uv build` command or other packaging tools configured in `pyproject.toml`.
uv-build functions as a backend, not a library meant for direct programmatic imports by end-users. Its interaction is through the PEP 517 build system interface.

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/
uv --version
Debug
Known issues
breakingVersion 0.11.0 included significant changes to uv's networking stack (driven by a `reqwest` upgrade to v0.13), which may rarely result in previously trusted SSL/TLS certificates being rejected. Exercise caution when upgrading in environments sensitive to network configurations.
fix
Ensure your environment's certificate stores are up-to-date, or investigate specific certificate issues if network requests begin failing.
affects: >=0.11.0
gotchaThe `uv-build` backend currently only supports pure Python code. If your project includes extension modules (e.g., written in C, C++, Rust), or requires a more flexible project layout with custom build scripts, you will need to use an alternative build backend like `hatchling` or `setuptools`.
fix
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`).
affects: All
gotchaWhen publishing packages, it is recommended to run `uv build --no-sources`. This ensures that the package builds correctly even when `tool.uv.sources` (custom dependency sources for development) are disabled, as is common with other build tools or in CI/CD environments.
fix
Always use `uv build --no-sources` before publishing your package to a public index to verify build integrity without local source overrides.
affects: All
gotchaThe `uv.lock` file, which pins exact dependency versions for reproducibility, should always be committed to version control and should *not* be manually edited. uv automatically manages this file.
fix
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.
affects: All
gotchaAttempting to execute shell commands directly as Python code will result in a `SyntaxError`.
fix
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.
affects: All
gotchaThe test script encountered a Python `SyntaxError` by attempting to run a shell command (`mkdir`) directly as Python code, preventing the proper execution of `uv` commands.
fix
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`.
affects: All
Upgrade
Version history
0.12.6latest on PyPI · released Aug 25, 2026
Audit
Dependencies
uvrequireduv-build is the build backend *for* uv. While not a direct runtime dependency in the traditional Python import sense, uv is the primary tool that orchestrates and uses uv-build for project building operations. uv-build's versioning policy follows uv's.
Agent activity
20 hits · last 30 days
node
18
Resources