From 96ba437dd1f914d7232cefa153e362039ad39633 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 6 Sep 2017 17:07:18 -0400 Subject: [PATCH] 5.4.2 Signed-off-by: Kenneth Reitz --- pipenv/__version__.py | 2 +- pipenv/cli.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pipenv/__version__.py b/pipenv/__version__.py index a4cd3cf2..83430ac3 100644 --- a/pipenv/__version__.py +++ b/pipenv/__version__.py @@ -3,4 +3,4 @@ # //___/ / / / //___/ / // // / / || / / # // / / // ((____ // / / ||/ / -__version__ = '5.4.1' +__version__ = '5.4.2' diff --git a/pipenv/cli.py b/pipenv/cli.py index 5515b257..6edafdca 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -1058,8 +1058,6 @@ def shell(three=None, python=False, compat=False, shell_args=None): code = compile(f.read(), activate_this, 'exec') exec(code, dict(__file__=activate_this)) - print(locals()) - # Set an environment variable, so we know we're in the environment. os.environ['PIPENV_ACTIVE'] = '1' @@ -1142,6 +1140,12 @@ def run(command, args, three=None, python=False): command_path = which(command) + # Activate virtualenv under the current interpreter's environment + activate_this = which('activate_this.py') + with open(activate_this) as f: + code = compile(f.read(), activate_this, 'exec') + exec(code, dict(__file__=activate_this)) + if not os.path.exists(command_path): click.echo(crayons.red('The command ({0}) was not found within the virtualenv!'.format(command_path))) sys.exit(1)