Coverage for src / mafw / devtools / cli / cli.py: 100%

19 statements  

« prev     ^ index     » next       coverage.py v7.14.0, created at 2026-06-28 13:34 +0000

1# Copyright 2026 European Union 

2# Author: Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu) 

3# SPDX-License-Identifier: EUPL-1.2 

4"""Unified development tools CLI for MAFw maintenance tasks.""" 

5 

6from __future__ import annotations 

7 

8import click 

9 

10try: 

11 from mafw.devtools import ensure_devtools_available 

12 

13 ensure_devtools_available() 

14except ImportError as exc: 

15 raise click.ClickException( 

16 'Development dependencies are not installed. Install them with: pip install mafw[dev]' 

17 ) from exc 

18 

19from mafw.devtools.cli.completion import completion 

20from mafw.devtools.cli.dependencies import dependencies 

21from mafw.devtools.cli.documentation import documentation 

22from mafw.devtools.cli.release import release 

23from mafw.tools.click_extensions import AbbreviateGroup 

24 

25CONTEXT_SETTINGS = {'help_option_names': ['-h', '--help']} 

26 

27 

28@click.group( 

29 cls=AbbreviateGroup, 

30 context_settings=CONTEXT_SETTINGS, 

31 help='Unified development tool for MAFw maintenance tasks.', 

32) 

33def cli() -> None: 

34 """Unified development tool for MAFw maintenance tasks.""" 

35 

36 

37cli.add_command(completion) 

38cli.add_command(release) 

39cli.add_command(dependencies) 

40cli.add_command(documentation) 

41 

42if __name__ == '__main__': 

43 cli()