From 77f97aa058f428611ab11b68b927130855fdb545 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Wed, 10 Oct 2018 22:54:02 -0500 Subject: [PATCH] Set PIPENV_ACTIVE when running pipenv run --- news/2996.trivial | 1 + pipenv/core.py | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 news/2996.trivial diff --git a/news/2996.trivial b/news/2996.trivial new file mode 100644 index 00000000..dbe1006a --- /dev/null +++ b/news/2996.trivial @@ -0,0 +1 @@ +Set `PIPENV_ACTIVE=1` when running `pipenv run`. This is what `pipenv shell` already does. \ No newline at end of file diff --git a/pipenv/core.py b/pipenv/core.py index 6129dc15..1b9c5ade 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2284,6 +2284,8 @@ def do_run(command, args, three=None, python=False, pypi_mirror=None): # Ensure that virtualenv is available. ensure_project(three=three, python=python, validate=False, pypi_mirror=pypi_mirror) + # Set an environment variable, so we know we're in the environment. + os.environ["PIPENV_ACTIVE"] = vistir.misc.fs_str("1") load_dot_env() # Activate virtualenv under the current interpreter's environment inline_activate_virtual_environment()