Add a "choosing a build backend" section to the docs (#14295)

I think the build backend docs as a whole are now ready for review. I
only made a small change here.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
konsti 2025-07-02 16:02:03 +02:00 committed by GitHub
parent b0db548c80
commit a7aa46acc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,13 +12,26 @@ uv supports all build backends (as specified by [PEP 517](https://peps.python.or
also provides a native build backend (`uv_build`) that integrates tightly with uv to improve also provides a native build backend (`uv_build`) that integrates tightly with uv to improve
performance and user experience. performance and user experience.
## Choosing a build backend
The uv build backend is a good choice for most Python projects that are using uv. It has reasonable
defaults, with the goal of requiring zero configuration for most users, but provides flexible
configuration that allows most Python project structures. It integrates tightly with uv, to improve
messaging and user experience. It validates project metadata and structures, preventing common
mistakes. And, finally, it's very fast.
The uv build backend currently **only supports pure Python code**. An alternative backend is
required to build a
[library with extension modules](../concepts/projects/init.md#projects-with-extension-modules).
!!! tip
While the backend supports a number of options for configuring your project structure, when build scripts or
a more flexible project layout are required, consider using the
[hatchling](https://hatch.pypa.io/latest/config/build/#build-system) build backend instead.
## Using the uv build backend ## Using the uv build backend
!!! important
The uv build backend currently **only supports pure Python code**. An alternative backend is to
build a [library with extension modules](../concepts/projects/init.md#projects-with-extension-modules).
To use uv as a build backend in an existing project, add `uv_build` to the To use uv as a build backend in an existing project, add `uv_build` to the
[`[build-system]`](../concepts/projects/config.md#build-systems) section in your `pyproject.toml`: [`[build-system]`](../concepts/projects/config.md#build-systems) section in your `pyproject.toml`: