Skip to content

Commit f6313e1

Browse files
committed
[issue 1548] Make pip install -e uninstall existing versions
by adding an additional call to `requirement.check_if_exists()` to RequirementSet.install Fixes pypaGH-1548
1 parent 8575e0c commit f6313e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pip/req.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,10 @@ def check_if_exists(self):
801801
return True
802802
else:
803803
self.satisfied_by = pkg_resources.get_distribution(self.req)
804+
805+
if self.editable and self.satisfied_by:
806+
self.conflicts_with = self.satisfied_by
807+
return True
804808
except pkg_resources.DistributionNotFound:
805809
return False
806810
except pkg_resources.VersionConflict:
@@ -1368,6 +1372,8 @@ def install(self, install_options, global_options=(), *args, **kwargs):
13681372
# distribute wasn't installed, so nothing to do
13691373
pass
13701374

1375+
requirement.check_if_exists()
1376+
13711377
if requirement.conflicts_with:
13721378
logger.notify('Found existing installation: %s'
13731379
% requirement.conflicts_with)

0 commit comments

Comments
 (0)