Create ephemeral virtual environments for uv run (#3075)

If a virtual environment does not exist, we will create one for the
duration of the invocation.

Adds an `--isolated` flag to force this behavior (ignoring an existing
virtual environment).
This commit is contained in:
Zanie Blue
2024-04-17 11:32:04 -05:00
committed by GitHub
parent f7b83e9e83
commit dcc2c6865c
4 changed files with 96 additions and 29 deletions
@@ -126,6 +126,11 @@ impl PythonEnvironment {
)
}
}
/// Return the [`Interpreter`] for this virtual environment.
pub fn into_interpreter(self) -> Interpreter {
self.interpreter
}
}
/// Locate the current virtual environment.