# The uv build backend is now stable

For about a year, [uv](https://pydevtools.com/handbook/reference/uv.md) has had a `uv build` command for generating distributable [wheels](https://pydevtools.com/handbook/reference/wheel.md) and [source distributions](https://pydevtools.com/handbook/reference/sdist.md) on [pypi](https://pydevtools.com/handbook/explanation/what-is-pypi.md) and elsewhere.

However, uv has relied on other tools for the [build backend](https://pydevtools.com/handbook/explanation/what-is-a-build-backend.md), i.e. the actual piece constructing the wheel or sdist as defined by [PEP 517](https://pydevtools.com/handbook/explanation/what-is-pep-517.md). When this post was published, `uv init` declared [hatchling](https://pydevtools.com/handbook/reference/hatch.md) for packaged projects. It now declares `uv_build`.

As of this week, the uv team has now declared the uv build backend as stable and, most notably, really, really fast. [Charlie Marsh's benchmarks](https://x.com/charliermarsh/status/1940583972607873226) suggest that it's 10 to 35 times faster than [flit](https://pydevtools.com/handbook/reference/flit.md), [hatchling](https://pydevtools.com/handbook/reference/hatch.md), and [setuptools](https://pydevtools.com/handbook/reference/setuptools.md). While I've never really needed my package builds to be faster, I've learned that [faster tools often enable new things I didn't imagine possible](https://x.com/tdhopper/status/1850885052894196149); I'm interested to see what those might be here.

Because uv is written entirely in Rust, [Charlie notes](https://x.com/charliermarsh/status/1940584472468246545) that "One underrated implication here: we can now build and publish your package without running or even installing Python." While this won't impact most developers day-to-day, it will likely make it easier to build and publish packages in CI.

> [!NOTE]
> Charlie's point describes the backend, not the `uv build` command, which resolves a Python interpreter before any backend runs and does so for Hatchling and uv_build alike. On a developer machine this costs nothing: finding no Python on `PATH`, uv downloads a managed CPython and the build succeeds. It only fails where all three of no interpreter on `PATH`, no managed CPython already installed, and no downloads (`UV_PYTHON_DOWNLOADS=never`, or no network) hold at once, and then it stops at `No interpreter found for Python >=3.9 in virtual environments, managed installations, or search path`. Slim and air-gapped CI images still need a reachable interpreter. [What is the uv build backend?](https://pydevtools.com/handbook/explanation/what-is-the-uv-build-backend.md) covers the rest of the backend's limits.

To enable the uv build backend, you can add the following to your `pyproject.toml`:

```
[build-system]
requires = ["uv_build>=0.7.19,<0.8.0"]
build-backend = "uv_build"
```

> [!TIP]
> The version constraint above was correct at publication. Always check the [official docs](https://docs.astral.sh/uv/concepts/build-backend/#choosing-a-build-backend) for the latest recommended constraint.

[Read more in the uv documentation](https://docs.astral.sh/uv/concepts/build-backend/#choosing-a-build-backend).

For the configuration keys, module naming rules, and backend selection details, see the [uv_build Reference](https://pydevtools.com/handbook/reference/uv-build.md).
