compilerla / conventional-pre-commit

A pre-commit hook that checks commit messages for Conventional Commits formatting
Apache License 2.0
336 stars 55 forks source link

Error installing conventional-pre-commit environment in Amazon Linux 2, Python3.7 #56

Closed ppagolu closed 1 year ago

ppagolu commented 1 year ago

[INFO] Installing environment for https://github.com/compilerla/conventional-pre-commit. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... An unexpected error has occurred: AssertionError: BUG: expected environment for python to be healthy immediately after install, please open an issue describing your environment

more info:

pyvenv.cfg does not exist (old virtualenv?)Check the log at /home/ec2-user/.cache/pre-commit/pre-commit.log

version information

pre-commit version: 2.20.0
git --version: git version 2.40.1
sys.version:
    3.7.16 (default, Mar 10 2023, 03:25:26) 
    [GCC 7.3.1 20180712 (Red Hat 7.3.1-15)]
sys.executable: /usr/bin/python3
os.name: posix
sys.platform: linux

error information


An unexpected error has occurred: AssertionError: BUG: expected environment for python to be healthy immediately after install, please open an issue describing your environment
thekaveman commented 1 year ago

Thanks @ppagolu - though I suspect this error is more related to pre-commit itself and not this hook specifically.

I.e. this error message is not coming from this hook:

AssertionError: BUG: expected environment for python to be healthy immediately after install, please open an issue describing your environment

See these related issues for more info:

ppagolu commented 1 year ago

Thanks @thekaveman those references helped, yes its a bug with pre-commit specifically virtualenv. and just for completeness here is what fixed the error for me: python3 -m pip install virtualenv==20.15.1 as per https://github.com/pre-commit/pre-commit/issues/2336#issuecomment-1194765687