ImperialCollegeLondon / pyrealm

Development of the pyrealm package, providing an integrated toolbox for modelling plant productivity, growth and demography using Python.
https://pyrealm.readthedocs.io/
MIT License
23 stars 9 forks source link

Version issue of `pre-commit` installed by `poetry install` #150

Closed tztsai closed 10 months ago

tztsai commented 11 months ago

Describe the bug poetry install will install pre-commit of version 2.21.0 in the virtual environment. However, after pre-commit install, doing a Git commit will lead to an error:

image

This issue was also discussed in https://stackoverflow.com/questions/77503109/how-to-fix-invalidmanifesterror-for-pre-commit-with-black.

To Reproduce Steps to reproduce the behavior:

  1. poetry install
  2. pre-commit install
  3. git commit

Expected behavior The pre-commit hooks should successfully run.

Desktop (please complete the following information):

Additional context

I tried on my machine with different versions of pre-commit. Version 3.0 and 3.1 still caused the same error, while version 3.2 led to a successful pre-commit check, in accord with the answer on StackOverflow. Therefore it seems that to address this issue, we need to update the required version of pre-commit in pyproject.toml to pre-commit = "^3.2.0".