mafw.devtools.toolchain.versions

Collect current tool versions for toolchain reports.

This module contains the implementation logic for reporting current tool versions. It deliberately does not query package indexes or detect latest versions, so it can be used in CI jobs that only need to record their environment.

Functions

collect_tool_versions(tools)

Detect current versions for the supplied tools without online checks.

Classes

ToolVersionResult(tool_name, category, version)

Result of detecting the current version of one tool.

class mafw.devtools.toolchain.versions.ToolVersionResult(tool_name: str, category: Literal['host', 'project'], version: Version | None, error: str | None = None)[source]

Bases: object

Result of detecting the current version of one tool.

Parameters:
  • tool_name – Name of the tool.

  • category – Whether the tool is managed by the host or project.

  • version – Detected version, or None when unavailable.

  • error – Error message when version detection failed.

mafw.devtools.toolchain.versions.collect_tool_versions(tools: Sequence[ToolChainTool]) → list[ToolVersionResult][source]

Detect current versions for the supplied tools without online checks.

Each tool is processed independently so a detection failure does not prevent the remaining versions from being collected.

Parameters:

tools – Tools to inspect, in the order they should be reported.

Returns:

One result for each supplied tool, preserving input order.