mafw.devtools

MAFw development tools package.

This package contains the business logic modules used by the release-mgt and multiversion-doc CLI scripts. It requires optional development dependencies (requests, packaging) that are not part of the core MAFw runtime.

Use ensure_devtools_available() as a guard before importing subpackages.

Functions

ensure_devtools_available()

Verify that optional development dependencies are importable.

Exceptions

DevtoolsError

Base exception for MAFw development tool errors.

exception mafw.devtools.DevtoolsError[source]

Bases: Exception

Base exception for MAFw development tool errors.

This exception replaces direct usage of click.ClickException in business-logic modules so that the library layer remains independent of the CLI framework.

mafw.devtools._read_devtools_deps() list[str][source]

Read the devtools optional-dependency names from MAFw package metadata.

This function requires packaging to be importable (the caller ensures this). It uses Requirement to parse the dependency specifiers reliably.

Falls back to reading pyproject.toml from the source tree if the installed metadata does not yet include the devtools extra (e.g. stale editable install).

Returns:

List of top-level package names required by the devtools extra.

Return type:

list[str]

mafw.devtools.ensure_devtools_available() None[source]

Verify that optional development dependencies are importable.

The list of required packages is read from MAFw’s own [devtools] optional-dependency group in pyproject.toml, keeping it as the single source of truth. The check is performed only once; subsequent calls return immediately.

Raises:

ImportError – If packaging or any other package from the devtools extra cannot be imported.

mafw.devtools._devtools_checked: bool = True

Module-level flag to skip repeated import checks after the first successful call.

Modules

cli

CLI sub-package for MAFw development tools.

dependencies

Dependency management utilities for MAFw development tools.

documentation

Documentation management utilities for MAFw development tools.

git

Git operations for MAFw development tools.

gitlab

GitLab integration helpers for MAFw development tools.

release

Release management utilities for MAFw development tools.