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.
This commit is contained in:
Stéphane Bidoul 2020-04-26 11:31:02 +02:00
parent 6a7bf94776
commit 88da3441ce
No known key found for this signature in database
GPG Key ID: BCAB2555446B5B92
1 changed files with 2 additions and 5 deletions

View File

@ -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: