Skip to content

install: Less output on success; once on failure #2487

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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