- Consistently use singular 'cache' (not plural 'caches').
- Remove unnecessary uses of the word 'currently'.
- Use 'file(s)' instead of 'files', to account for case of only one file.
- Use .format() when appropriate.
- Minor cleanup of `pip cache`-related files in docs/.
The lifetime of the requirement tracker will be essentially the same,
but now we have more flexibility on where in the code we create it.
In a followup we can do the same thing with build_dir and remove the
`with` statement (and its indentation) entirely from these commands.
Since a recent refactoring of our temporary directory handling,
`no_clean` is only read prior to these `except` blocks. Since it's not
needed, remove it!
This makes the resolver interface simpler by returning a brand new
RequirementSet vs mutating the one that was input to the function, and
will let us specialize RequirementSet for the different use cases.
This mirrors the current logic within the individual requirement-related
commands (install, wheel) for setting options.no_clean, which is used to
determine whether we need to delete directories.
Next, we'll add the actual directories to track and remove them from
being managed by other objects.
_should_cache is only called by _get_cache_dir.
In pip install mode, _get_cache_dir is never called when
check_binary_allowed returns False because in that case
should_build_for_install_command has returned False before
and the build was skipped.
In pip wheel mode, check_binary_allowed always returns True
(because it is not passed to the build function).
So _should_cache can use _always_true for check_binary_allowed.
*Alternative*
Alternatively, we could have passed check_binary_allowed
to build in pip wheel mode. The only difference is that wheels built
locally from *legacy* packages would then not be cached,
when pip wheel is used with --no-binary.
This is the standard type used by packaging.tags. Making this change
throughout the code lets us start switching over to using its
tag-generating functions in get_supported().
We also get rid of a test, since it was superseded by `__str__` in
packaging.tags.Tag.