Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify pip cache output #11303

Merged
merged 4 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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