Skip to content

Commit

Permalink
more windows....
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris7 committed Nov 30, 2023
1 parent 46e8b3f commit 5eb2638
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions wooey/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,23 @@ def setup_venv(virtual_environment, job=None, stdout="", stderr=""):
requirements = virtual_environment.requirements
if requirements:
with tempfile.NamedTemporaryFile(
mode="w", prefix="requirements", suffix=".txt"
mode="w", prefix="requirements", suffix=".txt", delete=False
) as reqs_txt:
reqs_txt.write(requirements)
reqs_txt.flush()
os.fsync(reqs_txt.fileno())
venv_command = [
venv_executable,
"-m",
"pip",
"install",
"-r",
reqs_txt.name,
]
(stdout, stderr, return_code) = run_and_stream_command(
venv_command, cwd=None, job=job, stdout=stdout, stderr=stderr
)
venv_command = [
venv_executable,
"-m",
"pip",
"install",
"-r",
reqs_txt.name,
]
(stdout, stderr, return_code) = run_and_stream_command(
venv_command, cwd=None, job=job, stdout=stdout, stderr=stderr
)
if return_code:
raise Exception("Requirements setup failed.\n{}\n{}".format(stdout, stderr))
os.remove(reqs_txt.name)
return (venv_executable, stdout, stderr, return_code)


Expand Down

0 comments on commit 5eb2638

Please sign in to comment.