-
Notifications
You must be signed in to change notification settings - Fork 3.2k
improve pooled progress output for BatchDownloader #12925
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
base: main
Are you sure you want to change the base?
Conversation
4687d11
to
847fee1
Compare
847fee1
to
11a7a0f
Compare
I've not looked at the code at all, but I have some thoughts on the user experience. I think what makes the current pip downloader progress bar really portable and not garnered too many user complaints is that it's easy to read, doesn't repeat information, and almost never suffers from "reflow" issues. Taking a look at what that means in practise compared to your screenshot:
I personally would advise:
|
The batched raw outputs should match the existing raw ones. Percentage isn't needed, raw mode is intended to supply unprocessed information (for wrappers). |
316e7c3
to
77de663
Compare
- use more specific types for BatchDownloader#__call__ - calculate byte lengths with a HEAD request - quiet all progress output from -q - don't write colored output with --no-color - write a lot more documentation for the new progress bar logic - use ProgressBarType enum for --progress-bar CLI flag
051d50e
to
9d62bf8
Compare
Split out from #12923.
Problem
We have a really nice
BatchDownloader
for pooled downloads from metadata-only resolves, but it currently does the same thing as the synchronousDownloader
! We have more information about what we need to download, so let's display it to the user and give them an idea of overall progress!Note: this PR does not perform parallel downloads. That is performed in #12923, on top of this change.
Solution
--progress-bar
correspond to a new enum classProgressBarType
.BatchedProgress
abstract class to codify how to respond to async notifications of multiple parallel download tasks instead of a single download task.BatchedRawProgressBar
to print log messages for individual subtasks as well as a repeated (rate-limited) log message for overall progress in downloading all bytes.BatchedRichProgressBar
using the full gamut of the vendoredrich
library to produce colorful and useful output for multiple parallel download tasks.Result
We have a nice progress bar for multiple downloads at once!