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

Conversation

vanschelven
Copy link
Contributor

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.

Fixes #11300

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.
Copy link
Member

@pfmoore pfmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to fix the tests, but in principle this seems reasonable to me.

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could even maybe use "locally built wheels" everywhere.

Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming CI is green, LGTM.

@vanschelven
Copy link
Contributor Author

You could even maybe use "locally built wheels" everywhere.

I was already doubting between "locally built" and "built" with the former being more explicit and clear and the latter being more brief. On second thought, brevity isn't really a consideration here if you look at the surrounding lines, i.e. "Package index page cache location:" is still longer than the longest line with "locally built wheels" would be, and given that we have a +1 on "locally built" I'll adapt accordingly.

@uranusjr uranusjr merged commit 0231a1d into pypa:main Jul 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pip cache reports "Nothing cached" and "Number of wheels: 0" even when wheels are obviously cached
5 participants