mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-14 12:13:57 +00:00
81b432dc0e
Some checks are pending
Build Documentation / Deploy Docs through mike (push) Waiting to run
35 lines
969 B
Python
35 lines
969 B
Python
"""Freqtrade bot"""
|
|
|
|
__version__ = "2024.11-dev"
|
|
|
|
if "dev" in __version__:
|
|
from pathlib import Path
|
|
|
|
try:
|
|
import subprocess # noqa: S404
|
|
|
|
freqtrade_basedir = Path(__file__).parent
|
|
|
|
__version__ = (
|
|
__version__
|
|
+ "-"
|
|
+ subprocess.check_output(
|
|
["git", "log", '--format="%h"', "-n 1"],
|
|
stderr=subprocess.DEVNULL,
|
|
cwd=freqtrade_basedir,
|
|
)
|
|
.decode("utf-8")
|
|
.rstrip()
|
|
.strip('"')
|
|
)
|
|
|
|
except Exception: # pragma: no cover
|
|
# git not available, ignore
|
|
try:
|
|
# Try Fallback to freqtrade_commit file (created by CI while building docker image)
|
|
versionfile = Path("./freqtrade_commit")
|
|
if versionfile.is_file():
|
|
__version__ = f"docker-{__version__}-{versionfile.read_text()[:8]}"
|
|
except Exception: # noqa: S110
|
|
pass
|