2024-05-12 14:18:15 +00:00
|
|
|
"""Freqtrade bot"""
|
2019-08-28 05:05:48 +00:00
|
|
|
|
2024-07-28 18:10:30 +00:00
|
|
|
__version__ = "2024.8-dev"
|
2024-05-12 14:18:15 +00:00
|
|
|
|
|
|
|
if "dev" in __version__:
|
2023-01-12 18:27:41 +00:00
|
|
|
from pathlib import Path
|
2024-05-12 14:18:15 +00:00
|
|
|
|
2019-08-28 05:05:48 +00:00
|
|
|
try:
|
2024-07-05 06:25:24 +00:00
|
|
|
import subprocess # noqa: S404
|
2024-05-12 14:18:15 +00:00
|
|
|
|
2023-01-12 18:27:41 +00:00
|
|
|
freqtrade_basedir = Path(__file__).parent
|
2020-02-17 19:17:08 +00:00
|
|
|
|
2024-05-12 14:18:15 +00:00
|
|
|
__version__ = (
|
|
|
|
__version__
|
|
|
|
+ "-"
|
|
|
|
+ subprocess.check_output(
|
|
|
|
["git", "log", '--format="%h"', "-n 1"],
|
|
|
|
stderr=subprocess.DEVNULL,
|
|
|
|
cwd=freqtrade_basedir,
|
|
|
|
)
|
|
|
|
.decode("utf-8")
|
|
|
|
.rstrip()
|
|
|
|
.strip('"')
|
|
|
|
)
|
2020-02-17 19:17:08 +00:00
|
|
|
|
2021-09-05 07:14:44 +00:00
|
|
|
except Exception: # pragma: no cover
|
2019-08-28 05:05:48 +00:00
|
|
|
# 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)
|
2024-05-12 14:18:15 +00:00
|
|
|
versionfile = Path("./freqtrade_commit")
|
2020-04-12 07:55:21 +00:00
|
|
|
if versionfile.is_file():
|
2022-10-20 17:55:42 +00:00
|
|
|
__version__ = f"docker-{__version__}-{versionfile.read_text()[:8]}"
|
2024-06-08 07:23:02 +00:00
|
|
|
except Exception: # noqa: S110
|
2020-04-12 07:55:21 +00:00
|
|
|
pass
|