Spaces:
Running
Running
inoki-giskard
commited on
Commit
•
83a3b19
1
Parent(s):
a872114
Add change line to isolated env log
Browse files- isolated_env.py +3 -3
isolated_env.py
CHANGED
@@ -10,13 +10,13 @@ def prepare_venv(execution_id, deps):
|
|
10 |
|
11 |
pip_executable = os.path.join(venv_base, "bin", "pip")
|
12 |
# Check pyver
|
13 |
-
write_log_to_user_file(execution_id, "Checking Python version")
|
14 |
p = subprocess.run([python_executable, "--version"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
15 |
write_log_to_user_file(execution_id, p.stdout.decode())
|
16 |
if p.returncode != 0:
|
17 |
raise RuntimeError(f"{p.args} ended with {p.returncode}")
|
18 |
# Create venv
|
19 |
-
write_log_to_user_file(execution_id, "Creating virtual environment")
|
20 |
p = subprocess.run([python_executable, "-m", "venv", venv_base, "--clear"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
21 |
write_log_to_user_file(execution_id, p.stdout.decode())
|
22 |
if p.returncode != 0:
|
@@ -26,7 +26,7 @@ def prepare_venv(execution_id, deps):
|
|
26 |
with open(requirement_file, "w") as f:
|
27 |
f.writelines(deps)
|
28 |
# Install deps
|
29 |
-
write_log_to_user_file(execution_id, "Installing dependencies")
|
30 |
p = subprocess.run([pip_executable, "install", "-r", requirement_file], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
31 |
write_log_to_user_file(execution_id, p.stdout.decode())
|
32 |
if p.returncode != 0:
|
|
|
10 |
|
11 |
pip_executable = os.path.join(venv_base, "bin", "pip")
|
12 |
# Check pyver
|
13 |
+
write_log_to_user_file(execution_id, "Checking Python version\n")
|
14 |
p = subprocess.run([python_executable, "--version"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
15 |
write_log_to_user_file(execution_id, p.stdout.decode())
|
16 |
if p.returncode != 0:
|
17 |
raise RuntimeError(f"{p.args} ended with {p.returncode}")
|
18 |
# Create venv
|
19 |
+
write_log_to_user_file(execution_id, "Creating virtual environment\n")
|
20 |
p = subprocess.run([python_executable, "-m", "venv", venv_base, "--clear"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
21 |
write_log_to_user_file(execution_id, p.stdout.decode())
|
22 |
if p.returncode != 0:
|
|
|
26 |
with open(requirement_file, "w") as f:
|
27 |
f.writelines(deps)
|
28 |
# Install deps
|
29 |
+
write_log_to_user_file(execution_id, "Installing dependencies\n")
|
30 |
p = subprocess.run([pip_executable, "install", "-r", requirement_file], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
31 |
write_log_to_user_file(execution_id, p.stdout.decode())
|
32 |
if p.returncode != 0:
|