Skip to content
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

[2020-resolver] List downloaded distributions before exiting #8709

Merged
merged 1 commit into from
Aug 17, 2020
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
3 changes: 3 additions & 0 deletions news/8696.bugfix
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 6 additions & 4 deletions src/pip/_internal/commands/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ def run(self, options, args):
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
9 changes: 0 additions & 9 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,6 @@ def __init__(
# 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

Expand Down
6 changes: 0 additions & 6 deletions src/pip/_internal/resolution/legacy/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,6 @@ def add_req(subreq, extras_requested):
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):
Expand Down