diff options
author | Pradyun Gedam <pradyunsg@users.noreply.github.com> | 2020-11-19 15:39:00 +0000 |
---|---|---|
committer | Pradyun Gedam <pradyunsg@users.noreply.github.com> | 2020-11-25 14:12:08 +0000 |
commit | ce46a5e36d0ed3499c38df3bedf4ac4eb1ed9bc2 (patch) | |
tree | 7858c15f6f13c2314a30bc7c8b791dadfd510962 /src/pip/_internal | |
parent | 84382715f05e89b3f12d6c2b74bf72e0d701103c (diff) | |
download | pip-ce46a5e36d0ed3499c38df3bedf4ac4eb1ed9bc2.tar.gz |
Re-install local candidates unconditionally
Signed-off-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
Diffstat (limited to 'src/pip/_internal')
-rw-r--r-- | src/pip/_internal/resolution/resolvelib/resolver.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pip/_internal/resolution/resolvelib/resolver.py b/src/pip/_internal/resolution/resolvelib/resolver.py index e2e164d12..6290d2fe3 100644 --- a/src/pip/_internal/resolution/resolvelib/resolver.py +++ b/src/pip/_internal/resolution/resolvelib/resolver.py @@ -132,15 +132,19 @@ class Resolver(BaseResolver): # Check if there is already an installation under the same name, # and set a flag for later stages to uninstall it, if needed. - # * There isn't, good -- no uninstalltion needed. + # + # * There is no existing installation. Nothing to uninstall. + # * The candidate is a local path/file. Always reinstall. # * The --force-reinstall flag is set. Always reinstall. # * The installation is different in version or editable-ness, so # we need to uninstall it to install the new distribution. # * The installed version is the same as the pending distribution. - # Skip this distrubiton altogether to save work. + # Skip this distribution altogether to save work. installed_dist = self.factory.get_dist_to_uninstall(candidate) if installed_dist is None: ireq.should_reinstall = False + elif candidate.source_link.is_file: + ireq.should_reinstall = True elif self.factory.force_reinstall: ireq.should_reinstall = True elif installed_dist.parsed_version != candidate.version: |