From 55856c70ace5caf7c1b53d253fbc7c4fa7421ac0 Mon Sep 17 00:00:00 2001 From: Alex Kong Date: Tue, 20 Nov 2018 06:42:15 -0500 Subject: [PATCH 1/5] open cli command logic update --- pipenv/cli/command.py | 5 ++++- tests/integration/test_cli.py | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index a49e90dd..20c0efb1 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -569,7 +569,10 @@ def run_open(state, module, *args, **kwargs): else: p = c.out.strip().rstrip("cdo") echo(crayons.normal("Opening {0!r} in your EDITOR.".format(p), bold=True)) - edit(filename=p) + from ..core import inline_activate_virtual_environment + inline_activate_virtual_environment() + environment={"VIRTUAL_ENV":os.environ["VIRTUAL_ENV"]} + edit(filename=p, env=environment) return 0 diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 7ebcee1d..4e7834f8 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -125,6 +125,12 @@ def test_pipenv_check(PipenvInstance, pypi): assert 'Ignoring' in c.err +@pytest.mark.cli +def test_pipenv_open(PipenvInstance, pypi): + with PipenvInstance(pypi=pypi) as p: + assert p.pipenv("open test").out + + @pytest.mark.cli def test_pipenv_clean_pip_no_warnings(PipenvInstance): with PipenvInstance(chdir=True) as p: From c97730e3e4a7727c736daf9c654e565678430e01 Mon Sep 17 00:00:00 2001 From: Alex Kong Date: Fri, 23 Nov 2018 06:18:02 -0500 Subject: [PATCH 2/5] updated edit call according to suggestion --- pipenv/cli/command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 20c0efb1..66be98a1 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -572,7 +572,7 @@ def run_open(state, module, *args, **kwargs): from ..core import inline_activate_virtual_environment inline_activate_virtual_environment() environment={"VIRTUAL_ENV":os.environ["VIRTUAL_ENV"]} - edit(filename=p, env=environment) + edit(filename=p) return 0 From df34b90fc4ace42cc3531dd9f709c678d16ce371 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Mon, 11 Mar 2019 00:34:16 -0400 Subject: [PATCH 3/5] Port #3263 with updates - Allow click's editor to inherit the environment from the subprocess. - Fixes #2747 - Supersedes, replaces, and closes #3263 Signed-off-by: Dan Ryan --- pipenv/cli/command.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 32f30b88..33388cc4 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -553,7 +553,7 @@ def run_open(state, module, *args, **kwargs): EDITOR=atom pipenv open requests """ - from ..core import which, ensure_project + from ..core import which, ensure_project, inline_activate_virtual_environment # Ensure that virtualenv is available. ensure_project( @@ -573,9 +573,7 @@ def run_open(state, module, *args, **kwargs): else: p = c.out.strip().rstrip("cdo") echo(crayons.normal("Opening {0!r} in your EDITOR.".format(p), bold=True)) - from ..core import inline_activate_virtual_environment inline_activate_virtual_environment() - environment={"VIRTUAL_ENV":os.environ["VIRTUAL_ENV"]} edit(filename=p) return 0 From c34b94e1c23cd4dc8f18b7bc2d096505968d12d4 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Mon, 18 Mar 2019 21:58:51 -0400 Subject: [PATCH 4/5] Remove test for open call since there are no editors in CI Signed-off-by: Dan Ryan --- tests/integration/test_cli.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 9dced3f6..a38883e0 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -141,12 +141,6 @@ def test_pipenv_check(PipenvInstance, pypi): assert 'Ignoring' in c.err -@pytest.mark.cli -def test_pipenv_open(PipenvInstance, pypi): - with PipenvInstance(pypi=pypi) as p: - assert p.pipenv("open test").out - - @pytest.mark.cli def test_pipenv_clean_pip_no_warnings(PipenvInstance): with PipenvInstance(chdir=True) as p: From 0f1e2ed9bda267d061239121613351e9761aff80 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Mon, 25 Mar 2019 21:32:21 +0800 Subject: [PATCH 5/5] rename news file --- news/{3499.docs.rst => 3499.doc.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{3499.docs.rst => 3499.doc.rst} (100%) diff --git a/news/3499.docs.rst b/news/3499.doc.rst similarity index 100% rename from news/3499.docs.rst rename to news/3499.doc.rst