Repository: pre-commit/pre-commit

Issue:
python_venv language fails to use python3 interpreter and is using python2.7 instead
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. 


Discussion:
pre-commit doesn't really do any attempt at fishing out installed executables.  It tries by default the executable you're using.

For `language: python_venv` when running pre-commit under python2, you'll need to tell pre-commit where to find a suitable executable via `language_version`:

```python
    -    id: liccheck
         language: python_venv
         language_version: python3
         ...
```

Note that for hooks which are being distributed, it is suggested to use `language: python` over `language: python_venv` as it is more portable.

defaulting `language: python3` would potentially lead to undesirable results if someone is expecting a newer / older `python3.x` version so I don't think (?) it's an appropriate default here

Resolving patch:
diff --git a/pre_commit/languages/python_venv.py b/pre_commit/languages/python_venv.py
--- a/pre_commit/languages/python_venv.py
+++ b/pre_commit/languages/python_venv.py
@@ -1,6 +1,7 @@
 from __future__ import unicode_literals
 
 import os.path
+import sys
 
 from pre_commit.languages import python
 from pre_commit.util import CalledProcessError
@@ -10,6 +11,13 @@
 ENVIRONMENT_DIR = 'py_venv'
 
 
+def get_default_version():  # pragma: no cover (version specific)
+    if sys.version_info < (3,):
+        return 'python3'
+    else:
+        return python.get_default_version()
+
+
 def orig_py_exe(exe):  # pragma: no cover (platform specific)
     """A -mvenv virtualenv made from a -mvirtualenv virtualenv installs
     packages to the incorrect location.  Attempt to find the _original_ exe
@@ -43,6 +51,5 @@ def make_venv(envdir, python):
     cmd_output(orig_py_exe(python), '-mvenv', envdir, cwd='/')
 
 
-get_default_version = python.get_default_version
 _interface = python.py_interface(ENVIRONMENT_DIR, make_venv)
 in_env, healthy, run_hook, install_environment = _interface


Test patch: