Skip to content

Commit

Permalink
rework method for installing extensions' dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
seruva19 committed Jun 18, 2024
1 parent e5dc686 commit 8307a4c
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/extension/ext_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,32 @@ def install_pip_reqs(self, reqs_path, arguments=[]):
else:
venv_activation_path = os.path.join("venv", "bin", "activate")

pip_install_cmd = [
sys.executable,
"-m",
"pip",
"install",
"-r",
reqs_path,
] + arguments

if os.path.exists(venv_activation_path):
if current_platform == "Windows":
pip_install_cmd = f"call {venv_activation_path} && {sys.executable} -m pip install -r {reqs_path} {' '.join(arguments)}"
activation_cmd = [
"cmd.exe",
"/C",
venv_activation_path + " && " + " ".join(pip_install_cmd),
]
subprocess.check_call(activation_cmd)
else:
pip_install_cmd = f". {venv_activation_path} && {sys.executable} -m pip install -r {reqs_path} {' '.join(arguments)}"
activation_cmd = [
"sh",
"-c",
f". {venv_activation_path} && {' '.join(pip_install_cmd)}",
]
subprocess.check_call(activation_cmd)
else:
pip_install_cmd = (
f"{sys.executable} -m pip install -r {reqs_path} {' '.join(arguments)}"
)

subprocess.check_output(pip_install_cmd, shell=True)
subprocess.check_call(pip_install_cmd)

def standalone(self):
return list(
Expand Down

0 comments on commit 8307a4c

Please sign in to comment.