2024-03-29 07:33:41 +00:00
|
|
|
from freqtrade_client.ft_rest_client import FtRestClient
|
2024-03-29 07:09:03 +00:00
|
|
|
|
|
|
|
|
2024-05-12 14:16:26 +00:00
|
|
|
__version__ = "2024.5-dev"
|
2024-03-29 07:33:41 +00:00
|
|
|
|
2024-05-12 14:16:26 +00:00
|
|
|
if "dev" in __version__:
|
2024-03-29 07:33:41 +00:00
|
|
|
from pathlib import Path
|
2024-05-12 14:16:26 +00:00
|
|
|
|
2024-03-29 07:33:41 +00:00
|
|
|
try:
|
|
|
|
import subprocess
|
2024-05-12 14:16:26 +00:00
|
|
|
|
2024-03-29 07:33:41 +00:00
|
|
|
freqtrade_basedir = Path(__file__).parent
|
|
|
|
|
2024-05-12 14:16:26 +00:00
|
|
|
__version__ = (
|
|
|
|
__version__
|
|
|
|
+ "-"
|
|
|
|
+ subprocess.check_output(
|
|
|
|
["git", "log", '--format="%h"', "-n 1"],
|
|
|
|
stderr=subprocess.DEVNULL,
|
|
|
|
cwd=freqtrade_basedir,
|
|
|
|
)
|
|
|
|
.decode("utf-8")
|
|
|
|
.rstrip()
|
|
|
|
.strip('"')
|
|
|
|
)
|
2024-03-29 07:33:41 +00:00
|
|
|
|
|
|
|
except Exception: # pragma: no cover
|
|
|
|
# git not available, ignore
|
|
|
|
try:
|
|
|
|
# Try Fallback to freqtrade_commit file (created by CI while building docker image)
|
2024-05-12 14:16:26 +00:00
|
|
|
versionfile = Path("./freqtrade_commit")
|
2024-03-29 07:33:41 +00:00
|
|
|
if versionfile.is_file():
|
|
|
|
__version__ = f"docker-{__version__}-{versionfile.read_text()[:8]}"
|
|
|
|
except Exception:
|
|
|
|
pass
|
2024-03-29 08:08:21 +00:00
|
|
|
|
2024-05-12 14:16:26 +00:00
|
|
|
__all__ = ["FtRestClient"]
|