Configuration Reference

This page documents the configuration extracted from our own pyproject.toml file, demonstrating the power of sphinx-autodoc-toml by dogfooding it!

[build-system]

Build system configuration for sphinx-autodoc-toml.

This project uses uv_build as its build backend for significantly faster builds (10-35x faster than hatchling). uv_build is PEP 517-compliant and now stable as of late 2024.

Specification: The build backend MUST be PEP 517 compliant. S_BUILD_001
status: implemented
tags: tooling
links outgoing: R_DX_011
links incoming: R_DX_011
Specification: The build backend SHOULD use uv_build for optimal performance. S_BUILD_003
status: implemented
tags: performance, tooling, developer-experience
links outgoing: R_DX_010
links incoming: R_DX_010

[project]

Project metadata and configuration.

This section contains the core project metadata including name, version, and dependencies. The project follows semantic versioning.

Specification: Project version MUST follow semantic versioning (semver). S_VERSION_001
status: implemented

[project.dependencies]

Runtime dependencies required for the extension to function.

The extension requires Sphinx for the documentation framework and tomlkit for parsing TOML files while preserving comments.

Requirement: Sphinx version MUST be 5.0 or higher for modern directive support. R_DEP_001
status: open
tags: dependencies
Requirement: tomlkit MUST be used instead of tomllib to preserve comments. R_DEP_002
status: open
tags: dependencies, architecture

[project.optional-dependencies]

Optional development dependencies for testing and documentation.

These dependencies are only needed during development and testing, not for using the extension itself.

Requirement: All code MUST have test coverage of at least 80%. R_TEST_001
status: open
tags: testing, quality
links incoming: R_TEST_003, R_DX_004

[project.scripts]

Command-line tools provided by this package.

The toml-doc-lint tool validates and formats TOML files according to the TOML-Doc specification.

Specification: The linter CLI MUST be accessible via the toml-doc-lint command. S_LINT_006
status: planned
links outgoing: R_LINT_001

[tool.hatch.envs.default]

Hatch environment configuration.

Configure hatch to use uv as the installer for all environments. This provides faster dependency resolution and installation.

Specification: Package installation MUST use uv for improved performance. S_BUILD_002
status: implemented
tags: tooling, performance, developer-experience
links outgoing: R_DX_001, R_DX_002
links incoming: R_DX_001, R_DX_002
Specification: Dependencies MUST be locked for reproducible builds across environments. S_BUILD_005
status: implemented
tags: tooling, reproducibility, developer-experience
links outgoing: R_DX_013
links incoming: R_DX_013

Note: We use uv.lock (via ‘uv lock’) for dependency locking rather than hatch-pip-compile. This provides better integration with uv_build backend and uv’s fast resolver, while hatch remains the task runner. Default environment dependencies and setup scripts.

Specification: A single 'hatch run setup' command MUST configure the complete dev environment. S_DX_006
status: implemented
tags: developer-experience, setup, git-hooks
links outgoing: R_DX_001, R_DX_015
links incoming: R_DX_001, R_DX_015

[tool.hatch.envs.test]

Test environment configuration.

Environment for running tests with pytest and coverage reporting.

Specification: Test commands MUST provide clear, actionable output. S_DX_001
status: implemented
tags: developer-experience, testing
links outgoing: R_TEST_004, R_DX_003, R_DX_004
links incoming: R_TEST_004, R_DX_003, R_DX_004

[tool.hatch.envs.lint]

Lint environment configuration.

Environment for running code quality checks with ruff and mypy.

Specification: Linting MUST be runnable via 'hatch run lint:all' command. S_LINT_002
status: implemented
tags: code-quality, tooling, developer-experience
links outgoing: R_DX_005, R_DX_006
links incoming: R_DX_005, R_DX_006
Specification: Code formatting MUST be automated and consistent across the project. S_DX_002
status: implemented
tags: developer-experience, code-quality
links outgoing: R_DX_007
links incoming: R_DX_007

[tool.hatch.envs.docs]

Documentation environment configuration.

Environment for building documentation with Sphinx.

Specification: Documentation MUST be buildable via 'hatch run docs:build' command. S_DOCS_001
status: implemented
tags: documentation, tooling, developer-experience
links outgoing: R_DX_008, R_DX_009
links incoming: R_DX_008, R_DX_009
Specification: Documentation MUST demonstrate dogfooding by using autodoc-toml for its own config. S_DX_003
status: implemented
tags: developer-experience, documentation

[tool.pytest.ini_options]

Pytest test runner configuration.

Configures how pytest discovers and runs tests.

Requirement: All tests MUST be located in the tests/ directory. R_TEST_002
status: implemented
tags: testing

[tool.ruff]

Ruff linter configuration.

Ruff is a fast Python linter that checks code style and quality.

Specification: Line length MUST NOT exceed 100 characters. S_STYLE_001
status: implemented
tags: code-quality

[tool.ruff.lint]

Ruff linting rules selection.

Enables specific linting rule categories for code quality checks.

[tool.coverage.run]

Coverage.py configuration for measuring test coverage.

Specifies which source files to measure and which to omit.

Requirement: Test coverage MUST be measured and reported. R_TEST_003
status: implemented
tags: testing, quality
links outgoing: R_TEST_001

[tool.coverage.report]

Coverage reporting configuration.

Defines which lines to exclude from coverage reports.

[tool.mypy]

MyPy static type checker configuration.

MyPy performs static type checking to catch type-related bugs.

Specification: All function definitions MUST have type annotations. S_TYPE_001
status: implemented
tags: code-quality, types

[[tool.mypy.overrides]

MyPy overrides for third-party libraries without type stubs.