Coverage for csaf/env.py: 38.46%

13 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2024-12-18 20:12:48 +00:00

1"""Report environment to support resolution of user issues.""" 

2 

3from typing import List, no_type_check 

4 

5import importlib.metadata 

6import scooby 

7 

8 

9@no_type_check 

10def report() -> str: 

11 """Return either text options for the user to report her env or the report of the environment for support.""" 

12 import langcodes # noqa 

13 

14 langcodes.__version__ = importlib.metadata.version('langcodes') 

15 

16 class Report(scooby.Report): 

17 def __init__(self, additional=None, ncol=3, text_width=80, sort=False): 

18 """Initiate a scooby.Report instance.""" 

19 

20 # Mandatory packages. 

21 core = [ 

22 'csaf', 

23 'jmespath', 

24 'langcodes', 

25 'lazr.uri', 

26 'msgspec', 

27 'pydantic', 

28 'scooby', 

29 'setuptools', 

30 'typer', 

31 ] 

32 

33 # Optional packages. 

34 optional: List[str] = [] 

35 

36 scooby.Report.__init__( 

37 self, additional=additional, core=core, optional=optional, ncol=ncol, text_width=text_width, sort=sort 

38 ) 

39 

40 return str(Report()) + '\n'