Skip to content

Commit e638e24

Browse files
committed
do not repeat tests in should_cache
1 parent aaa4237 commit e638e24

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/pip/_internal/wheel.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -816,10 +816,11 @@ def should_cache(
816816
wheel cache, assuming the wheel cache is available, and should_build()
817817
has determined a wheel needs to be built.
818818
"""
819-
if req.editable or not req.source_dir:
820-
return False
821-
822-
if not check_binary_allowed(req):
819+
if not should_build(
820+
req, need_wheel=False, check_binary_allowed=check_binary_allowed
821+
):
822+
# never cache if pip install (need_wheel=False) would not have built
823+
# (editable mode, etc)
823824
return False
824825

825826
if req.link and req.link.is_vcs:

0 commit comments

Comments
 (0)