Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Eventual Inc Daft Python Package Configuration

From Leeroopedia


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:

  1. Build system declaration: Which backend to use (setuptools, maturin, flit).
  2. Project metadata: Name, version, dependencies, entry points.
  3. 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.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment