stable/freqtrade/__init__.py

22 lines
749 B
Python
Raw Normal View History

2020-02-17 19:16:24 +00:00
""" Freqtrade bot """
2022-12-28 14:53:43 +00:00
__version__ = '2023.1.dev'
2019-08-28 05:05:48 +00:00
if 'dev' in __version__:
2019-08-28 05:05:48 +00:00
try:
import subprocess
2020-02-17 19:17:08 +00:00
__version__ = __version__ + '-' + subprocess.check_output(
2020-02-17 19:17:36 +00:00
['git', 'log', '--format="%h"', '-n 1'],
stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
2020-02-17 19:17:08 +00:00
except Exception: # pragma: no cover
2019-08-28 05:05:48 +00:00
# git not available, ignore
try:
# Try Fallback to freqtrade_commit file (created by CI while building docker image)
from pathlib import Path
versionfile = Path('./freqtrade_commit')
if versionfile.is_file():
__version__ = f"docker-{__version__}-{versionfile.read_text()[:8]}"
except Exception:
pass