1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Suppress the progress bar with --quiet and --log

This commit is contained in:
q0w 2022-03-01 19:22:09 +03:00
parent 3820b0e52c
commit e615c039ef
3 changed files with 16 additions and 0 deletions

1
news/10915.bugfix.rst Normal file
View file

@ -0,0 +1 @@
Suppress the progress bar, when running with ``--log`` and ``--quiet``.

View file

@ -288,6 +288,9 @@ class RequirementCommand(IndexGroupCommand):
"fast-deps has no effect when used with the legacy resolver."
)
if options.quiet:
options.progress_bar = "off"
return RequirementPreparer(
build_dir=temp_build_dir_path,
src_dir=options.src_dir,

View file

@ -573,6 +573,18 @@ def test_install_quiet(script: PipTestEnvironment, data: TestData) -> None:
assert result.stderr == ""
def test_install_quiet_log(script: PipTestEnvironment, data: TestData) -> None:
"""
Test suppressing the progress bar with --quiet and --log.
"""
logfile = script.scratch_path / "log"
result = script.pip(
"install", "-qqq", "--find-links", data.find_links, "--log", logfile, "mypy"
)
assert result.stdout == ""
assert result.stderr == ""
def test_hashed_install_success(
script: PipTestEnvironment, data: TestData, tmpdir: Path
) -> None: