From cdf726bbedb15f33ca60fdc397fec379946755fc Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 8 Apr 2015 13:59:25 -0700 Subject: [PATCH] Make isolated environments more isolated under OSX and pyvenv. Resolves #217. --- pre_commit/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pre_commit/main.py b/pre_commit/main.py index 64c04047..7ad7c0e8 100644 --- a/pre_commit/main.py +++ b/pre_commit/main.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import argparse +import os import sys import pkg_resources @@ -15,6 +16,13 @@ from pre_commit.error_handler import error_handler from pre_commit.runner import Runner +# https://github.com/pre-commit/pre-commit/issues/217 +# On OSX, making a virtualenv using pyvenv at . causes `virtualenv` and `pip` +# to install packages to the wrong place. We don't want anything to deal with +# pyvenv +os.environ.pop('__PYVENV_LAUNCHER__', None) + + def main(argv=None): argv = argv if argv is not None else sys.argv[1:] parser = argparse.ArgumentParser()