Skip to content

Commit

Permalink
Revise locally available dist reinstallation logic
Browse files Browse the repository at this point in the history
A PEP-508 file:// requirement pointing to a wheel is not longer
automatically reinstalled. But an sdist from file://, or anything
specifed by a path will automatically be reinstalled.
  • Loading branch information
uranusjr committed Nov 18, 2021
1 parent 9f9b85b commit 5387547
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pip/_internal/resolution/resolvelib/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ def _get_ireq(
# Determine whether to upgrade based on flags and whether the installed
# distribution was done via a direct URL.

# Always reinstall an incoming wheel candidate on the local filesystem.
# This is quite fast anyway, and we can avoid drama when users want
# their in-development direct URL requirement automatically reinstalled.
if cand_link.is_file and cand_link.is_wheel:
# Always reinstall a direct URL on the file system if it's not specified
# with PEP 508. This avoids drama when users want their in-development
# requirement automatically reinstalled.
if cand_link.is_file and (ireq.req is None or ireq.req.url is None):
return ireq

# Reinstall if --upgrade is specified.
Expand Down

0 comments on commit 5387547

Please sign in to comment.