Install versioned Python executables into the bin directory during uv python install (#8458)
Updates `uv python install` to link `python3.x` in the executable directory (i.e., `~/.local/bin`) to the the managed interpreter path. Includes - #8569 - #8571 Remaining work - #8663 - #8650 - Add an opt-out setting and flag - Update documentation
This commit is contained in:
@@ -1236,6 +1236,16 @@ impl PythonVariant {
|
||||
PythonVariant::Freethreaded => interpreter.gil_disabled(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Return the lib or executable suffix for the variant, e.g., `t` for `python3.13t`.
|
||||
///
|
||||
/// Returns an empty string for the default Python variant.
|
||||
pub fn suffix(self) -> &'static str {
|
||||
match self {
|
||||
Self::Default => "",
|
||||
Self::Freethreaded => "t",
|
||||
}
|
||||
}
|
||||
}
|
||||
impl PythonRequest {
|
||||
/// Create a request from a string.
|
||||
@@ -1635,12 +1645,7 @@ impl std::fmt::Display for ExecutableName {
|
||||
if let Some(prerelease) = &self.prerelease {
|
||||
write!(f, "{prerelease}")?;
|
||||
}
|
||||
match self.variant {
|
||||
PythonVariant::Default => {}
|
||||
PythonVariant::Freethreaded => {
|
||||
f.write_str("t")?;
|
||||
}
|
||||
};
|
||||
f.write_str(self.variant.suffix())?;
|
||||
f.write_str(std::env::consts::EXE_SUFFIX)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user