aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/project/version.py
blob: 8cff3332080c015f4c9c246c37a04171a4ed5477 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
try:
    import importlib.metadata as metadata
except ImportError:
    import importlib_metadata as metadata


try:
    __version__ = metadata.version('cmake_common')
except Exception:
    __version__ = 'unknown'


def add_to_arg_parser(parser):
    parser.add_argument('--version', '-V', action='version',
                        version=f'%(prog)s {__version__}')