diff --git a/crates/uv-python/src/interpreter.rs b/crates/uv-python/src/interpreter.rs index cc733b49a..8c6cc22a3 100644 --- a/crates/uv-python/src/interpreter.rs +++ b/crates/uv-python/src/interpreter.rs @@ -94,6 +94,7 @@ impl Interpreter { pub fn with_virtualenv(self, virtualenv: VirtualEnvironment) -> Self { Self { scheme: virtualenv.scheme, + sys_base_executable: Some(virtualenv.base_executable), sys_executable: virtualenv.executable, sys_prefix: virtualenv.root, target: None, diff --git a/crates/uv-python/src/virtualenv.rs b/crates/uv-python/src/virtualenv.rs index 5fdfc094f..2463d1a87 100644 --- a/crates/uv-python/src/virtualenv.rs +++ b/crates/uv-python/src/virtualenv.rs @@ -18,6 +18,9 @@ pub struct VirtualEnvironment { /// (Unix, Python 3.11). pub executable: PathBuf, + /// The path to the base executable for the environment, within the `home` directory. + pub base_executable: PathBuf, + /// The [`Scheme`] paths for the virtualenv, as returned by (e.g.) `sysconfig.get_paths()`. pub scheme: Scheme, } diff --git a/crates/uv-virtualenv/src/virtualenv.rs b/crates/uv-virtualenv/src/virtualenv.rs index bdd5b7ef3..890142bf1 100644 --- a/crates/uv-virtualenv/src/virtualenv.rs +++ b/crates/uv-virtualenv/src/virtualenv.rs @@ -400,6 +400,7 @@ pub(crate) fn create( }, root: location, executable, + base_executable: base_python, }) }