mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Omit pythonX.Y segment in stdlib on managed Windows (#4727)
## Summary Windows omits this segment, IIRC. Closes https://github.com/astral-sh/uv/issues/4724.
This commit is contained in:
parent
2c0cb6e021
commit
d05bb45c74
1 changed files with 10 additions and 8 deletions
|
@ -278,14 +278,16 @@ impl InstalledToolchain {
|
||||||
/// Ensure the toolchain is marked as externally managed with the
|
/// Ensure the toolchain is marked as externally managed with the
|
||||||
/// standard `EXTERNALLY-MANAGED` file.
|
/// standard `EXTERNALLY-MANAGED` file.
|
||||||
pub fn ensure_externally_managed(&self) -> Result<(), Error> {
|
pub fn ensure_externally_managed(&self) -> Result<(), Error> {
|
||||||
let lib = if cfg!(windows) { "Lib" } else { "lib" };
|
// Construct the path to the `stdlib` directory.
|
||||||
let file = self
|
let stdlib = if cfg!(windows) {
|
||||||
.path
|
self.path.join("install").join("Lib")
|
||||||
.join("install")
|
} else {
|
||||||
.join(lib)
|
self.path
|
||||||
// Note the Python version must not include the patch.
|
.join("install")
|
||||||
.join(format!("python{}", self.key.version().python_version()))
|
.join("lib")
|
||||||
.join("EXTERNALLY-MANAGED");
|
.join(format!("python{}", self.key.version().python_version()))
|
||||||
|
};
|
||||||
|
let file = stdlib.join("EXTERNALLY-MANAGED");
|
||||||
fs_err::write(file, EXTERNALLY_MANAGED)?;
|
fs_err::write(file, EXTERNALLY_MANAGED)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue