Why does uv Use Hatch as a backend?
uv doesn’t implement its own build backend for creating Python packages. Instead, it uses existing backends when packaging projects.
When running uv init
with the --package
flag, uv sets up Hatchling (hatch’s build backend) as the default backend in the generated pyproject.toml
:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
This is purely a configuration choice – uv needs to select some backend for packaged projects, and Hatchling provides a modern, standards-compliant option with minimal dependencies. For most projects, the specific backend won’t meaningfully impact development.
While Hatchling is the default, uv works with any PEP 517-compatible build backend. When creating a project, you can specify alternatives, e.g.,
$ uv init --build-backend flit_core.buildapi myproject
$ uv init --build-backend setuptools.build_meta myproject
$ uv init --build-backend maturin myproject
When you run uv build
, it simply invokes the configured backend to build the package rather than implementing build functionality itself.