Skip to content

Commit

Permalink
[issue 1548] Make pip install -e uninstall existing versions
Browse files Browse the repository at this point in the history
by adding an additional call to `requirement.check_if_exists()` to
RequirementSet.install

Fixes pypaGH-1548
  • Loading branch information
msabramo committed Feb 10, 2014
1 parent 8575e0c commit f6313e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pip/req.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,10 @@ def check_if_exists(self):
return True
else:
self.satisfied_by = pkg_resources.get_distribution(self.req)

if self.editable and self.satisfied_by:
self.conflicts_with = self.satisfied_by
return True
except pkg_resources.DistributionNotFound:
return False
except pkg_resources.VersionConflict:
Expand Down Expand Up @@ -1368,6 +1372,8 @@ def install(self, install_options, global_options=(), *args, **kwargs):
# distribute wasn't installed, so nothing to do
pass

requirement.check_if_exists()

if requirement.conflicts_with:
logger.notify('Found existing installation: %s'
% requirement.conflicts_with)
Expand Down

0 comments on commit f6313e1

Please sign in to comment.