diff options
-rw-r--r-- | news/8696.bugfix | 3 | ||||
-rw-r--r-- | src/pip/_internal/commands/download.py | 10 | ||||
-rw-r--r-- | src/pip/_internal/req/req_install.py | 9 | ||||
-rw-r--r-- | src/pip/_internal/resolution/legacy/resolver.py | 6 |
4 files changed, 9 insertions, 19 deletions
diff --git a/news/8696.bugfix b/news/8696.bugfix new file mode 100644 index 000000000..989d2d029 --- /dev/null +++ b/news/8696.bugfix @@ -0,0 +1,3 @@ +List downloaded distributions before exiting ``pip download`` +when using the new resolver to make the behavior the same as +that on the legacy resolver. diff --git a/src/pip/_internal/commands/download.py b/src/pip/_internal/commands/download.py index 46e837126..0861d9e67 100644 --- a/src/pip/_internal/commands/download.py +++ b/src/pip/_internal/commands/download.py @@ -134,10 +134,12 @@ class DownloadCommand(RequirementCommand): reqs, check_supported_wheels=True ) - downloaded = ' '.join([req.name # type: ignore - for req in requirement_set.requirements.values() - if req.successfully_downloaded]) + downloaded = [] # type: List[str] + for req in requirement_set.requirements.values(): + if not req.editable and req.satisfied_by is None: + assert req.name is not None + downloaded.append(req.name) if downloaded: - write_output('Successfully downloaded %s', downloaded) + write_output('Successfully downloaded %s', ' '.join(downloaded)) return SUCCESS diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py index 816969f8e..907c40249 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py @@ -179,15 +179,6 @@ class InstallRequirement(object): # e.g. dependencies, extras or constraints. self.user_supplied = user_supplied - # Set by the legacy resolver when the requirement has been downloaded - # TODO: This introduces a strong coupling between the resolver and the - # requirement (the coupling was previously between the resolver - # and the requirement set). This should be refactored to allow - # the requirement to decide for itself when it has been - # successfully downloaded - but that is more tricky to get right, - # se we are making the change in stages. - self.successfully_downloaded = False - self.isolated = isolated self.build_env = NoOpBuildEnvironment() # type: BuildEnvironment diff --git a/src/pip/_internal/resolution/legacy/resolver.py b/src/pip/_internal/resolution/legacy/resolver.py index a743b5696..d2dafa77f 100644 --- a/src/pip/_internal/resolution/legacy/resolver.py +++ b/src/pip/_internal/resolution/legacy/resolver.py @@ -444,12 +444,6 @@ class Resolver(BaseResolver): for subreq in dist.requires(available_requested): add_req(subreq, extras_requested=available_requested) - if not req_to_install.editable and not req_to_install.satisfied_by: - # XXX: --no-install leads this to report 'Successfully - # downloaded' for only non-editable reqs, even though we took - # action on them. - req_to_install.successfully_downloaded = True - return more_reqs def get_installation_order(self, req_set): |