diff --git a/pipenv/environments.py b/pipenv/environments.py index 915c058e..ca65ee0e 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -42,7 +42,10 @@ PIPENV_MAX_DEPTH = int(os.environ.get('PIPENV_MAX_DEPTH', '3')) + 1 PIPENV_USE_SYSTEM = False if 'PIPENV_ACTIVE' not in os.environ: if 'PIPENV_IGNORE_VIRTUALENVS' not in os.environ: - PIPENV_USE_SYSTEM = os.environ.get('VIRTUAL_ENV') + PIPENV_VIRTUALENV = os.environ.get('VIRTUAL_ENV') + PIPENV_USE_SYSTEM = bool(os.environ.get('VIRTUAL_ENV')) +else: + PIPENV_VIRTUALENV = None # Tells Pipenv to use hashing mode. PIPENV_USE_HASHES = True diff --git a/pipenv/project.py b/pipenv/project.py index 0c040dd4..00ea33a6 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -16,7 +16,7 @@ from .utils import ( find_requirements, is_file, is_vcs, python_version ) from .environments import PIPENV_MAX_DEPTH, PIPENV_VENV_IN_PROJECT -from .environments import PIPENV_USE_SYSTEM, PIPENV_PIPFILE +from .environments import PIPENV_VIRTUALENV, PIPENV_PIPFILE if PIPENV_PIPFILE: if not os.path.isfile(PIPENV_PIPFILE): @@ -110,8 +110,8 @@ class Project(object): def virtualenv_location(self): # if VIRTUAL_ENV is set, use that. - if PIPENV_USE_SYSTEM: - return PIPENV_USE_SYSTEM + if PIPENV_VIRTUALENV: + return PIPENV_VIRTUALENV # Use cached version, if available. if self._virtualenv_location: