python -m build
The standard command that turns a project described by pyproject.toml into installable package files, a wheel and a source distribution, in the dist folder.
In more detail
It is a separate package, installed with pip install build. It hands the work to the build backend named in pyproject.toml, such as hatchling.
Related terms
- wheel — The standard ready-to-install package file for Python, with a .whl extension, which pip can install without building anything.
- source distribution — A package file containing a project's source code and metadata, from which an installer can build and install it.
- dist folder — The folder where python -m build writes the finished, installable files of your package: a wheel and a source distribution.
- pyproject.toml — The standard configuration file at the root of a Python project, describing its name, version, dependencies, commands and build system.
Taught in
- Shipping: scripts, entry points and git — Hands-on Python: Complete Video Course & Book