Principle:Eventual Inc Daft Python Package Configuration
| Knowledge Sources | |
|---|---|
| Domains | Build_System, Package_Management |
| Last Updated | 2026-02-08 14:00 GMT |
Overview
Standard for declaring Python project metadata, dependencies, optional extras, and build system configuration in a single `pyproject.toml` file.
Description
Python Package Configuration centralizes all package metadata (name, version, authors, license), runtime dependencies, optional feature groups (extras), development/test/docs dependency groups, and tool configurations (pytest, mypy, ruff) in a single TOML file. For Rust-Python hybrid projects, the build system section specifies the Rust build backend (maturin) that compiles the native extension alongside the Python source.
Usage
Apply this principle for any Python package, especially hybrid Rust-Python packages built with maturin. The optional dependency groups pattern (`pip install pkg[extra]`) is essential for libraries with many integrations where users install only what they need.
Theoretical Basis
The `pyproject.toml` standard (PEP 517, PEP 518, PEP 621) unifies three previously separate concerns:
- Build system declaration: Which backend to use (setuptools, maturin, flit).
- Project metadata: Name, version, dependencies, entry points.
- Tool configuration: Settings for linters, formatters, type checkers, and test runners.
Optional dependency groups allow fine-grained feature installation without bundling every integration's transitive dependencies.