ewjoachim / poetry-to-pre-commit

A pre-commit hook for syncing version numbers between poetry.lock and .pre-commit-config.yaml
MIT License
0 stars 1 forks source link

Add option `--update-only` to `sync-hooks-additional-dependencies` #8

Closed souliane closed 4 months ago

souliane commented 5 months ago

Thanks! Very useful project. To sync the dependencies manually is a nightmare.

I have here a constraint, I am using an old version of poetry that doesn't allow to define custom dependencies groups. Thus I need to use the main group for all packages (prod, dev, test... it's in the end not a big deal because the production environment does not use poetry to install the dependencies).

Anyway, my problem is that I mypy does not need all the dependencies, so I was until now adding them one by one in hooks / mypy / additional_dependencies, when needed. And poetry-to-pre-commit does a great job pinning the dependencies, but it also adds those that were not listed in the original list.

Would it be possible to add an option like --update-only that will work on the existing deps without adding new ones?

ewjoachim commented 5 months ago

This could be added. You'd need to be careful not to forget adding new ones or remove old ones, but yeah.

Would you like to contribute this ? I believe the code is not too hard to dive into and has appropriate tests :)

souliane commented 5 months ago

I would like to contribute, yes! But I can't tell you when I will manage to do it :-p

ewjoachim commented 5 months ago

Great, thanks! Let's say that the issue is yours to tackle for the next 2 months or so, and then it will be up for grabs by anyone who wants to tackle it.