build

A simple, correct PEP 517 package builder.

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

usage: python -m build [-h] [--version] [--sdist] [--wheel] [--outdir dir]
                       [--skip-dependencies] [--no-isolation]
                       [--config-setting CONFIG_SETTING]
                       [srcdir]
srcdir

source directory (defaults to current directory)

-h, --help

show this help message and exit

--version, -V

show program’s version number and exit

--sdist, -s

build a source package

--wheel, -w

build a wheel

--outdir <dir>, -o <dir>

output directory (defaults to {srcdir}/dist)

--skip-dependencies, -x

does not check for the dependencies

--no-isolation, -n

do not isolate the build in a virtual environment

--config-setting <config_setting>, -C <config_setting>

pass option to the backend

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 a isolated environment, but this behavior can be disabled with --no-isolation.