Skip to content

Commit 5387547

Browse files
committed
Revise locally available dist reinstallation logic
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.
1 parent 9f9b85b commit 5387547

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pip/_internal/resolution/resolvelib/resolver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ def _get_ireq(
111111
# Determine whether to upgrade based on flags and whether the installed
112112
# distribution was done via a direct URL.
113113

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

120120
# Reinstall if --upgrade is specified.

0 commit comments

Comments
 (0)