The pyproject.toml configuration file

pyproject.toml is a build-system-independent, tool-agnostic file in TOML format. for storing Python build, packaging and tool configuration, originally defined in PEP 518 and extended to include the [project] table in PEP 621.

It is typically located at the root of the Source Tree for Python Projects, and included in the top-level directory of all Source Distributions.

The valid top-level tables are listed below. Tables and their respective keys not specified here are reserved for future use, to be proposed in future PEPs, and MUST NOT be defined or used for any purpose. Rather, the [tool] table SHOULD be used instead.

[build-system] table

The [build-system] table is used to store build-related configuration. If the table is present but has no non-empty values, tools SHOULD consider it an error.

The contents and interpretation of the [build-system] table are defined in the Declaring a project’s build system specification. Keys not defined in that specification MUST NOT be added to this table.

[project] table

The [project] table is the standardized place to declare a project’s core metadata for tools to consume. The lack of a [project] table implicitly means that the Build Backend will dynamically provide all core metadata fields. If the table is present but has no non-empty values, tools MUST consider it an error.

The contents and interpretation of the [project] table are defined in the Declaring project metadata specification. Keys not defined in that specification MUST NOT be added to this table.

[tool] table

The [tool] table is where tools related to Python projects, not just build systems, may allow users to specify configuration data. Tools MUST use a named sub-table within [tool] to do this, which to avoid collisions, MUST have as its key a name the project owns on the Python Package Index (PyPI). For example, the flit tool would store its configuration under [tool.flit].

The contents and interpretation of each tool sub-table are defined by each respective tool and its documentation.