Enable pip caching for setup-python action?
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.
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
Switching to use uv pip instead, which does its own caching pretty well.
https://github.com/lincc-frameworks/python-project-template/issues/541