QamoosTech
DevOps & CloudEnvironments and packagingIntermediatePython

pyproject.toml

PronunciationPY-proj-ekt TOM-ul

Definition

pyproject.toml is the standard configuration file of a Python project. It holds the project's name, version, dependencies and build settings, plus the settings of tools such as Ruff and pytest. TOML is its simple key = value format.

Where you hear it

When creating or publishing a Python package, configuring linters and test tools, and reading a repo's setup.

Examples

  • All the tool settings live in pyproject.toml.
  • Add the dependency to pyproject.toml and reinstall.
  • The name, the version and the dependencies are all in pyproject.toml now.

Common mistake

Keeping the same settings in several files. One pyproject.toml should be the single source.

Don't confuse with

requirements.txt, which only lists packages to install. pyproject.toml describes the whole project.

Say it at work

  • In a meeting or chatWhere is the Ruff config? In pyproject.toml.
  • In an email or ticketThe build backend is declared in pyproject.toml.