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

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

positional arguments

  • srcdir - source directory (defaults to current directory)

optional arguments

  • -h, --help - show this help message and exit

  • --version, -V - show program’s version number and exit

  • --sdist, -s - build a source distribution (default: False)

  • --wheel, -w - build a wheel (default: False)

  • --outdir OUTDIR, -o OUTDIR - output directory (defaults to {srcdir}/dist)

  • --skip-dependencies, -x - do not check that build dependencies are installed (default: False)

  • --no-isolation, -n - do not isolate the build in a virtual environment (default: False)

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