pre-commit-hook

Pre-commit install-hooks does not work (SSLError)

Pre-commit install-hooks does not work (SSLError) Question: I use conda Python environments. Whenever I try to run pre-commit install-hooks, I get the error Could not fetch URL https://pypi.org/simple/ruamel-yaml/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=’pypi.org’, port=443): Max retries exceeded w ith url: /simple/ruamel-yaml/ (Caused by SSLError("Can’t connect to HTTPS URL because the SSL …

Total answers: 1

Pre-commit hook throws error on hatchling requirement

Pre-commit hook throws error on hatchling requirement Question: 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 repos: – repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.3.0 hooks: – id: check-yaml – id: end-of-file-fixer – id: …

Total answers: 2

Access python interpreter in VSCode version controll when using pre-commit

Access python interpreter in VSCode version controll when using pre-commit Question: I’m using pre-commit for most of my Python projects, and in many of them, I need to use pylint as a local repo. When I want to commit, I always have to activate python venv and then commit; otherwise, I’ll get the following error: …

Total answers: 2

running pre-commit python package in Windows gives ExecutableNotFoundError: Executable `/bin/sh`

running pre-commit python package in Windows gives ExecutableNotFoundError: Executable `/bin/sh` Question: I am working on a project where pre-commit==2.15.0 was added to the python requirements file. I installed the requirements. Now when I try to do a git commit I get the following error: An unexpected error has occurred: ExecutableNotFoundError: Executable `/bin/sh` not found Check …

Total answers: 1

How to have a single source of truth for poetry and pre-commit package version?

How to have a single source of truth for poetry and pre-commit package version? Question: I’m looking into this Python project template. They use poetry to define dev dependencies [tool.poetry.dev-dependencies] black = {version = "*", allow-prereleases = true} flake8 = "*" isort = "^5.6" mypy = ">0.900,<1" … They use also pre-commit to check housekeeping …

Total answers: 2

The hook `black` requires pre-commit version 2.9.2 but version 2.6.0 is installed

The hook `black` requires pre-commit version 2.9.2 but version 2.6.0 is installed Question: I am having trouble with pre-commit and black. Everything worked fine until I cleared the cache with pre-commit clean. Now I always get the error The hook black requires pre-commit version 2.9.2 but version 2.6.0 is installed. Perhaps run `pip install –upgrade …

Total answers: 2