A simple, correct Python build frontend https://build.pypa.io
Find a file
pre-commit-ci[bot] 13b0d28b44
pre-commit: bump repositories (#1317)
<!--pre-commit.ci start-->
updates:
- [github.com/adamchainz/blacken-docs:
dda8db18cfc68df532abf33b185ecd12d5b7b326 →
747ea8f09d32450954f378aa0ab083216822c379](dda8db18cf...747ea8f09d)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-11-30 16:29:29 -05:00
.github docs: try to adjust the contribution template again (#1301) 2026-11-19 12:58:10 -08:00
docs Fix PYTHONPATH interfering with outer pip installs (#1306) 2026-11-23 08:17:59 -08:00
src/build Fix PYTHONPATH interfering with outer pip installs (#1306) 2026-11-23 08:17:59 -08:00
tasks ci: support releases from v* branches (#1178) 2026-09-05 16:28:09 -04:00
tests Fix PYTHONPATH interfering with outer pip installs (#1306) 2026-11-23 08:17:59 -08:00
.dockerignore Debian has no ensurepip module available on Python 2 - always use virtualenv on Python 2 2020-10-15 19:24:26 +01:00
.gitignore chore: add lockfiles to gitignore (#1101) 2026-06-13 10:16:50 -04:00
.pre-commit-config.yaml pre-commit: bump repositories (#1317) 2026-11-30 16:29:29 -05:00
.readthedocs.yml feat(python): require 3.11 and default to 3.15 (#1215) 2026-10-10 22:22:19 +00:00
CHANGELOG.rst docs: changelog from 1.6.1 for main (#1185) 2026-09-11 11:38:45 +02:00
codecov.yml [pre-commit.ci] auto fixes from pre-commit.com hooks 2025-05-27 09:41:08 -05:00
LICENSE initial release 2020-05-11 01:06:13 +01:00
pyproject.toml chore: clean up an extra bit of leftover cruft (#1292) 2026-11-18 10:45:25 -05:00
README.md docs: add AI policy (#1230) 2026-11-09 22:30:16 +00:00
tox.toml feat(python): require 3.11 and default to 3.15 (#1215) 2026-10-10 22:22:19 +00:00

build

pre-commit.ci status CI test codecov

Documentation Status PyPI version Discord

A simple, correct Python build frontend.

See the documentation for more information.

Installation

build can be installed via pip or an equivalent via:

$ pip install build

Usage

Command-line interface

$ python -m build

This will build the package in an isolated environment, generating a source-distribution and wheel in the directory dist/. See the documentation for full information. Build is also available via the command line as pyproject-build once installed.

Common arguments

  • --sdist (-s): Produce just an SDist
  • --wheel (-w): Produce just a wheel
  • --metadata: Produce just the metadata as JSON. Cannot be used with --sdist/--wheel.
  • -C<option>=<value>: A Config-setting, the PEP 517 way of passing options to a backend. Can be passed multiple times. Matching options will make a list. Note that setuptools has very limited support.
  • --config-json=<value>: An alternative way to pass in complex config settings as JSON strings. Can't be used with -C.
  • --installer: Pick an installer for the isolated build (pip or uv).
  • --no-isolation (-n): Disable build isolation.
  • --skip-dependency-check (-x): Disable dependency checking when not isolated; this should be done if some requirements or version ranges are not required for non-isolated builds.
  • --outdir (-o): The output directory (defaults to dist)

Some common combinations of arguments:

  • --sdist --wheel (-sw): Produce an SDist and a wheel, both from the source directory. The default (if no flag is passed) is to build an SDist and then build a wheel from the SDist.
  • -nx: Disable build isolation and dependency checking. Identical to pip and uv's --no-build-isolation flag.
  • --metadata | jq -r .version: get the version in a bash-like environment.

Integration with other tools

pipx

If you use pipx, such as in GitHub Actions, the following command will download and run build in one step:

$ pipx run build

uv

If you want to use uv to speed up the virtual environment creation, you can use --installer=uv. You can get a Python wheel for uv with the [uv] extra. For example, using pipx like above:

$ pipx run 'build[uv]' --installer uv

If you already have uv, you don't need the extra. For example:

$ uvx --from build pyproject-build --installer uv

cibuildwheel

If you are using cibuildwheel, build is integrated and the default builder in 3.0+. If you want to use uv as the installer, you can use:

[tool.cibuildwheel]
build-frontend = "build[uv]"

(Be sure to pre-install uv before running cibuildwheel for this one!)

Conda-forge

On conda-forge, this package is called python-build.

Contributing to build

Contribution guidelines can be found in the documentation. Please pay special attention to our AI policy.

Code of Conduct

Everyone interacting with build's codebase, issue trackers, chat rooms, and mailing lists is expected to follow the PSF Code of Conduct.