build1.2.2.post1
Published
A simple, correct Python build frontend
pip install build
Package Downloads
Requires Python
>=3.8
Dependencies
- packaging
>=19.1
- pyproject_hooks
- colorama
; os_name == "nt"
- importlib-metadata
>=4.6; python_full_version < "3.10.2"
- tomli
>=1.1.0; python_version < "3.11"
- furo
>=2023.08.17; extra == "docs"
- sphinx
~=7.0; extra == "docs"
- sphinx-argparse-cli
>=1.5; extra == "docs"
- sphinx-autodoc-typehints
>=1.10; extra == "docs"
- sphinx-issues
>=3.0.0; extra == "docs"
- build
[uv,virtualenv]; extra == "test"
- filelock
>=3; extra == "test"
- pytest
>=6.2.4; extra == "test"
- pytest-cov
>=2.12; extra == "test"
- pytest-mock
>=2; extra == "test"
- pytest-rerunfailures
>=9.1; extra == "test"
- pytest-xdist
>=1.34; extra == "test"
- wheel
>=0.36.0; extra == "test"
- setuptools
>=42.0.0; extra == "test" and python_version < "3.10"
- setuptools
>=56.0.0; extra == "test" and python_version == "3.10"
- setuptools
>=56.0.0; extra == "test" and python_version == "3.11"
- setuptools
>=67.8.0; extra == "test" and python_version >= "3.12"
- build
[uv]; extra == "typing"
- importlib-metadata
>=5.1; extra == "typing"
- mypy
~=1.9.0; extra == "typing"
- tomli
; extra == "typing"
- typing-extensions
>=3.7.4.3; extra == "typing"
- uv
>=0.1.18; extra == "uv"
- virtualenv
>=20.0.35; extra == "virtualenv"
build
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
oruv
).--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 todist
)
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.