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

Add a hatch cache command to manage cached data #1457

Open
pfmoore opened this issue May 2, 2024 · 1 comment
Open

Add a hatch cache command to manage cached data #1457

pfmoore opened this issue May 2, 2024 · 1 comment

Comments

@pfmoore
Copy link
Member

pfmoore commented May 2, 2024

Hatch caches data on behalf of the user. This idea came up when discussing environments created as part of hatch run <script>. I don't know if there is other cached data that could benefit from this command, but the following could be useful for managing script environments.

This list is a bit "off the top of my head" - I can think of use cases for all of these, but there may be other possibilities as well, or there may be better ways of structuring the subcommands.

  • hatch cache dir - print the location of the cache directory.
  • hatch cache prune - remove cached environments that relate to scripts that no longer exist on disk.
  • hatch cache purge - remove all cached environments, forcing them to be recreated when next needed.
  • hatch cache find <script> - print the location of the environment directory for <script>.
  • hatch cache list - list the contents of the cache (environment directory, associated script, disk space used).

This is modeled after the functionality provided by the uv cache and pip cache commands.

@pfmoore
Copy link
Member Author

pfmoore commented May 3, 2024

I've been experimenting with environments - and specifically with not storing environments in the project directory (which is my normal preference). All of the commands proposed above would be equally useful for project environments, as well as for script environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant