cibuildwheel icon indicating copy to clipboard operation
cibuildwheel copied to clipboard

Cache clean command

Open joerick opened this issue 7 months ago • 2 comments

One follow-up that I think I could take on here is to add a utility command around this the cache directory – it would be nice to have something like cibuildwheel cache clean (similar to uv cache clean) or cibuildwheel cache purge (similar to pip cache purge) – if y'all agree to this, of course. Currently, emsdk installed through takes 1.52 GiB on my machine and the pyodide venv is another 200 MiB, and as these are buried within the platformdirs cache location, I have to go there and manually delete these files. It doesn't bother me too much: while cibuildwheel can be executed locally, the "ci" in the name does mean that not everyone will run into this locally. :) Would you be open to this idea?

P.S. It would be pretty useful if platformdirs were to have a cache-clear command of its own, too, but I won't open an issue in their tracker just yet :)

Originally posted by @agriyakhetarpal in https://github.com/pypa/cibuildwheel/issues/2002#issuecomment-2881739071

joerick avatar May 16 '25 10:05 joerick

I think this is a nice idea. I wouldn't say it needs to be part of platformdirs, it's more on the application itself to manage its storage dirs.

Regarding command line option, cibuildwheel cache clean would be tricky because cache would be interpreted as a project dir. We already have --print-build-identifiers as a subcommand, I think --clean-cache or similar would work.

joerick avatar May 16 '25 10:05 joerick

I wouldn't say it needs to be part of platformdirs, it's more on the application itself to manage its storage dirs.

Yes, platformdirs is already minimal, serves a specific purpose, and I don't think they wouldn't like to change that either :)

Regarding command line option, cibuildwheel cache clean would be tricky because cache would be interpreted as a project dir. We already have --print-build-identifiers as a subcommand, I think --clean-cache or similar would work.

Sounds good to me!

agriyakhetarpal avatar May 16 '25 10:05 agriyakhetarpal