Skip to content

Commit 88da344

Browse files
committed
Simplify _should_cache
The condition "never cache if pip install would not have built" can be simplified to "do not cache editable requirements". This is easier to read, and avoid a double warning if the 'wheel' package is not installed.
1 parent 6a7bf94 commit 88da344

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/pip/_internal/wheel_builder.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,8 @@ def _should_cache(
118118
wheel cache, assuming the wheel cache is available, and _should_build()
119119
has determined a wheel needs to be built.
120120
"""
121-
if not should_build_for_install_command(
122-
req, check_binary_allowed=_always_true
123-
):
124-
# never cache if pip install would not have built
125-
# (editable mode, etc)
121+
if req.editable or not req.source_dir:
122+
# never cache editable requirements
126123
return False
127124

128125
if req.link and req.link.is_vcs:

0 commit comments

Comments
 (0)