Skip to content

Commit

Permalink
Move conflict warning to just-before success message
Browse files Browse the repository at this point in the history
This is a much better location for these errors, since they're in a much
more visible spot. We've had reports in the past of users missing these
messages, and changing where we present these warnings should help
resolve that issue.

We do lose the ability for an advanced user to potentially see the
warning and abort installation before the conflicts are introduced, but
given that we don't even pause for input, I don't think that's a strong
argument and neither do I view this as necessary.
  • Loading branch information
pradyunsg committed Jul 16, 2020
1 parent de741fa commit eafbec5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pip/_internal/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,13 @@ def run(self, options, args):
)

# Check for conflicts in the package set we're installing.
conflicts = None # type: Optional[ConflictDetails]
should_warn_about_conflicts = (
not options.ignore_dependencies and
options.warn_about_conflicts
)
if should_warn_about_conflicts:
conflicts = self._determine_conflicts(to_install)
self._warn_about_conflicts(conflicts)

# Don't warn about script install locations if
# --target has been specified
Expand Down Expand Up @@ -421,6 +421,10 @@ def run(self, options, args):
except Exception:
pass
items.append(item)

if conflicts is not None:
self._warn_about_conflicts(conflicts)

installed_desc = ' '.join(items)
if installed_desc:
write_output(
Expand Down

0 comments on commit eafbec5

Please sign in to comment.