refactor virtualenv stuff

Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2017-09-26 10:23:31 -04:00
parent bf53fc3be9
commit 1faec7f251
2 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -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
+3 -3
View File
@@ -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: