Skip to content

Commit

Permalink
fixing for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
alpetric committed Nov 13, 2024
1 parent 5a96d64 commit d598731
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions backend/windmill-worker/src/python_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,8 +1211,8 @@ pub async fn handle_python_reqs(
&req,
"--no-deps",
"--no-color",
"-p",
"3.11",
// "-p",
// "3.11",
// Prevent uv from discovering configuration files.
"--no-config",
"--link-mode=copy",
Expand Down Expand Up @@ -1286,17 +1286,21 @@ pub async fn handle_python_reqs(

#[cfg(windows)]
{
let python_path = &command_args[0];
let mut cmd = Command::new(&python_path);
pip_cmd
.env_clear()
let installer_path = if no_uv_install { command_args[0] } else { "uv" };
let mut cmd: Command = Command::new(&installer_path);
cmd.env_clear()
.envs(envs)
.envs(PROXY_ENVS.clone())
.env("SystemRoot", SYSTEM_ROOT.as_str())
.env("TMP", "C:\\Users\\alex\\AppData\\Local\\Temp")
.env(
"TMP",
std::env::var("TMP").unwrap_or_else(|_| String::from("/tmp")),
)
.args(&command_args[1..])
.stdout(Stdio::piped())
.stderr(Stdio::piped());
start_child_process(cmd, python_path).await?
start_child_process(cmd, installer_path).await?
}
};

Expand Down

0 comments on commit d598731

Please sign in to comment.