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

[WIP] Add a pip cache command to inspect the wheel cache #3146

Closed
wants to merge 13 commits into from

Conversation

xavfernandez
Copy link
Member

@xavfernandez xavfernandez commented Sep 28, 2015

  • adds a link origin file in the cache.

  • allows easy inspection of the wheel cache based on project names/version/last access.

    $ pip cache pillow
    Pillow
    - Pillow-2.8.1-cp27-none-linux_x86_64.whl
    Path: /home/xfernandez/.cache/pip/wheels/09/e3/46/5e1de20caea1bd97572a0f5adc46035689968d431270cd3397
    Size: 738.5kb - Last used: 2015-09-10 11:03:56.129241
    - Pillow-2.8.1-cp27-none-linux_x86_64.whl
    Path: /home/xfernandez/.cache/pip/wheels/16/63/c0/dc73f54d7c60d456272a53eef658d97dc2169d9aebcf4715b3
    Size: 738.5kb - Last used: 2015-09-25 14:56:28.608873
    - Pillow-2.8.2-cp27-none-linux_x86_64.whl
    Path: /home/xfernandez/.cache/pip/wheels/1b/60/09/4ec74277e8ebecb5461975edbd67082c4d4aafea8a5a2b0c6a
    Size: 738.8kb - Last used: 2015-06-30 15:39:50.618568
    - Pillow-2.9.0-cp34-cp34m-linux_x86_64.whl
    Path: /home/xfernandez/.cache/pip/wheels/7f/eb/5f/896eeaff26a20503359b552fac8b95bdde75fb97155d7935a3
    Size: 745.6kb - Last used: 2015-08-06 15:46:51.521417
    - Pillow-2.9.0-cp27-none-linux_x86_64.whl
    Path: /home/xfernandez/.cache/pip/wheels/7f/eb/5f/896eeaff26a20503359b552fac8b95bdde75fb97155d7935a3
    Size: 746.4kb - Last used: 2015-08-05 11:27:19.277327
    - Pillow-2.9.0-cp27-none-linux_x86_64.whl
    Path: /home/xfernandez/.cache/pip/wheels/95/68/ee/d6bddb5ea19b8cbe3e495fee8fb021f761596500bd5adb6956
    Original link: https://pypi.example.com/root/pypi/+f/cd4/e6286fb28e277/Pillow-2.9.0.zip#md5=cd4e6286fb28e277954c011c3ce05bc4
    Size: 746.4kb - Last used: 2015-09-28 10:07:30.812787

  • allows easy cleanup of old version or not used in a long time cached files

    $ pip cache "pillow<2.9" --not-accessed-since=60 --remove
    Deleting:

    • /home/xfernandez/.cache/pip/wheels/1b/60/09/4ec74277e8ebecb5461975edbd67082c4d4aafea8a5a2b0c6a/Pillow-2.8.2-cp27-none-linux_x86_64.whl
      Proceed (yes/no)?

Still work in progress but already useful (at least for me), feedback is welcome.

Review on Reviewable

@xavfernandez xavfernandez force-pushed the cache_infos branch 2 times, most recently from de1ff65 to f809072 Compare October 3, 2015 14:41
@xavfernandez xavfernandez deleted the cache_infos branch October 5, 2015 21:54
@xavfernandez xavfernandez restored the cache_infos branch October 5, 2015 21:55
@xavfernandez xavfernandez reopened this Oct 8, 2015
@techtonik
Copy link
Contributor

From pip cache I need only three things:

  1. turn it off easily forever
  2. always know how much gigabytes it eats
  3. drop the cache easily

These are things that I expect to be present by default. Everything else looks looks like an extra featurecreep to me.

@xavfernandez
Copy link
Member Author

turn it off easily forever

cache-dir = false

in pip.conf should already do it in pip 7

always know how much gigabytes it eats

pip cache --summary would print it

drop the cache easily

pip cache --remove would do it

Everything else looks looks like an extra featurecreep to me.

What features ? Filtering on a package/version and last access time ?

@techtonik
Copy link
Contributor

These features - cache filtering, inspection and the cache at a whole - look like a plugin functionality to pip. By the way, there are already two options that add to the mess.

  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.

If --cache-dir can be false, then --no-cache-dir can be deprecated.

Also, I still don't remember if pip tells that it uses and used versions from the cache.
Also, I don't remember if pip still checks for latest versions when reusing stuff from cache.

It seems to me that the pip is reusing stale cache versions, which was a major nuisance for me in the past.

@dstufft dstufft closed this May 18, 2016
@dstufft
Copy link
Member

dstufft commented May 18, 2016

Accidentally closed this, reopening. Sorry!

@dstufft dstufft reopened this May 18, 2016
@BrownTruck
Copy link
Contributor

Hello!

As part of an effort to ease the contribution process and adopt a more standard workflow pip has switched to doing development on the master branch. However, this Pull Request was made against the develop branch so it will need to be resubmitted against master.

If you do nothing, this Pull Request will be automatically migrated by @BrownTruck for you.

If you would like to retain control over this pull request then you should resubmit it against the master branch, closing and referencing the original Pull Request.

If you choose to migrate this Pull Request yourself, here is an example message that you can copy and paste:

adds a link origin file in the cache.

allows easy inspection of the wheel cache based on project names/version/last access.

$ pip cache pillow
Pillow
    - Pillow-2.8.1-cp27-none-linux_x86_64.whl
      Path: /home/xfernandez/.cache/pip/wheels/09/e3/46/5e1de20caea1bd97572a0f5adc46035689968d431270cd3397
      Size: 738.5kb - Last used: 2015-09-10 11:03:56.129241
    - Pillow-2.8.1-cp27-none-linux_x86_64.whl
      Path: /home/xfernandez/.cache/pip/wheels/16/63/c0/dc73f54d7c60d456272a53eef658d97dc2169d9aebcf4715b3
      Size: 738.5kb - Last used: 2015-09-25 14:56:28.608873
    - Pillow-2.8.2-cp27-none-linux_x86_64.whl
      Path: /home/xfernandez/.cache/pip/wheels/1b/60/09/4ec74277e8ebecb5461975edbd67082c4d4aafea8a5a2b0c6a
      Size: 738.8kb - Last used: 2015-06-30 15:39:50.618568
    - Pillow-2.9.0-cp34-cp34m-linux_x86_64.whl
      Path: /home/xfernandez/.cache/pip/wheels/7f/eb/5f/896eeaff26a20503359b552fac8b95bdde75fb97155d7935a3
      Size: 745.6kb - Last used: 2015-08-06 15:46:51.521417
    - Pillow-2.9.0-cp27-none-linux_x86_64.whl
      Path: /home/xfernandez/.cache/pip/wheels/7f/eb/5f/896eeaff26a20503359b552fac8b95bdde75fb97155d7935a3
      Size: 746.4kb - Last used: 2015-08-05 11:27:19.277327
    - Pillow-2.9.0-cp27-none-linux_x86_64.whl
      Path: /home/xfernandez/.cache/pip/wheels/95/68/ee/d6bddb5ea19b8cbe3e495fee8fb021f761596500bd5adb6956
      Original link: https://pypi.example.com/root/pypi/+f/cd4/e6286fb28e277/Pillow-2.9.0.zip#md5=cd4e6286fb28e277954c011c3ce05bc4
      Size: 746.4kb - Last used: 2015-09-28 10:07:30.812787


allows easy cleanup of old version or not used in a long time cached files

$ pip cache "pillow<2.9" --not-accessed-since=60 --remove
Deleting:


/home/xfernandez/.cache/pip/wheels/1b/60/09/4ec74277e8ebecb5461975edbd67082c4d4aafea8a5a2b0c6a/Pillow-2.8.2-cp27-none-linux_x86_64.whl
Proceed (yes/no)?




Still work in progress but already useful (at least for me), feedback is welcome.

---

*This was migrated from pypa/pip#3146 to reparent it to the ``master`` branch. Please see original pull request for any previous discussion.*

If this pull request is no longer needed, please feel free to close it.

@astrojuanlu
Copy link
Contributor

I would love to see this merged.

@BrownTruck
Copy link
Contributor

This Pull Request has been automatically migrated to #3734 to reparent it to the master branch. Please see the new pull request for any new discussion.

@BrownTruck BrownTruck closed this May 26, 2016
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants