mafw.devtools.documentation.requirements
Requirements documentation constants and generators for MAFw.
This module holds the shared constants used by both the multiversion-doc
CLI and other development tools (e.g. dependency freeze, release workflow),
as well as the RST generation functions for dependency tables and Python
version substitutions.
Module Attributes
Dependency groups to generate requirements documentation for. |
|
Filename for the generated Python substitution file. |
Functions
|
Generate the RST substitution file for the supported Python range. |
|
Generate an RST file with the dependencies of a given group. |
- mafw.devtools.documentation.requirements._load_supported_python_versions(*, repo_root: Path | None = None) list[str][source]
Load the supported Python versions declared in
pyproject.toml.- Parameters:
repo_root (Path | None) – Repository root directory, defaults to auto-detection
- Returns:
Sorted list of supported
major.minorversions.- Return type:
list[str]
- mafw.devtools.documentation.requirements.generate_python_versions_rst(*, repo_root: Path | None = None) None[source]
Generate the RST substitution file for the supported Python range.
The file is emitted under
docs/source/requirementsso it can be included by the general documentation and copied into the README update block.- Parameters:
repo_root (Path | None) – Repository root directory, defaults to auto-detection
- mafw.devtools.documentation.requirements.generate_requirements_rst(group_name: str = 'base', *, repo_root: Path | None = None) None[source]
Generate an RST file with the dependencies of a given group.
The function parses pyproject.toml to retrieve the dependencies and their descriptions from the tool.mafw.dependency-description section. The generated file is saved as <group_name>_requirements.rst in the docs/source directory.
- Parameters:
group_name (str) – The name of the dependency group (e.g., ‘base’, ‘seaborn’), defaults to ‘base’
repo_root (Path | None) – Repository root directory, defaults to auto-detection
- mafw.devtools.documentation.requirements.PYTHON_VERSIONS_REQUIREMENTS_FILENAME = 'python_versions.rst'
Filename for the generated Python substitution file.
- mafw.devtools.documentation.requirements.REQUIREMENTS_GROUPS = ['base', 'seaborn', 'devtools']
Dependency groups to generate requirements documentation for.