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()