From 77bac23f93f4750342b43c72a87a98d1ea91d313 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sun, 10 Mar 2019 17:32:47 -0400 Subject: [PATCH] re-add setting to make environment active when running shell Signed-off-by: Dan Ryan --- pipenv/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index 075fcb69..d5d6ec52 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -1441,7 +1441,7 @@ def pip_install( ignore_hashes = True else: ignore_hashes = True if not requirement.hashes else False - install_reqs = requirement.as_line(as_list=True) + install_reqs = requirement.as_line(as_list=True, include_hashes=not ignore_hashes) if not requirement.markers: install_reqs = [escape_cmd(r) for r in install_reqs] elif len(install_reqs) > 1: @@ -2301,6 +2301,12 @@ def do_shell(three=None, python=False, fancy=False, shell_args=None, pypi_mirror project.project_directory, shell_args, ) + # Only set PIPENV_ACTIVE after finishing reading virtualenv_location + # Set an environment variable, so we know we're in the environment. + # otherwise its value will be changed + os.environ["PIPENV_ACTIVE"] = vistir.misc.fs_str("1") + + os.environ.pop("PIP_SHIMS_BASE_MODULE", None) if fancy: shell.fork(*fork_args)