Coverage for src/ansible_sign/__init__.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-05 08:12 +0000

1import sys 

2 

3if sys.version_info[:2] >= (3, 8): 

4 # TODO: Import directly (no need for conditional) when `python_requires = >= 3.8` 

5 from importlib.metadata import PackageNotFoundError, version # pragma: no cover 

6else: 

7 from importlib_metadata import PackageNotFoundError, version # pragma: no cover 

8 

9try: 

10 # Change here if project is renamed and does not equal the package name 

11 dist_name = "ansible-sign" 

12 __version__ = version(dist_name) 

13except PackageNotFoundError: # pragma: no cover 

14 __version__ = "unknown" 

15finally: 

16 del version, PackageNotFoundError