Skip to content

Commit 67ab116

Browse files
authored
Merge pull request #8861 from pradyunsg/nicer-output-try-1
2 parents e61bb61 + 0fc1044 commit 67ab116

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

news/8861.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Tweak the output during dependency resolution in the new resolver.

src/pip/_internal/operations/prepare.py

+17-5
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ def __init__(
357357
# Memoized downloaded files, as mapping of url: (path, mime type)
358358
self._downloaded = {} # type: Dict[str, Tuple[str, str]]
359359

360+
# Previous "header" printed for a link-based InstallRequirement
361+
self._previous_requirement_header = ("", "")
362+
360363
@property
361364
def _download_should_save(self):
362365
# type: () -> bool
@@ -373,12 +376,21 @@ def _download_should_save(self):
373376

374377
def _log_preparing_link(self, req):
375378
# type: (InstallRequirement) -> None
376-
"""Log the way the link prepared."""
377-
if req.link.is_file:
378-
path = req.link.file_path
379-
logger.info('Processing %s', display_path(path))
379+
"""Provide context for the requirement being prepared."""
380+
if req.link.is_file and not req.original_link_is_in_wheel_cache:
381+
message = "Processing %s"
382+
information = str(display_path(req.link.file_path))
380383
else:
381-
logger.info('Collecting %s', req.req or req)
384+
message = "Collecting %s"
385+
information = str(req.req or req)
386+
387+
if (message, information) != self._previous_requirement_header:
388+
self._previous_requirement_header = (message, information)
389+
logger.info(message, information)
390+
391+
if req.original_link_is_in_wheel_cache:
392+
with indent_log():
393+
logger.info("Using cached %s", req.link.filename)
382394

383395
def _get_download_dir(self, link):
384396
# type: (Link) -> Optional[str]

0 commit comments

Comments
 (0)