mafw.devtools.toolchain.tools.pip_audit

PipAuditTool — concrete ProjectTool for pip-audit.

This module implements the PipAuditTool class that manages the pip-audit dependency in the dev optional-dependencies of pyproject.toml. pip-audit is a vulnerability scanner for Python packages and is referenced in a single location, so no cross-file consistency verification is required.

Since pip-audit has no post_update hook or custom logic, its implementation is purely declarative — only the package name and section path differ from the ProjectTool defaults.

Classes

PipAuditTool([project_root])

Manage pip-audit's version lower bound in pyproject.toml.

class mafw.devtools.toolchain.tools.pip_audit.PipAuditTool(project_root: Path | None = None)[source]

Bases: ProjectTool

Manage pip-audit’s version lower bound in pyproject.toml.

pip-audit is categorized as a project tool because its version is controlled through the dev optional-dependencies group in pyproject.toml. There are no additional configuration files to keep in sync, so verify() always returns an empty list (inherited from ProjectTool).

All behaviour — bootstrapping, version detection, updating, and verification — is provided by the ProjectTool base class.

Parameters:

project_root (Path) – Path to the project root directory containing pyproject.toml. Defaults to the current working directory.

property env_name: str

Hatch environment where pip-audit lives.

property package_name: str

PyPI package name for pip-audit.

property section_path: str

Dot-separated TOML path to the dependency array containing pip-audit.