comicbox.version

[docs] module comicbox.version

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
"""Package name and version."""

import sys
from contextlib import suppress
from importlib.metadata import PackageNotFoundError, version

PACKAGE_NAME = "comicbox"


def get_version() -> str:
    """Get the current installed comicbox version."""
    v = "dev"
    if "pytest" not in sys.modules:
        with suppress(PackageNotFoundError):
            v = version(PACKAGE_NAME)
    return v


VERSION = get_version()
DEFAULT_TAGGER = f"{PACKAGE_NAME} {VERSION}"