Skip to content

Fix for #770: pip install -U shouldn't look at pypi if not needed #771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pip/req.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,9 @@ def locate_files(self):
#don't uninstall conflict if user install and and conflict is not user install
if not (self.use_user_site and not dist_in_usersite(req_to_install.satisfied_by)):
req_to_install.conflicts_with = req_to_install.satisfied_by
req_to_install.satisfied_by = None
#don't install if this exact requirement is already installed
if not (self.satisfied_by.version == req_to_install.version):
req_to_install.satisfied_by = None
else:
install_needed = False
if req_to_install.satisfied_by:
Expand Down Expand Up @@ -954,7 +956,9 @@ def prepare_files(self, finder, force_root_egg_info=False, bundle=False):
if not self.ignore_installed and not req_to_install.editable:
req_to_install.check_if_exists()
if req_to_install.satisfied_by:
if self.upgrade:
# check if we are upgrading and that we don't already have
# an exact version match
if self.upgrade and not (req_to_install.satisfied_by.as_requirement() == req_to_install.req):
if not self.force_reinstall and not req_to_install.url:
try:
url = finder.find_requirement(
Expand Down