Skip to content

Fix pre-commit job pip cache config#336

Merged
sbidoul merged 1 commit intoOCA:masterfrom
acsone:fix-pre-commit-pip-cache-sbi
Feb 24, 2026
Merged

Fix pre-commit job pip cache config#336
sbidoul merged 1 commit intoOCA:masterfrom
acsone:fix-pre-commit-pip-cache-sbi

Conversation

@sbidoul
Copy link
Member

@sbidoul sbidoul commented Feb 23, 2026

No description provided.

@sbidoul
Copy link
Member Author

sbidoul commented Feb 23, 2026

Please don't merge before testing on an affected repo. I'm not sure this is correct.

@sbidoul sbidoul force-pushed the fix-pre-commit-pip-cache-sbi branch from 0b0905f to 48c1917 Compare February 23, 2026 14:18
@sbidoul sbidoul merged commit f1cd489 into OCA:master Feb 24, 2026
8 checks passed
@sbidoul sbidoul deleted the fix-pre-commit-pip-cache-sbi branch February 24, 2026 09:01
@SirPyTech
Copy link

Here a requirements.txt would not make sense as a cache key. Since we are in pre-commit, .pre-commit-config.yaml could be a good cache key.

Right: the cache is used for the libraries installed for pre-commit's hooks so it makes more sense to use its configuration as a cache key.

I'm not really convinced that using only the hook's versions is a good cache key because that would misbehave when a dependency of the hook is changed: in a new (local) environment the new dependency would be used, but the github action would use the cached versions?
Or maybe I should just look better into how the cache works for the github action.

It makes sense to use a requirements file as a cache key because it should have all the libraries with their versions pinned but there is no such thing for pre-commit that I know of.
Maybe we shouldn't use cache at all for pre-commit?

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

Successfully merging this pull request may close these issues.

4 participants