ruff format: update ft_client

This commit is contained in:
Matthias
2024-05-12 16:16:26 +02:00
parent 4f5bf632fc
commit 15f32be176
4 changed files with 189 additions and 186 deletions
+18 -7
View File
@@ -1,26 +1,37 @@
from freqtrade_client.ft_rest_client import FtRestClient
__version__ = '2024.5-dev'
__version__ = "2024.5-dev"
if 'dev' in __version__:
if "dev" in __version__:
from pathlib import Path
try:
import subprocess
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('"')
__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')
versionfile = Path("./freqtrade_commit")
if versionfile.is_file():
__version__ = f"docker-{__version__}-{versionfile.read_text()[:8]}"
except Exception:
pass
__all__ = ['FtRestClient']
__all__ = ["FtRestClient"]