Standardized Configuration

Standardized Configuration#

The pyproject.toml Standard

  • Build System: Defines how the package is constructed.

  • Metadata: Centralizes versioning, authorship, and licensing.

  • Dependencies: Explicitly declares runtime packages and Python versions.

  • Optional Dependencies: Isolates execution contexts (e.g., testing).

  • Tool Configuration: Centralizes settings for optional toosl (e.g. linters, testing).

# ./pyproject.toml
[project]
name = "your_project_name"
authors = [
  { name="Your Name", email="your.email@example.com" },
]
description = "Brief description of your project"
readme = "README.md"
requires-python = "~=3.13.0"
license.file = "LICENSE"
dependencies = [ "numpy==2.3.5", ]
[project.urls]
Homepage = "https://github.com/j-i-l/pythonProject"

[dependency-groups]
test = [ "pytest~=7.4.3", ]
docs = [ "Sphinx==8.1.3", ]
dev = [{include-group = "test"},
       {include-group = "docs"},
       "black>=23.0", ]

[tool.hatch.version]
source = "vcs"

[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

Handling System Binaries:

  • Conda: System-level isolation for complex binaries (e.g., CUDA).

  • Pixi: Integrates Conda-ecosystem resolution directly into pyproject.toml.