You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One might have a dev_requirements file specifying linter for CI jobs that are also used by pre-commit hooks. It would be great if pip-compile could not only create/update the requirements.tx file, but also the .pre-commit-config.yaml file to not have a mismatch on black for example.
Describe the solution you'd like
pip-compile would check if it finds some pre-commit config file, a path might be passed as extra args if preferred.
It would extract the libraries used in pre-commit and their version
It would check for the libraries to be found in the requirements.txt or setup.py and it will make sure that the version outcome is reflected in the pre-commit config file
For example, if the pre-commit config file has the following content:
repos:
- repo: https://github.com/psf/black
rev: 21.4b0
hooks:
- id: black
And dev_requirements.in the following:
black
Then we would have dev_requirements.txt with
black==21.6b0
And in .pre-commit-config.yaml
rev: 21.6b0
I'm not sure if this should be a plugin, but as pre-commit is so much used in pip-tools itself and is turning a de facto standard I think it could make sense to have directly integrated to pip-compile.
Should it be enabled by default? I would say yes, but it could be an option to be enabled, possibly by passing the config file path as argument.
Another possibility would be a pre-commit plugin, but I tend to think it should be added to pip-compile directly...
The text was updated successfully, but these errors were encountered:
@asottile maybe you have an opinion on this? If you think it is a nice addition and give me in indication how to add/integrate this ideally, I could try to work on this somewhen this summer...
This would be a really nice feature to have. So much so that I wrote my own pre-commit plugin piptools-sync. Meant to be a stop-gap before a more formal solution was found.
What's the problem this feature will solve?
One might have a dev_requirements file specifying linter for CI jobs that are also used by pre-commit hooks. It would be great if pip-compile could not only create/update the requirements.tx file, but also the .pre-commit-config.yaml file to not have a mismatch on
black
for example.Describe the solution you'd like
pip-compile
would check if it finds some pre-commit config file, a path might be passed as extra args if preferred.For example, if the pre-commit config file has the following content:
And dev_requirements.in the following:
Then we would have dev_requirements.txt with
And in .pre-commit-config.yaml
I'm not sure if this should be a plugin, but as pre-commit is so much used in pip-tools itself and is turning a de facto standard I think it could make sense to have directly integrated to pip-compile.
Should it be enabled by default? I would say yes, but it could be an option to be enabled, possibly by passing the config file path as argument.
Another possibility would be a pre-commit plugin, but I tend to think it should be added to pip-compile directly...
The text was updated successfully, but these errors were encountered: