2020-02-17 19:16:24 +00:00
|
|
|
""" Freqtrade bot """
|
2020-12-28 08:54:58 +00:00
|
|
|
__version__ = '2020.12'
|
2019-08-28 05:05:48 +00:00
|
|
|
|
|
|
|
if __version__ == 'develop':
|
|
|
|
|
|
|
|
try:
|
|
|
|
import subprocess
|
2020-02-17 19:17:08 +00:00
|
|
|
|
2020-02-17 19:17:36 +00:00
|
|
|
__version__ = 'develop-' + subprocess.check_output(
|
|
|
|
['git', 'log', '--format="%h"', '-n 1'],
|
|
|
|
stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
|
2020-02-17 19:17:08 +00:00
|
|
|
|
2020-02-17 19:17:36 +00:00
|
|
|
# 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}"
|
2020-02-17 19:17:08 +00:00
|
|
|
|
|
|
|
# subprocess.check_output(
|
|
|
|
# ['git', 'log', '--format="%h"', '-n 1'],
|
|
|
|
# stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
|
2019-08-28 05:05:48 +00:00
|
|
|
except Exception:
|
|
|
|
# git not available, ignore
|
2020-04-12 07:55:21 +00:00
|
|
|
try:
|
2020-04-14 06:05:46 +00:00
|
|
|
# Try Fallback to freqtrade_commit file (created by CI while building docker image)
|
2020-04-12 07:55:21 +00:00
|
|
|
from pathlib import Path
|
|
|
|
versionfile = Path('./freqtrade_commit')
|
|
|
|
if versionfile.is_file():
|
|
|
|
__version__ = f"docker-{versionfile.read_text()[:8]}"
|
|
|
|
except Exception:
|
|
|
|
pass
|