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

Docs say cache is $HOME/Library/Caches/uv but that may not be correct #8626

Closed
simonw opened this issue Oct 28, 2024 · 3 comments
Closed

Docs say cache is $HOME/Library/Caches/uv but that may not be correct #8626

simonw opened this issue Oct 28, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@simonw
Copy link
Contributor

simonw commented Oct 28, 2024

The docs here:

uv/docs/reference/cli.md

Lines 90 to 92 in be92a2b

</dd><dt><code>--cache-dir</code> <i>cache-dir</i></dt><dd><p>Path to the cache directory.</p>
<p>Defaults to <code>$HOME/Library/Caches/uv</code> on macOS, <code>$XDG_CACHE_HOME/uv</code> or <code>$HOME/.cache/uv</code> on Linux, and <code>%LOCALAPPDATA%\uv\cache</code> on Windows.</p>

Say that the cache directory...

Defaults to $HOME/Library/Caches/uv on macOS

But... I had a look on my Mac in ~/Library/Caches and there was no uv folder.

What I did find was this:

/Users/simon/Library/Caches/com.apple.python/Users/simon/Library/Caches/uv

So either the documentation here needs updating or there's some kind of weird bug going on, or I'm missing something else.

@simonw
Copy link
Contributor Author

simonw commented Oct 28, 2024

I found what looks to be the real uv cache directory here:

/Users/simon/.cache/uv

That weird com.apple.python one turned out to be mostly empty:

find /Users/simon/Library/Caches/com.apple.python/Users/simon/Library/Caches/uv
/Users/simon/Library/Caches/com.apple.python/Users/simon/Library/Caches/uv
/Users/simon/Library/Caches/com.apple.python/Users/simon/Library/Caches/uv/archive-v0
/Users/simon/Library/Caches/com.apple.python/Users/simon/Library/Caches/uv/archive-v0/0VSKRv7KPsU6OVxKhRKyA
/Users/simon/Library/Caches/com.apple.python/Users/simon/Library/Caches/uv/archive-v0/0VSKRv7KPsU6OVxKhRKyA/lib
/Users/simon/Library/Caches/com.apple.python/Users/simon/Library/Caches/uv/archive-v0/0VSKRv7KPsU6OVxKhRKyA/lib/python3.9
/Users/simon/Library/Caches/com.apple.python/Users/simon/Library/Caches/uv/archive-v0/0VSKRv7KPsU6OVxKhRKyA/lib/python3.9/site-packages
/Users/simon/Library/Caches/com.apple.python/Users/simon/Library/Caches/uv/archive-v0/0VSKRv7KPsU6OVxKhRKyA/lib/python3.9/site-packages/_virtualenv.cpython-39.pyc

This one was VERY full:

find /Users/simon/.cache/uv | wc -l
  127275
du -h ~/.cache/uv | tail -n 1
3.7G	/Users/simon/.cache/uv

@zanieb
Copy link
Member

zanieb commented Oct 28, 2024

We switched to XDG in #5806 — looks like we forgot to update this doc. It can be there for backwards compatibility reasons, but new installs use the XDG standard location.

@zanieb zanieb added documentation Improvements or additions to documentation good first issue Good for newcomers labels Oct 28, 2024
@simonw
Copy link
Contributor Author

simonw commented Oct 28, 2024

Also useful (for other people exploring this):

uv cache dir

On my machine outputs:

/Users/simon/.cache/uv

simonw added a commit to simonw/uv that referenced this issue Oct 28, 2024
charliermarsh added a commit that referenced this issue Oct 28, 2024
Refs:
- #8626

## Summary

Current documentation incorrectly suggests that the macOS cache
directory location is `$HOME/Library/Caches/uv`, but that changed in:

- #5806

Updates docs to say this instead:

> <p>Defaults to <code>$HOME/.cache/uv</code> on macOS,
<code>$XDG_CACHE_HOME/uv</code> or <code>$HOME/.cache/uv</code> on
Linux, and <code>%LOCALAPPDATA%\uv\cache</code> on Windows. The <code>uv
cache dir</code> command will show the location of the cache
directory.</p>

---------

Co-authored-by: Charlie Marsh <[email protected]>
@zanieb zanieb closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants