python-project-template icon indicating copy to clipboard operation
python-project-template copied to clipboard

Enable pip caching for setup-python action?

Open hombit opened this issue 1 year ago • 1 comments

The setup-python action supports caching of the global pip directory, so packages are not re-downloaded. We can enable it with with: cache: 'pip'. See the documentation here.

I’m not sure if it would speed up the pipelines. I propose we test it with one of our projects first.

hombit avatar Oct 14 '24 14:10 hombit

Definitely worth trying. I suspect our images are wiped prior to each run in github actions CI, and that this would not affect CI times.

If we somehow have the ability to override where the pip cache is, and can point to some common location we might be able to make this work in a wiped CI environment.

This exists, and covers the right directories to be of use for pip. https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows

mtauraso avatar Oct 25 '24 18:10 mtauraso

Switching to use uv pip instead, which does its own caching pretty well.

https://github.com/lincc-frameworks/python-project-template/issues/541

delucchi-cmu avatar Oct 23 '25 20:10 delucchi-cmu