Skip to content

Commit

Permalink
do not repeat tests in should_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Oct 27, 2019
1 parent 1283a30 commit 34148bf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pip/_internal/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,10 +815,11 @@ def should_cache(
wheel cache, assuming the wheel cache is available, and should_build()
has determined a wheel needs to be built.
"""
if req.editable or not req.source_dir:
return False

if not check_binary_allowed(req):
if not should_build(
req, need_wheel=False, check_binary_allowed=check_binary_allowed
):
# never cache if pip install (need_wheel=False) would not have built
# (editable mode, etc)
return False

if req.link and req.link.is_vcs:
Expand Down

0 comments on commit 34148bf

Please sign in to comment.