11import os
2+ import subprocess
23import sys
34from pathlib import Path
4- from typing import List , Optional , Tuple
5+ from typing import List
6+ from typing import Optional
7+ from typing import Tuple
58
69import i18n
710import requests
811import yaml
9- import subprocess
1012
11- from . import config , frozen_utils , os_utils , print_utils
13+ from . import config
14+ from . import frozen_utils
15+ from . import os_utils
16+ from . import print_utils
1217
1318# The URL to the docker-compose.yml
1419BRAINFRAME_DOCKER_COMPOSE_URL = "https://{subdomain}aotu.ai/releases/brainframe/{version}/docker-compose.yml"
@@ -32,14 +37,20 @@ def assert_installed(install_path: Path) -> None:
3237def get_docker_compose_command ():
3338 try :
3439 # First, try to use 'docker compose'
35- compose_version = subprocess .check_output (["docker" , "compose" , "version" , "--short" ], stderr = subprocess .DEVNULL )
40+ compose_version = subprocess .check_output (
41+ ["docker" , "compose" , "version" , "--short" ],
42+ stderr = subprocess .DEVNULL ,
43+ )
3644 return ["docker" , "compose" ], compose_version
3745 except subprocess .CalledProcessError as e2 :
3846 try :
39- compose_version = subprocess .check_output (["docker-compose" , "version" , "--short" ], stderr = subprocess .DEVNULL )
47+ compose_version = subprocess .check_output (
48+ ["docker-compose" , "version" , "--short" ],
49+ stderr = subprocess .DEVNULL ,
50+ )
4051 return ["docker-compose" ], compose_version
4152 except subprocess .CalledProcessError as e1 :
42- message = f' Docker Compose V1: { e } ; V2: { e } '
53+ message = f" Docker Compose V1: { e } ; V2: { e } "
4354 raise DockerComposeNotFoundError (message )
4455
4556
@@ -66,13 +77,13 @@ def run(install_path: Path, commands: List[str]) -> None:
6677 full_command += ["--env-file" , str (env_path )]
6778
6879 additional_help = None
69- if ' down' in commands :
70- if ' --except-volumes' in commands :
71- commands .remove (' --except-volumes' )
80+ if " down" in commands :
81+ if " --except-volumes" in commands :
82+ commands .remove (" --except-volumes" )
7283 else :
73- if ' --volumes' not in commands :
74- commands += [' --volumes' ]
75- if ' --help' in commands :
84+ if " --volumes" not in commands :
85+ commands += [" --volumes" ]
86+ if " --help" in commands :
7687 additional_help = ' --except-volumes Do not add --volumes to "brainframe compose down"'
7788
7889 os_utils .run (full_command + commands )
0 commit comments