jazzband / pip-tools

A set of tools to keep your pinned Python dependencies fresh.
https://pip-tools.rtfd.io
BSD 3-Clause "New" or "Revised" License
7.69k stars 610 forks source link

Run pip-compile hook only if the requirements.in file changes. #1991

Closed bvss89 closed 11 months ago

bvss89 commented 11 months ago

What's the problem this feature will solve?

Is it possible to run pip-compile compile hook only if the requirements.in file changes ? The problem is pip-compile is consuming more time and delaying the git push.

Describe the solution you'd like

Compare the current file with the file in the git remote branch. Activate pip-compile only of there is a change.

chrysle commented 11 months ago

This should generally be possible. By default, pre-commit run only runs the hooks on staged files. What does your .pre-commit-config.yaml look like for the hook?

bvss89 commented 11 months ago

Yes its working. Thanks.