1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Don't use conflicts_with in logging

InstallRequirement.uninstall doesn't actually use conflicts_with, so
don't log it. Instead we output the requirement name so we still have
something that looks like a heading before indenting the log, and log
what we actually uninstall inside the function.

This will also enable us to get rid of conflicts_with.
This commit is contained in:
Chris Hunt 2019-12-04 22:43:33 -05:00
parent 128a8b3b5a
commit 331716a439
2 changed files with 3 additions and 4 deletions

View file

@ -58,10 +58,7 @@ def install_given_reqs(
with indent_log():
for requirement in to_install:
if requirement.conflicts_with:
logger.info(
'Found existing installation: %s',
requirement.conflicts_with,
)
logger.info('Attempting uninstall: %s', requirement.name)
with indent_log():
uninstalled_pathset = requirement.uninstall(
auto_confirm=True

View file

@ -695,6 +695,8 @@ class InstallRequirement(object):
except pkg_resources.DistributionNotFound:
logger.warning("Skipping %s as it is not installed.", self.name)
return None
else:
logger.info('Found existing installation: %s', dist)
uninstalled_pathset = UninstallPathSet.from_dist(dist)
uninstalled_pathset.remove(auto_confirm, verbose)