mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
refactor virtualenv stuff
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
@@ -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
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user