Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2017-09-21 22:16:33 -04:00
parent 9ab14f661d
commit ea8fd66686
2 changed files with 9 additions and 5 deletions
+6 -5
View File
@@ -40,7 +40,7 @@ from .environments import (
PIPENV_COLORBLIND, PIPENV_NOSPIN, PIPENV_SHELL_COMPAT,
PIPENV_VENV_IN_PROJECT, PIPENV_USE_SYSTEM, PIPENV_TIMEOUT,
PIPENV_SKIP_VALIDATION, PIPENV_HIDE_EMOJIS, PIPENV_INSTALL_TIMEOUT,
PYENV_INSTALLED, PIPENV_YES
PYENV_INSTALLED, PIPENV_YES, PIPENV_DONT_LOAD_ENV
)
# Backport required for earlier versions of Python.
@@ -114,10 +114,11 @@ project = Project()
def load_dot_env():
denv = dotenv.find_dotenv(os.sep.join([project.project_directory, '.env']))
if os.path.isfile(denv):
click.echo(crayons.white('Loading .env environment variables…', bold=True), err=True)
dotenv.load_dotenv(denv, override=True)
if not PIPENV_DONT_LOAD_ENV:
denv = dotenv.find_dotenv(os.sep.join([project.project_directory, '.env']))
if os.path.isfile(denv):
click.echo(crayons.white('Loading .env environment variables…', bold=True), err=True)
dotenv.load_dotenv(denv, override=True)
def add_to_path(p):
+3
View File
@@ -24,6 +24,9 @@ PIPENV_PIPFILE = os.environ.get('PIPENV_PIPFILE')
# Tells pipenv to not try to install -e dependencies to get their dependency information.
PIPENV_DONT_EAT_EDITABLES = bool(os.environ.get('PIPENV_DONT_EAT_EDITABLES'))
# Tells pipenv to not load .env files.
PIPENV_DONT_LOAD_ENV = bool(os.environ.get('PIPENV_DONT_LOAD_ENV'))
# Tell Pipenv to default to yes at all prompts.
PIPENV_YES = bool(os.environ.get('PIPENV_YES'))