Revert versioning

This commit is contained in:
Matthias 2020-02-17 20:17:36 +01:00
parent 1172c95817
commit e6dd463ca3

View File

@ -6,18 +6,18 @@ if __version__ == 'develop':
try:
import subprocess
# __version__ = 'develop-' + subprocess.check_output(
# ['git', 'log', '--format="%h"', '-n 1'],
# stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
__version__ = 'develop-' + subprocess.check_output(
['git', 'log', '--format="%h"', '-n 1'],
stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
from datetime import datetime
last_release = subprocess.check_output(
['git', 'tag']
).decode('utf-8').split()[-1].split(".")
# Releases are in the format "2020.1" - we increment the latest version for dev.
prefix = f"{last_release[0]}.{int(last_release[1]) + 1}"
dev_version = int(datetime.now().timestamp() // 1000)
__version__ = f"{prefix}.dev{dev_version}"
# from datetime import datetime
# last_release = subprocess.check_output(
# ['git', 'tag']
# ).decode('utf-8').split()[-1].split(".")
# # Releases are in the format "2020.1" - we increment the latest version for dev.
# prefix = f"{last_release[0]}.{int(last_release[1]) + 1}"
# dev_version = int(datetime.now().timestamp() // 1000)
# __version__ = f"{prefix}.dev{dev_version}"
# subprocess.check_output(
# ['git', 'log', '--format="%h"', '-n 1'],