Skip to content

Commit

Permalink
Set VIRTUAL_ENV for uv run invocations in ephemeral environments
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Aug 23, 2024
1 parent 9d1cd8e commit b56af58
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/uv/src/commands/project/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,10 @@ pub(crate) async fn run(
)?;
process.env("PATH", new_path);

if let Some(env) = ephemeral_env {
process.env("VIRTUAL_ENV", env.root().as_os_str());
}

// Spawn and wait for completion
// Standard input, output, and error streams are all inherited
// TODO(zanieb): Throw a nicer error message if the command is not found
Expand Down

0 comments on commit b56af58

Please sign in to comment.