mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-30 03:27:31 +00:00
Use install_only python archive (#4843)
## Summary Resolves #4834 ## Test Plan ```sh # 3.12.3 is a `install_only` archive $ cargo run -- python install --preview --force 3.12.3 # 3.9.4 has only `full` archive $ cargo run -- python install --preview --force 3.9.4 ```
This commit is contained in:
parent
7117359ca9
commit
2c214e7585
5 changed files with 1508 additions and 1495 deletions
|
|
@ -463,12 +463,17 @@ impl ManagedPythonDownload {
|
|||
}
|
||||
|
||||
// Extract the top-level directory.
|
||||
let extracted = match uv_extract::strip_component(temp_dir.path()) {
|
||||
let mut extracted = match uv_extract::strip_component(temp_dir.path()) {
|
||||
Ok(top_level) => top_level,
|
||||
Err(uv_extract::Error::NonSingularArchive(_)) => temp_dir.into_path(),
|
||||
Err(err) => return Err(Error::ExtractError(filename.to_string(), err)),
|
||||
};
|
||||
|
||||
// If the distribution is a `full` archive, the Python installation is in the `install` directory.
|
||||
if extracted.join("install").is_dir() {
|
||||
extracted = extracted.join("install");
|
||||
}
|
||||
|
||||
// Persist it to the target
|
||||
debug!("Moving {} to {}", extracted.display(), path.user_display());
|
||||
rename_with_retry(extracted, &path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue