Skip to content

Commit f893abc

Browse files
committed
Merge pull request #2487 from msabramo/install_less_output_on_success_and_failure
install: Less output on success; once on failure
2 parents 89917c9 + c1d21e3 commit f893abc

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

pip/utils/__init__.py

+19-17
Original file line numberDiff line numberDiff line change
@@ -727,23 +727,25 @@ def call_subprocess(cmd, show_stdout=True,
727727
if stdout is not None:
728728
stdout = remove_tracebacks(console_to_str(proc.stdout.read()))
729729
stdout = cStringIO(stdout)
730-
while 1:
731-
line = stdout.readline()
732-
if not line:
733-
break
734-
line = line.rstrip()
735-
all_output.append(line + '\n')
736-
if filter_stdout:
737-
level = filter_stdout(line)
738-
if isinstance(level, tuple):
739-
level, line = level
740-
logger.log(level, line)
741-
# if not logger.stdout_level_matches(level) and False:
742-
# # TODO(dstufft): Handle progress bar.
743-
# logger.show_progress()
744-
else:
745-
logger.debug(line)
746-
else:
730+
all_output = stdout.readlines()
731+
if show_stdout:
732+
while 1:
733+
line = stdout.readline()
734+
if not line:
735+
break
736+
line = line.rstrip()
737+
all_output.append(line + '\n')
738+
if filter_stdout:
739+
level = filter_stdout(line)
740+
if isinstance(level, tuple):
741+
level, line = level
742+
logger.log(level, line)
743+
# if not logger.stdout_level_matches(level) and False:
744+
# # TODO(dstufft): Handle progress bar.
745+
# logger.show_progress()
746+
else:
747+
logger.debug(line)
748+
if not all_output:
747749
returned_stdout, returned_stderr = proc.communicate()
748750
all_output = [returned_stdout or '']
749751
proc.wait()

tests/functional/test_install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def test_install_global_option_using_editable(script, tmpdir):
454454
'install', '--global-option=--version', '-e',
455455
'%[email protected]#egg=anyjson' % local_checkout(url, tmpdir.join("cache"))
456456
)
457-
assert '0.2.5\n' in result.stdout
457+
assert 'Successfully installed anyjson' in result.stdout
458458

459459

460460
@pytest.mark.network

0 commit comments

Comments
 (0)