Skip to content
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

Add default value to progress_bar option #11024

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

q0w
Copy link
Contributor

@q0w q0w commented Apr 11, 2022

help="Specify whether the progress bar should be used [on, off] (default: on)",
choices=["auto", "on", "off"],
default="auto",
help="Specify whether the progress bar should be used [on, off] (default: auto)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably mention what auto means

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto=on
on = force on?

Copy link
Member

@uranusjr uranusjr Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m thinking auto = inferred from -q; on = force on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk how to document it properly.

@@ -17,15 +23,17 @@
from pip._internal.utils.logging import get_indentation

DownloadProgressRenderer = Callable[[Iterable[bytes]], Iterator[bytes]]
RichBarType = Literal["auto", "on"]
BarType = Union[RichBarType, Literal["off"]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really related to this change, but making BarType an enum would make validation much easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it would be tricky to use enum for argparse/optparse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants