build#
A simple, correct PEP 517 build frontend.
build will invoke the PEP 517 hooks to build a distribution package. It is a simple build tool and does not perform any dependency management.
python -m build#
A simple, correct Python build frontend. By default, a source distribution (sdist) is built from {srcdir} and a binary distribution (wheel) is built from the sdist. This is recommended as it will ensure the sdist can be used to build wheels. Pass -s/–sdist and/or -w/–wheel to build a specific distribution. If you do this, the default behavior will be disabled, and all artifacts will be built from {srcdir} (even if you combine -w/–wheel with -s/–sdist, the wheel will be built from {srcdir}).
python -m build [-h] [--version] [--sdist] [--wheel] [--outdir OUTDIR]
[--skip-dependency-check] [--no-isolation]
[--config-setting CONFIG_SETTING]
[srcdir]
python -m positional arguments#
srcdir
- source directory (defaults to current directory)
python -m options#
--sdist
,-s
- build a source distribution (disables the default behavior)--outdir
OUTDIR
,-o
OUTDIR
- output directory (defaults to{srcdir}
/dist)--skip-dependency-check
,-x
- do not check that build dependencies are installed--no-isolation
,-n
- do not isolate the build in a virtual environment--config-setting
CONFIG_SETTING
,-C
CONFIG_SETTING
- pass options to the backend. options which begin with a hyphen must be in the form of"--config-setting=--opt(=value)"
or"-C--opt(=value)"
(default:None
)
Note
A pyproject-build
CLI script is also available, so that tools such as pipx
can use it.
By default build will build the package in an isolated
environment, but this behavior can be disabled with --no-isolation
.