The Principal Dev – Masterclass for Tech Leads

The Principal Dev – Masterclass for Tech LeadsJuly 17-18

Join

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

$ 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

Some common combinations of arguments:

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.

Code of Conduct

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

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.