jannismain / python-project-template

A copier project template for Python. Example Project: https://github.com/jannismain/python-project-template-example
https://jannismain.github.io/python-project-template/
MIT License
7 stars 3 forks source link

Error during installation of pre-commit hooks. Is pre-commit installed? #12

Open lieutdan13 opened 1 month ago

lieutdan13 commented 1 month ago

Problem

After the new project has been initialized, I receive a warning that pre-commit is not installed. I see that pre-commit is in the dev dependencies.

'pre-commit' is not recognized as an internal or external command,
operable program or batch file.
'Error during installation of pre-commit hooks. Is pre-commit installed?'

Solutions

1) move pre-commit to dependencies in pyproject.toml 2) add documentation that one must install pre-commit or install the dev dependencies before enabling precommit during runtime 3) others?

Suggestion

Since the precommit option defaults to true, my suggestion would be to move pre-commit package into the python-project-template dependencies.

@jannismain I'd be interested in your thoughts. I'd be willing to implement either of the proposed changes or explore other options

jannismain commented 4 weeks ago

Hey @lieutdan13,

thanks for reporting this. Indeed, I intended for pre-commit to be a prerequisite of the python-project-template. Although, I don't see a reason why we shouldn't make it easier for users to get started. I'm alright with both approaches you outlined. If pre-commit as a dev-dependency solves the issue, go for it :-)