-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deduplicate when install or uninstall python #4841
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC dedup only deduplicates adjacent elements. Should we collect into a BTreeSet?
We probably need to de-duplicate the keys we're going to download too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -83,7 +84,7 @@ pub(crate) async fn uninstall( | |||
return Ok(ExitStatus::Failure); | |||
} | |||
|
|||
let tasks = futures::stream::iter(matching_installations.iter()) | |||
let tasks = futures::stream::iter(matching_installations.iter().unique()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we collect into a BTreeSet beforehand or no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm matching_installations
is BTreeSet
already for deterministic ordering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I did not realize that, I've raised #4842 to revert this.
Thanks, your contributions are great. |
`matching_installations` is BTreeSet already, no need to deduplicate it. #4841 (comment)
When specifying the same argument multiple times, the same version will be downloaded multiple times:
This PR deduplicates the
ManagedPythonDownload
beforeinstall
oruninstall
: