2020-06-02 01:47:24 +02:00
|
|
|
import subprocess
|
|
|
|
from collections import namedtuple
|
|
|
|
|
2020-06-03 01:07:43 +02:00
|
|
|
build = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']) \
|
2020-06-02 01:47:24 +02:00
|
|
|
.decode()
|
|
|
|
|
|
|
|
VersionInfo = namedtuple('VersionInfo', 'major minor micro releaselevel build')
|
|
|
|
version_info = VersionInfo(
|
|
|
|
major=3, minor=0, micro=0,
|
|
|
|
releaselevel='alpha', build=build
|
|
|
|
)
|
|
|
|
|
2020-06-04 00:14:50 +02:00
|
|
|
__version__ = "v{}.{}.{}-{}.{}".format(
|
|
|
|
version_info.major, version_info.minor, version_info.micro,
|
|
|
|
version_info.releaselevel, version_info.build
|
|
|
|
).replace('\n', '')
|