build
build is a Python packaging and build frontend. It reads project settings from pyproject.toml, invokes a PEP 517 compliant build backend, and creates wheel files and source distributions.
Installation and Setup
Install build from Python Package Index (PyPI):
$ python -m pip install build
The build documentation recommends installing it as a standalone tool with uv tool install build, though pip and pipx also work.
Key Features
- Acts as a PEP 517 build frontend, working with any compliant backend.
- Builds in isolated environments by default and installs only declared build requirements.
- Installs build requirements with
pipby default and can switch to a faster installer with--installer=uv. - Provides a minimal, backend-agnostic interface centered on
python -m buildand thepyproject-buildscript. - Accepts a
.tar.gzsource distribution as its positional argument, building a wheel directly from an existing sdist. Available since build 1.6.0. - Generates both an sdist and a wheel by default, building the wheel from the extracted sdist so that the sdist is verified as complete, and writes both to
dist/. - Supports passing backend configuration with
-C/--config-settingor--config-jsonto customize builds without backend-specific commands.
Usage
Set the build backend:
pyproject.toml
[build-system]
requires = ["setuptools >= 77.0.3"]
build-backend = "setuptools.build_meta"
# ...
Build an sdist and then a wheel from that sdist (the default):
$ python -m build
Build only a wheel:
$ python -m build --wheel
Build only a source distribution:
$ python -m build --sdist
Related Resources
Tutorial
How to Publish an Open-Source Python Package to PyPI
In this step-by-step tutorial, you’ll learn how to create a Python package for your project and how to publish it to PyPI, the Python Package Repository. Quickly get up to speed on everything from naming your package to configuring it using setup.cfg.
For additional information on related topics, take a look at the following resources:
By Leodanis Pozo Ramos • Updated Sept. 6, 2026