pyproject.toml
The standard configuration file at the root of a Python project, describing its name, version, dependencies, commands and build system.
In more detail
It is written in TOML. The [project] table holds the metadata and dependencies, [project.scripts] the entry points and [build-system] which build backend to use. Tools such as pytest, ruff and mypy can keep their settings there too.
Example
[project]
name = "wordcount"
version = "0.1.0"Related terms
- TOML — A plain text configuration file format of sections and key = value lines, designed to be easy for people to read.
- entry point — A declared command name that, when your package is installed, becomes a real command which calls a chosen function.
- 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.
- dependency — Anything a program needs in order to work, such as a library, a tool or another service.
Taught in
- Shipping: scripts, entry points and git — Hands-on Python: Complete Video Course & Book