Coverage for src / rhiza / __main__.py: 100%
14 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-02-12 20:13 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-02-12 20:13 +0000
1"""Rhiza module entry point.
3This module allows running the Rhiza CLI with `python -m rhiza` by
4delegating execution to the Typer application defined in `rhiza.cli`.
5"""
7from importlib.metadata import entry_points
9import typer
11from rhiza.cli import app
14def load_plugins(app: typer.Typer) -> None:
15 """Load plugins from entry points."""
16 # 'rhiza.plugins' matches the group we defined in rhiza-tools
17 plugin_entries = entry_points(group="rhiza.plugins")
19 for entry in plugin_entries:
20 try:
21 plugin_app = entry.load()
22 # This adds the plugin as a subcommand, e.g., 'rhiza tools bump'
23 app.add_typer(plugin_app, name=entry.name)
24 except Exception as e:
25 print(f"Failed to load plugin {entry.name}: {e}")
28load_plugins(app)
31if __name__ == "__main__":
32 app()