Skip to content
Advertisement

Pre-commit hook throws error on hatchling requirement

I’m following the pre-commit directions to install git pre-commit hooks for python code formatting from black to my flask repo. I’ve added pre-commit to my requirements.txt and my pre-commit-config.yaml file looks like

JavaScript

After installing pre-commit using pip install pre-commit and installing the git hook scripts using pre-commit install, I get this error message related to a hatchling dependency package when making a git commit using git commit.

JavaScript

Has anyone seen this before and know how to fix it?

Advertisement

Answer

modern hatchling does not support python3.6 — pip is unable to find one which matches your request because 3.6 support was dropped after 0.25.1

you can force a different language version (assuming you have that python installed) via language_version — such as:

JavaScript

disclaimer: I created pre-commit

Advertisement