use git log to print version

This commit is contained in:
Matthias 2019-09-09 20:18:47 +02:00
parent c38f3a2b9a
commit 85f1291597

View File

@ -5,8 +5,9 @@ if __version__ == 'develop':
try:
import subprocess
__version__ = str(subprocess.check_output(
["git", "describe"], stderr=subprocess.DEVNULL).rstrip())
__version__ = 'develop-' + subprocess.check_output(
['git', 'log', '--format="%h"', '-n 1'],
stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
except Exception:
# git not available, ignore
pass