Skip to main content

A simple, correct Python build frontend

Project description

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.

Common arguments

  • --sdist (-s): Produce just an SDist
  • --wheel (-w): Produce just a 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.
  • --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 and SDist and a wheel, both from the source distribution. 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.

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. Combining both suggestions yields the following:

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

cibuildwheel

If you are using cibuildwheel, build is integrated and can be use with either (in your pyproject.toml):

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

or

[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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

build-1.2.2.post1.tar.gz (46.7 kB view details)

Uploaded Source

Built Distribution

build-1.2.2.post1-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file build-1.2.2.post1.tar.gz.

File metadata

  • Download URL: build-1.2.2.post1.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for build-1.2.2.post1.tar.gz
Algorithm Hash digest
SHA256 b36993e92ca9375a219c99e606a122ff365a760a2d4bba0caa09bd5278b608b7
MD5 5492ba887b363f483d64a11bbec0c34a
BLAKE2b-256 7d46aeab111f8e06793e4f0e421fcad593d547fb8313b50990f31681ee2fb1ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for build-1.2.2.post1.tar.gz:

Publisher: cd.yml on pypa/build

Attestations:

File details

Details for the file build-1.2.2.post1-py3-none-any.whl.

File metadata

  • Download URL: build-1.2.2.post1-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for build-1.2.2.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d61c0887fa860c01971625baae8bdd338e517b836a2f70dd1f7aa3a6b2fc5b5
MD5 5cd086437c1771883c365758c089c820
BLAKE2b-256 84c280633736cd183ee4a62107413def345f7e6e3c01563dbca1417363cf957e

See more details on using hashes here.

Provenance

The following attestation bundles were made for build-1.2.2.post1-py3-none-any.whl:

Publisher: cd.yml on pypa/build

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page