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

Two-step cache clean and prune needed to remove package from cache #6909

Closed
bluss opened this issue Sep 1, 2024 · 6 comments · Fixed by #6915
Closed

Two-step cache clean and prune needed to remove package from cache #6909

bluss opened this issue Sep 1, 2024 · 6 comments · Fixed by #6915
Assignees
Labels
bug Something isn't working

Comments

@bluss
Copy link
Contributor

bluss commented Sep 1, 2024

Removing a big package like torch or similar requires both cache clean and prune to remove it from cache. It's expected that the first clean would remove it?

uv cache clean triton
# Removed 3 files for triton (1.5KiB)
uv cache prune
# Pruning cache at: 
# Removed 316 files (553.1MiB)

uv cache clean nvidia-cudnn-cu11
# Removed 3 files for nvidia-cudnn-cu11 (1.2KiB)
uv cache prune
# Pruning cache at: 
# Removed 31 files (974.5MiB)

The packages were installed like in #6907

We can also try with another package like hatch

uvx hatch
uv cache clean hatch
# Removed 4 files for hatch (61.7KiB)
uv cache prune
# Pruning cache at: 
# Removed 1848 files (79.6MiB)

Using uv 0.4.1

@charliermarsh
Copy link
Member

No this shouldn't be required. It looks like a bug.

@weihenglim
Copy link

Not sure if this is the intended behavior, but it seems like uv cache clean <package> still leaves some dangling cache entries on Windows using the latest version:

>uv cache clean -v
DEBUG uv 0.4.2
No cache found at: C:\Users\User\AppData\Local\uv\cache

>uvx hatch --version
Installed 38 packages in 185ms <--- wow, that's confusingly fast on a cold cache
Hatch, version 1.12.0

>uv cache clean -v hatch
DEBUG uv 0.4.2
DEBUG Removing dangling cache entry: \\?\C:\Users\User\AppData\Local\uv\cache\archive-v0\zwnmKQVgeSUWVlA2QvK0E
Removed 122 files for hatch (466.2KiB)

>uv cache prune -v
DEBUG uv 0.4.2
Pruning cache at: C:\Users\User\AppData\Local\uv\cache
DEBUG Removing dangling cache entry: \\?\C:\Users\User\AppData\Local\uv\cache\environments-v1\1416b019b2dc3cb0
DEBUG Removing dangling cache entry: \\?\C:\Users\User\AppData\Local\uv\cache\archive-v0\mroAG5Am_YNe1aEo898zB
Removed 1577 files (52.2MiB)

>uv cache clean -v
DEBUG uv 0.4.2
Clearing cache at: C:\Users\User\AppData\Local\uv\cache
Removed 1395 files (53.8MiB)

@charliermarsh
Copy link
Member

Should be fixed in the linked PR.

@weihenglim
Copy link

The above was tested on v0.4.2, was the PR not included in that release?

@charliermarsh
Copy link
Member

Sorry, it was but what you’re seeing isn’t the same thing. We remove all ephemeral environments when you prune. That will also remove other dependencies besides hatch.

@weihenglim
Copy link

Ah gotcha, so uv cache clean hatch will only remove hatch but not it's dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants