Skip to content

Commit

Permalink
Clarify pip cache output
Browse files Browse the repository at this point in the history
pip cache reported 'Nothing cached' and 'Number of wheels: 0' even when things were
obviously cached. The reason, as per @uranusjr's comment is

1. If a wheel is downloaded (from a secure source), pip uses the network layer
   cache (provided by a requests extension implemented with cachecontrol) in
   ${CACHE_DIR}/http.
2. If a wheel is built from source, pip caches it separately in ${CACHE_DIR}/wheels.
3. The pip cache list command is currently only capable of showing entries in
   the wheel cache, not the network cache.

The solution is to clarify what `pip cache` is reporting about.
  • Loading branch information
vanschelven committed Jul 25, 2022
1 parent c4606b3 commit 906b877
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pip/_internal/commands/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ def get_cache_info(self, options: Values, args: List[Any]) -> None:
Package index page cache location: {http_cache_location}
Package index page cache size: {http_cache_size}
Number of HTTP files: {num_http_files}
Wheels location: {wheels_cache_location}
Wheels size: {wheels_cache_size}
Number of wheels: {package_count}
Built wheels location: {wheels_cache_location}
Built wheels size: {wheels_cache_size}
Number of built wheels: {package_count}
"""
)
.format(
Expand Down Expand Up @@ -140,7 +140,7 @@ def list_cache_items(self, options: Values, args: List[Any]) -> None:

def format_for_human(self, files: List[str]) -> None:
if not files:
logger.info("Nothing cached.")
logger.info("No locally built wheels cached.")
return

results = []
Expand Down

0 comments on commit 906b877

Please sign in to comment.