Skip to content

Commit 59ff7ed

Browse files
committed
Revise locally available dist reinstallation logic
Any direct URL pointing to somewhere on the local filesystem is now automatically reinstalled.
1 parent 9f9b85b commit 59ff7ed

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ def _get_ireq(
7272
candidate: Candidate,
7373
direct_url_requested: bool,
7474
) -> Optional[InstallRequirement]:
75+
"""Get the InstallRequirement to install for a candidate.
76+
77+
Returning None means the candidate is already satisfied by the current
78+
environment state and does not need to be handled.
79+
"""
7580
ireq = candidate.get_install_requirement()
7681

7782
# No ireq to install (e.g. extra-ed candidate). Skip.
@@ -111,10 +116,8 @@ def _get_ireq(
111116
# Determine whether to upgrade based on flags and whether the installed
112117
# distribution was done via a direct URL.
113118

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:
119+
# Always reinstall a direct candidate if it's on the local file system.
120+
if cand_link.is_file:
118121
return ireq
119122

120123
# Reinstall if --upgrade is specified.

0 commit comments

Comments
 (0)