|
22 | 22 | from pip._vendor.packaging.utils import canonicalize_name
|
23 | 23 |
|
24 | 24 | from pip._internal.cli.parser import ConfigOptionParser
|
| 25 | +from pip._internal.cli.progress_bars import ProgressBarType |
25 | 26 | from pip._internal.exceptions import CommandError
|
26 | 27 | from pip._internal.locations import USER_CACHE_DIR, get_src_prefix
|
27 | 28 | from pip._internal.models.format_control import FormatControl
|
@@ -226,11 +227,32 @@ class PipOption(Option):
|
226 | 227 | "--progress-bar",
|
227 | 228 | dest="progress_bar",
|
228 | 229 | type="choice",
|
229 |
| - choices=["on", "off", "raw"], |
230 |
| - default="on", |
231 |
| - help="Specify whether the progress bar should be used [on, off, raw] (default: on)", |
| 230 | + choices=ProgressBarType.choices(), |
| 231 | + default=ProgressBarType.ON.value, |
| 232 | + help=( |
| 233 | + "Specify whether the progress bar should be used" |
| 234 | + f" {ProgressBarType.help_choices()} (default: %default)" |
| 235 | + ), |
| 236 | +) |
| 237 | + |
| 238 | + |
| 239 | +batch_download_parallelism: Callable[..., Option] = partial( |
| 240 | + Option, |
| 241 | + "--batch-download-parallelism", |
| 242 | + dest="batch_download_parallelism", |
| 243 | + type="int", |
| 244 | + default=10, |
| 245 | + help=( |
| 246 | + "Maximum parallelism employed for batch downloading of metadata-only dists" |
| 247 | + " (default %default parallel requests)." |
| 248 | + " Note that more than 10 downloads may overflow the requests connection pool," |
| 249 | + " which may affect performance." |
| 250 | + " Note also that commands such as 'install --dry-run' should avoid downloads" |
| 251 | + " entirely, and so will not be affected by this option." |
| 252 | + ), |
232 | 253 | )
|
233 | 254 |
|
| 255 | + |
234 | 256 | log: Callable[..., Option] = partial(
|
235 | 257 | PipOption,
|
236 | 258 | "--log",
|
|
0 commit comments