Apparently pre-commit failed to use python3 interpreter when I tried to add a hook and thus failed because venv module was not installed on default python2.7!
$ pre-commit try-repo ../python-license-check [19:55:27]
[INFO] Initializing environment for ../python-license-check.
===============================================================================
Using config:
===============================================================================
repos:
- repo: ../python-license-check
rev: 4048cf3844dbbf45690c153a7da7f532585ec87c
hooks:
- id: liccheck
===============================================================================
[INFO] Installing environment for ../python-license-check.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: Command: ('/Users/ssbarnea/.pyenv/versions/2.7.14/bin/python2.7', '-mvenv', '/var/folders/br/99tfdvcs3vvfwdk69z7f0xmc0000gn/T/tmpayl0P5/repoHa7_qe/py_venv-python2.7')
Return code: 1
Expected return code: 0
Output: (none)
Errors:
/Users/ssbarnea/.pyenv/versions/2.7.14/bin/python2.7: No module named venv
Check the log at /Users/ssbarnea/.cache/pre-commit/pre-commit.log
FAIL: 1
ssbarnea@smac: ~/os/jira master ⚡ $ cat ../python-license-check/.pre-commit-hooks.yaml [19:55:34]
- id: liccheck
name: Validates dependency licenses for Python packages
description: This validator validates a pre-commit hooks manifest file
entry: liccheck -s setup.cfg -r requirements.txt
language: python_venv
Based on the documentation I was expecting to see pre-commit using the python3 executable for calling venv module.
Apparently pre-commit failed to use python3 interpreter when I tried to add a hook and thus failed because venv module was not installed on default python2.7!
Based on the documentation I was expecting to see pre-commit using the
python3executable for calling venv module.