mirror of https://github.com/astral-sh/uv
Avoid showing duplicate paths in `uv python list` (#6740)
<!-- Thank you for contributing to uv! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary - Resolves issue #6690 <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan ``` $ cargo run python list ``` <!-- How was it tested? --> --------- Co-authored-by: leaf-soba <leaf-soba@gmail.com> Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
parent
451eef31a6
commit
71f5998752
|
|
@ -104,8 +104,16 @@ pub(crate) async fn list(
|
|||
|
||||
let mut seen_minor = HashSet::new();
|
||||
let mut seen_patch = HashSet::new();
|
||||
let mut seen_paths = HashSet::new();
|
||||
let mut include = Vec::new();
|
||||
for (version, os, key, kind, path) in output.iter().rev() {
|
||||
// Do not show the same path more than once
|
||||
if let Some(path) = path {
|
||||
if !seen_paths.insert(path) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Only show the latest patch version for each download unless all were requested
|
||||
if !matches!(kind, Kind::System) {
|
||||
if let [major, minor, ..] = version.release() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue