Source code for mafw.devtools.toolchain.tools.hatch

#  Copyright 2026 European Union
#  Author: Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu)
#  SPDX-License-Identifier: EUPL-1.2
"""
Hatch host tool implementation.

This module provides the :class:`HatchTool` concrete implementation of
:class:`~mafw.devtools.toolchain.HostTool` for managing hatch as a
host tool installed via pipx.

Hatch is the build backend and project management tool used by MAFw. As a
host tool, it lives outside the project's virtual environments and is managed
through pipx commands. All operational logic (bootstrap, version detection,
upgrade, verification) is inherited from :class:`~mafw.devtools.toolchain.HostTool`.
"""

from __future__ import annotations

from mafw.devtools.toolchain import HostTool


[docs] class HatchTool(HostTool): """Manage hatch as a host tool installed via pipx. This tool handles bootstrapping (installing hatch via pipx), detecting the currently installed version from pipx metadata, querying PyPI for the latest release, and upgrading via ``pipx upgrade``. Since hatch is a host-level tool that does not modify repository files, the :meth:`verify` method always returns an empty list. All method implementations are inherited from :class:`~mafw.devtools.toolchain.HostTool`. """ @property def pipx_package_name(self) -> str: """The pipx package name for hatch.""" return 'hatch'