Skip to content

Commit

Permalink
Simplify _should_cache
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sbidoul committed Apr 26, 2020
1 parent 6a7bf94 commit 88da344
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/pip/_internal/wheel_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,8 @@ def _should_cache(
wheel cache, assuming the wheel cache is available, and _should_build()
has determined a wheel needs to be built.
"""
if not should_build_for_install_command(
req, check_binary_allowed=_always_true
):
# never cache if pip install would not have built
# (editable mode, etc)
if req.editable or not req.source_dir:
# never cache editable requirements
return False

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

0 comments on commit 88da344

Please sign in to comment.