- Notifications
You must be signed in to change notification settings - Fork127
A simple, correct Python build frontend
License
pypa/build
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A simple, correct Python build frontend.
See thedocumentation for more information.
build
can be installed viapip
or an equivalent via:
$pip install build
$python -m build
This will build the package in an isolated environment, generating asource-distribution and wheel in the directorydist/
.See thedocumentation for full information.
--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 wheelfrom the SDist.-nx
: Disable build isolation and dependency checking. Identical to pip and uv's--no-build-isolation
flag.
If you usepipx, such as in GitHub Actions, the following command will downloadand run build in one step:
$pipx run build
If you want to useuv to speed up the virtual environment creation, you can use--installer=uv
. You can get a Python wheel foruv
with the[uv]
extra.Combining both suggestions yields the following:
$pipx run build[uv] --installer=uv
If you are usingcibuildwheel, build is integrated and can be use with either (in yourpyproject.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!)
On conda-forge, this package is calledpython-build.
Everyone interacting in the build's codebase, issue trackers, chat rooms, and mailing lists is expected to followthePSF Code of Conduct.
About
A simple, correct Python build frontend