Skip to content

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):

Language: Shell
$ 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 pip by default and can switch to a faster installer with --installer=uv.
  • Provides a minimal, backend-agnostic interface centered on python -m build and the pyproject-build script.
  • Accepts a .tar.gz source 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-setting or --config-json to customize builds without backend-specific commands.

Usage

Set the build backend:

Language: TOML Filename: 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):

Language: Shell
$ python -m build

Build only a wheel:

Language: Shell
$ python -m build --wheel

Build only a source distribution:

Language: Shell
$ python -m build --sdist
How to Publish an Open-Source Python Package to PyPI

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.

intermediate best-practices tools

For additional information on related topics, take a look at the following resources:


By Leodanis Pozo Ramos • Updated Sept. 6, 2026