Skip to content

Commit

Permalink
Merge pull request #11303 from vanschelven/clarify-pip-cache-output
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr authored Jul 26, 2022
2 parents c4606b3 + 80c3b96 commit 0231a1d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions news/11300.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify that ``pip cache``'s wheels-related output is about locally built wheels only.
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}
Locally built wheels location: {wheels_cache_location}
Locally built wheels size: {wheels_cache_size}
Number of locally 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
8 changes: 4 additions & 4 deletions tests/functional/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ def test_cache_info(
result = script.pip("cache", "info")

assert f"Package index page cache location: {http_cache_dir}" in result.stdout
assert f"Wheels location: {wheel_cache_dir}" in result.stdout
assert f"Locally built wheels location: {wheel_cache_dir}" in result.stdout
num_wheels = len(wheel_cache_files)
assert f"Number of wheels: {num_wheels}" in result.stdout
assert f"Number of locally built wheels: {num_wheels}" in result.stdout


@pytest.mark.usefixtures("populate_wheel_cache")
Expand Down Expand Up @@ -242,9 +242,9 @@ def test_cache_list_abspath(script: PipTestEnvironment) -> None:
@pytest.mark.usefixtures("empty_wheel_cache")
def test_cache_list_with_empty_cache(script: PipTestEnvironment) -> None:
"""Running `pip cache list` with an empty cache should print
"Nothing cached." and exit."""
"No locally built wheels cached." and exit."""
result = script.pip("cache", "list")
assert result.stdout == "Nothing cached.\n"
assert result.stdout == "No locally built wheels cached.\n"


@pytest.mark.usefixtures("empty_wheel_cache")
Expand Down

0 comments on commit 0231a1d

Please sign in to comment.