Skip to content

Commit

Permalink
Merge pull request #2487 from msabramo/install_less_output_on_success…
Browse files Browse the repository at this point in the history
…_and_failure

install: Less output on success; once on failure
  • Loading branch information
dstufft committed Mar 6, 2015
2 parents 89917c9 + c1d21e3 commit f893abc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
36 changes: 19 additions & 17 deletions pip/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,23 +727,25 @@ def call_subprocess(cmd, show_stdout=True,
if stdout is not None:
stdout = remove_tracebacks(console_to_str(proc.stdout.read()))
stdout = cStringIO(stdout)
while 1:
line = stdout.readline()
if not line:
break
line = line.rstrip()
all_output.append(line + '\n')
if filter_stdout:
level = filter_stdout(line)
if isinstance(level, tuple):
level, line = level
logger.log(level, line)
# if not logger.stdout_level_matches(level) and False:
# # TODO(dstufft): Handle progress bar.
# logger.show_progress()
else:
logger.debug(line)
else:
all_output = stdout.readlines()
if show_stdout:
while 1:
line = stdout.readline()
if not line:
break
line = line.rstrip()
all_output.append(line + '\n')
if filter_stdout:
level = filter_stdout(line)
if isinstance(level, tuple):
level, line = level
logger.log(level, line)
# if not logger.stdout_level_matches(level) and False:
# # TODO(dstufft): Handle progress bar.
# logger.show_progress()
else:
logger.debug(line)
if not all_output:
returned_stdout, returned_stderr = proc.communicate()
all_output = [returned_stdout or '']
proc.wait()
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def test_install_global_option_using_editable(script, tmpdir):
'install', '--global-option=--version', '-e',
'%[email protected]#egg=anyjson' % local_checkout(url, tmpdir.join("cache"))
)
assert '0.2.5\n' in result.stdout
assert 'Successfully installed anyjson' in result.stdout


@pytest.mark.network
Expand Down

0 comments on commit f893abc

Please sign in to comment.