From d47604892a915ddf0b2a130dadaf01376442ae6a Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Mon, 3 Dec 2018 16:25:52 -0500 Subject: [PATCH 1/4] Enable output of script line for 'run' in verbose mode --- pipenv/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pipenv/core.py b/pipenv/core.py index f26a2edc73..686c7e9534 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2303,6 +2303,8 @@ def do_run(command, args, three=None, python=False, pypi_mirror=None): inline_activate_virtual_environment() try: script = project.build_script(command, args) + cmd_string = ' '.join([script.command] + script.args) + logging.getLogger("pip").info("Run: '{0}'".format(cmd_string)) except ScriptEmptyError: click.echo("Can't run script {0!r}-it's empty?", err=True) if os.name == "nt": From aee66c607481a36e52dd414873d0e40e9f12b5c3 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Mon, 3 Dec 2018 20:15:03 -0500 Subject: [PATCH 2/4] fixup! use click.echo > stderr --- pipenv/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index 686c7e9534..48253efd3d 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2304,7 +2304,8 @@ def do_run(command, args, three=None, python=False, pypi_mirror=None): try: script = project.build_script(command, args) cmd_string = ' '.join([script.command] + script.args) - logging.getLogger("pip").info("Run: '{0}'".format(cmd_string)) + if environments.is_verbose(): + click.echo(crayons.normal("Run: {0}".format(cmd_string)), err=True) except ScriptEmptyError: click.echo("Can't run script {0!r}-it's empty?", err=True) if os.name == "nt": From 453ed705a8c7bbce38aab1a0950f613019943da8 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Tue, 4 Dec 2018 12:03:56 -0500 Subject: [PATCH 3/4] fixup! use `$` Co-Authored-By: refack --- pipenv/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index 48253efd3d..084042e0fb 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2305,7 +2305,7 @@ def do_run(command, args, three=None, python=False, pypi_mirror=None): script = project.build_script(command, args) cmd_string = ' '.join([script.command] + script.args) if environments.is_verbose(): - click.echo(crayons.normal("Run: {0}".format(cmd_string)), err=True) + click.echo(crayons.normal("$ {0}".format(cmd_string)), err=True) except ScriptEmptyError: click.echo("Can't run script {0!r}-it's empty?", err=True) if os.name == "nt": From 5c8ecfc86f83cb3d8aeff0fe79a31850bc655232 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Tue, 4 Dec 2018 12:10:37 -0500 Subject: [PATCH 4/4] fixup! add `news` --- news/3348.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/3348.feature.rst diff --git a/news/3348.feature.rst b/news/3348.feature.rst new file mode 100644 index 0000000000..50547a3d79 --- /dev/null +++ b/news/3348.feature.rst @@ -0,0 +1 @@ +Added support for ``--verbose`` output to ``pipenv run``. \ No newline at end of file