Skip to content

Commit

Permalink
Set base executable when returning virtual environment
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Feb 4, 2025
1 parent 80feb73 commit b4fcd70
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/uv-python/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions crates/uv-python/src/virtualenv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
1 change: 1 addition & 0 deletions crates/uv-virtualenv/src/virtualenv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ pub(crate) fn create(
},
root: location,
executable,
base_executable: base_python,
})
}

Expand Down

0 comments on commit b4fcd70

Please sign in to comment.