Merge pull request #6542 from TheJoeSchr/check_version_with_endswith

[develop] Check version with endswith
This commit is contained in:
Matthias 2022-03-21 22:17:39 +01:00 committed by GitHub
commit 00287febc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,27 +1,14 @@
""" Freqtrade bot """
__version__ = 'develop'
if __version__ == 'develop':
if 'dev' in __version__:
try:
import subprocess
__version__ = 'develop-' + subprocess.check_output(
__version__ = __version__ + '-' + 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}"
# subprocess.check_output(
# ['git', 'log', '--format="%h"', '-n 1'],
# stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
except Exception: # pragma: no cover
# git not available, ignore
try: