Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

ADR-26029: pyproject.toml as Tool Configuration Hub


title: pyproject.toml as Tool Configuration Hub date: 2026-02-16 tags:


ADR-26029: pyproject.toml as Tool Configuration Hub

Date

2026-02-16

Status

Accepted

Context

Scripts in tools/scripts/ need shared, machine-readable configuration — valid commit types, CHANGELOG section mappings, ArchTag-required types, and similar domain constants. Previously these were hardcoded as Python constants duplicated across scripts, creating drift risk when conventions evolved.

The hub-spoke architecture (ADR-26020) adds a further constraint: configuration must travel with the package when a module is extracted to a spoke repository. A config mechanism tied to the monorepo layout (e.g., a shared paths.py constant) would not survive extraction.

Decision

pyproject.toml [tool.X] sections are the canonical location for machine-readable tool configuration in this repository and its spoke packages.

Why pyproject.toml

Loading convention

Scripts load config via tomllib (stdlib) and expose parsed values as module-level constants for testability:

import tomllib
from pathlib import Path

_PYPROJECT = Path(__file__).resolve().parents[2] / "pyproject.toml"
with _PYPROJECT.open("rb") as f:
    _CONFIG = tomllib.load(f)["tool"]["commit-convention"]

VALID_TYPES: list[str] = _CONFIG["valid-types"]

What NOT to put in pyproject.toml

First use

[tool.commit-convention] — valid types, ArchTag-required types, and type-to-section mapping for CHANGELOG generation. Consumed by validate_commit_msg.py and generate_changelog.py (ADR-26024).

Consequences

Positive

Negative / Risks

Alternatives

References

Participants

  1. Vadim Rudakov

  2. Claude Opus 4.6