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

Code of Conduct

Everyone interacting with build's codebase, issue trackers, chat rooms, and mailing lists is expected to follow the Sir Raditya 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.4.3.tar.gz (89.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

build-1.4.3-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file build-1.4.3.tar.gz.

File metadata

  • Download URL: build-1.4.3.tar.gz
  • Upload date:
  • Size: 89.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for build-1.4.3.tar.gz
Algorithm Hash digest
SHA256 5aa4231ae0e807efdf1fd0623e07366eca2ab215921345a2e38acdd5d0fa0a74
MD5 6f2494e6c11bfefa483d04b9b1ac640b
BLAKE2b-256 3f164b272700dea44c1d2e8ca963ebb3c684efe22b3eba8cfa31c5fdb60de707

See more details on using hashes here.

Provenance

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

Publisher: cd.yml on pypa/build

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file build-1.4.3-py3-none-any.whl.

File metadata

  • Download URL: build-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for build-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1bc22b19b383303de8f2c8554c9a32894a58d3f185fe3756b0b20d255bee9a38
MD5 8f636c5eb32a37d3a23ab67fd2ffb985
BLAKE2b-256 b230f169e1d8b2071beaf8b97088787e30662b1d8fb82f8c0941d14678c0cbf1

See more details on using hashes here.

Provenance

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

Publisher: cd.yml on pypa/build

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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