From 9cb8e546c2d798aa912e3471cece87c8dad6182a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B6=E4=BB=B6?= Date: Sun, 29 Jul 2018 21:23:40 +0800 Subject: [PATCH 01/19] Update basics.rst with `$SHELL` State the role of `$SHELL` in `pipenv shell` command. --- docs/basics.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/basics.rst b/docs/basics.rst index 9c222eb4..f9bf0b80 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -326,6 +326,7 @@ You should do this for your shell too, in your ``~/.profile`` or ``~/.bashrc`` o .. note:: The shell launched in interactive mode. This means that if your shell reads its configuration from a specific file for interactive mode (e.g. bash by default looks for a ``~/.bashrc`` configuration file for interactive mode), then you'll need to modify (or create) this file. +Also ``pipenv shell`` use ``$SHELL`` environment variable to get the name of shell you are running, if something wrong, just check it. ☤ A Note about VCS Dependencies ------------------------------- From 0f30bcbcdbdb584d74d08dc284a0de32f3e31357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B6=E4=BB=B6?= Date: Wed, 1 Aug 2018 22:34:33 +0800 Subject: [PATCH 02/19] Update basics.rst Add the description of `PIPENV_SHELL` --- docs/basics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics.rst b/docs/basics.rst index f9bf0b80..0dadd02f 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -326,7 +326,7 @@ You should do this for your shell too, in your ``~/.profile`` or ``~/.bashrc`` o .. note:: The shell launched in interactive mode. This means that if your shell reads its configuration from a specific file for interactive mode (e.g. bash by default looks for a ``~/.bashrc`` configuration file for interactive mode), then you'll need to modify (or create) this file. -Also ``pipenv shell`` use ``$SHELL`` environment variable to get the name of shell you are running, if something wrong, just check it. +If you get something wrong with ``$ pipenv shell``, just check ``PIPENV_SHELL`` environment variable, ``$ pipenv shell`` will use it if available. For detail, see `Configuration With Environment Variables `_. ☤ A Note about VCS Dependencies ------------------------------- From 81a189dbc524977882d7bd520a86ac95b594ed22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B6=E4=BB=B6?= Date: Thu, 2 Aug 2018 16:31:58 +0800 Subject: [PATCH 03/19] Update basics.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update link with Sphinx’s reference syntax. --- docs/basics.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/basics.rst b/docs/basics.rst index 0dadd02f..8d7ff825 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -326,7 +326,7 @@ You should do this for your shell too, in your ``~/.profile`` or ``~/.bashrc`` o .. note:: The shell launched in interactive mode. This means that if your shell reads its configuration from a specific file for interactive mode (e.g. bash by default looks for a ``~/.bashrc`` configuration file for interactive mode), then you'll need to modify (or create) this file. -If you get something wrong with ``$ pipenv shell``, just check ``PIPENV_SHELL`` environment variable, ``$ pipenv shell`` will use it if available. For detail, see `Configuration With Environment Variables `_. +If you get something wrong with ``$ pipenv shell``, just check ``PIPENV_SHELL`` environment variable, ``$ pipenv shell`` will use it if available. For detail, see :ref:`configuration-with-environment-variables`. ☤ A Note about VCS Dependencies ------------------------------- @@ -363,3 +363,4 @@ production environments for reproducible builds. This will include all hashes, however (which is great!). To get a ``requirements.txt`` without hashes, use ``$ pipenv run pip freeze``. +.. _configuration-with-environment-variables:https://docs.pipenv.org/advanced/#configuration-with-environment-variables From 83ca4fbbb3bdf26eafa72c433e3e8d1ae50be8ab Mon Sep 17 00:00:00 2001 From: Alexandros Tzannes Date: Thu, 19 Jul 2018 14:10:20 -0400 Subject: [PATCH 04/19] Add test for setup.py::dependency-link field --- tests/integration/test_install_twists.py | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index d2cdd9aa..f6d8706e 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -57,6 +57,48 @@ zip_safe=False assert "six" in p.lockfile["default"] +@pytest.mark.install +@pytest.mark.local +@pytest.mark.needs_internet +@flaky +def test_local_dependency_links_install(PipenvInstance, pypi): + """Ensure dependency_links are parsed and installed (needed for private repo dependencies). + """ + def make_setup(pipenv_instance, deplink): + setup_py = os.path.join(pipenv_instance.path, "setup.py") + with open(setup_py, "w") as fh: + contents = """ +from setuptools import setup + +setup( + name='testdeplinks', + version='0.1', + packages=[], + install_requires=[ + 'test-private-dependency' + ], + dependency_links=[ + '{0}' + ] +) + """.strip().format(deplink) + fh.write(contents) + + def test_deplink(pipenv_instance, deplink): + make_setup(pipenv_instance, deplink) + c = pipenv_instance.pipenv("install -e .") + assert c.return_code == 0 + assert "test-private-dependency" in pipenv_instance.lockfile["default"] + assert "version" in pipenv_instance.lockfile["default"]["test-private-dependency"] + assert "0.1" in pipenv_instance.lockfile["default"]["test-private-dependency"]["version"] + + with PipenvInstance(pypi=pypi, chdir=True) as p: + test_deplink(p, 'git+https://github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') + + with PipenvInstance(pypi=pypi, chdir=True) as p: + test_deplink(p, 'git+ssh://git@github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') + + @pytest.mark.e @pytest.mark.install @pytest.mark.skip(reason="this doesn't work on windows") From e47fd53f9538528914fc273e6a9056b529baba4d Mon Sep 17 00:00:00 2001 From: Alexandros Tzannes Date: Fri, 3 Aug 2018 13:04:16 -0700 Subject: [PATCH 05/19] [fixup] skip the git+ssh deplink test if the git+https test works on Build Kite --- tests/integration/test_install_twists.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index f6d8706e..7c06696d 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -95,8 +95,8 @@ setup( with PipenvInstance(pypi=pypi, chdir=True) as p: test_deplink(p, 'git+https://github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') - with PipenvInstance(pypi=pypi, chdir=True) as p: - test_deplink(p, 'git+ssh://git@github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') + # with PipenvInstance(pypi=pypi, chdir=True) as p: + # test_deplink(p, 'git+ssh://git@github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') @pytest.mark.e From f1cb2287ab17d340e7214ef939e4f1713a57b20c Mon Sep 17 00:00:00 2001 From: Alexandros Tzannes Date: Fri, 3 Aug 2018 13:27:51 -0700 Subject: [PATCH 06/19] Add -v flag to get better insight when it fails --- tests/integration/test_install_twists.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index 7c06696d..636d10ee 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -86,7 +86,7 @@ setup( def test_deplink(pipenv_instance, deplink): make_setup(pipenv_instance, deplink) - c = pipenv_instance.pipenv("install -e .") + c = pipenv_instance.pipenv("install -v -e .") assert c.return_code == 0 assert "test-private-dependency" in pipenv_instance.lockfile["default"] assert "version" in pipenv_instance.lockfile["default"]["test-private-dependency"] From 0e7ddbccf3beab3bb3c92c55bcbd2ec2ca6f732a Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sun, 5 Aug 2018 02:49:18 -0400 Subject: [PATCH 07/19] Enable dependency link processing - Use `PIP_PROCESS_DEPENDENCY_LINKS` to toggle the processing of dependency links --- tests/integration/test_install_twists.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index 636d10ee..d357805f 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -92,7 +92,8 @@ setup( assert "version" in pipenv_instance.lockfile["default"]["test-private-dependency"] assert "0.1" in pipenv_instance.lockfile["default"]["test-private-dependency"]["version"] - with PipenvInstance(pypi=pypi, chdir=True) as p: + with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p: + os.environ['PIP_PROCESS_DEPENDENCY_LINKS'] = '1' test_deplink(p, 'git+https://github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') # with PipenvInstance(pypi=pypi, chdir=True) as p: From 2c39cdb4042fc36fe70fd33d81a0fc2dbc9c54af Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Mon, 6 Aug 2018 10:24:37 -0400 Subject: [PATCH 08/19] Fix typo --- pipenv/environments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/environments.py b/pipenv/environments.py index 0e21ca3b..b6633f39 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -95,7 +95,7 @@ PIPENV_MAX_RETRIES = int(os.environ.get( )) """Specify how many retries Pipenv should attempt for network requests. -Default is 0. Aautomatically set to 1 on CI environments for robust testing. +Default is 0. Automatically set to 1 on CI environments for robust testing. """ PIPENV_MAX_ROUNDS = int(os.environ.get("PIPENV_MAX_ROUNDS", "16")) From 210a9d46fb4fcebe66783e2dfddeec6f0df15a6e Mon Sep 17 00:00:00 2001 From: Alexandros Tzannes Date: Mon, 6 Aug 2018 10:04:16 -0700 Subject: [PATCH 09/19] Add back git+ssh version of dep-links test See if it fails n build Kite --- tests/integration/test_install_twists.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index d357805f..ab41906a 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -96,8 +96,9 @@ setup( os.environ['PIP_PROCESS_DEPENDENCY_LINKS'] = '1' test_deplink(p, 'git+https://github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') - # with PipenvInstance(pypi=pypi, chdir=True) as p: - # test_deplink(p, 'git+ssh://git@github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') + with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p: + os.environ['PIP_PROCESS_DEPENDENCY_LINKS'] = '1' + test_deplink(p, 'git+ssh://git@github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') @pytest.mark.e From 3cc02ebd5d2e2795670853316807607c2b8841cc Mon Sep 17 00:00:00 2001 From: Alexandros Tzannes Date: Mon, 6 Aug 2018 10:30:04 -0700 Subject: [PATCH 10/19] Break dependency-links test into two separate tests Use helper functions to reduce code duplication since these two tests are quasi-identical --- tests/integration/test_install_twists.py | 61 +++++++++++++++--------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index ab41906a..5de15a2a 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -57,17 +57,10 @@ zip_safe=False assert "six" in p.lockfile["default"] -@pytest.mark.install -@pytest.mark.local -@pytest.mark.needs_internet -@flaky -def test_local_dependency_links_install(PipenvInstance, pypi): - """Ensure dependency_links are parsed and installed (needed for private repo dependencies). - """ - def make_setup(pipenv_instance, deplink): - setup_py = os.path.join(pipenv_instance.path, "setup.py") - with open(setup_py, "w") as fh: - contents = """ +def helper_dependency_links_install_make_setup(pipenv_instance, deplink): + setup_py = os.path.join(pipenv_instance.path, "setup.py") + with open(setup_py, "w") as fh: + contents = """ from setuptools import setup setup( @@ -81,24 +74,48 @@ setup( '{0}' ] ) - """.strip().format(deplink) - fh.write(contents) + """.strip().format(deplink) + fh.write(contents) - def test_deplink(pipenv_instance, deplink): - make_setup(pipenv_instance, deplink) - c = pipenv_instance.pipenv("install -v -e .") - assert c.return_code == 0 - assert "test-private-dependency" in pipenv_instance.lockfile["default"] - assert "version" in pipenv_instance.lockfile["default"]["test-private-dependency"] - assert "0.1" in pipenv_instance.lockfile["default"]["test-private-dependency"]["version"] +def helper_dependency_links_install_test(pipenv_instance, deplink): + helper_dependency_links_install_make_setup(pipenv_instance, deplink) + c = pipenv_instance.pipenv("install -v -e .") + assert c.return_code == 0 + assert "test-private-dependency" in pipenv_instance.lockfile["default"] + assert "version" in pipenv_instance.lockfile["default"]["test-private-dependency"] + assert "0.1" in pipenv_instance.lockfile["default"]["test-private-dependency"]["version"] + + +@pytest.mark.install +@pytest.mark.local +@pytest.mark.needs_internet +@flaky +def test_https_dependency_links_install(PipenvInstance, pypi): + """Ensure dependency_links are parsed and installed (needed for private repo dependencies). + """ with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p: os.environ['PIP_PROCESS_DEPENDENCY_LINKS'] = '1' - test_deplink(p, 'git+https://github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') + helper_dependency_links_install_test( + p, + 'git+https://github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1' + ) + +@pytest.mark.install +@pytest.mark.local +@pytest.mark.needs_internet +@pytest.mark.needs_github_ssh +@flaky +def test_ssh_dependency_links_install(PipenvInstance, pypi): + """Ensure dependency_links are parsed and installed (needed for private repo dependencies). + """ with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p: os.environ['PIP_PROCESS_DEPENDENCY_LINKS'] = '1' - test_deplink(p, 'git+ssh://git@github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1') + helper_dependency_links_install_test( + p, + 'git+ssh://git@github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1' + ) @pytest.mark.e From dd3b2108628ed8409524e0b9f76861f6a0d372d1 Mon Sep 17 00:00:00 2001 From: Alexandros Tzannes Date: Mon, 6 Aug 2018 10:41:16 -0700 Subject: [PATCH 11/19] Wrap two tests and helpers in a class --- tests/integration/test_install_twists.py | 89 ++++++++++++------------ 1 file changed, 46 insertions(+), 43 deletions(-) diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index 5de15a2a..d9e571e1 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -57,10 +57,17 @@ zip_safe=False assert "six" in p.lockfile["default"] -def helper_dependency_links_install_make_setup(pipenv_instance, deplink): - setup_py = os.path.join(pipenv_instance.path, "setup.py") - with open(setup_py, "w") as fh: - contents = """ +class TestDependencyLinks(object): + """Ensure dependency_links are parsed and installed. + + This is needed for private repo dependencies. + """ + + @staticmethod + def helper_dependency_links_install_make_setup(pipenv_instance, deplink): + setup_py = os.path.join(pipenv_instance.path, "setup.py") + with open(setup_py, "w") as fh: + contents = """ from setuptools import setup setup( @@ -74,48 +81,44 @@ setup( '{0}' ] ) - """.strip().format(deplink) - fh.write(contents) + """.strip().format(deplink) + fh.write(contents) + @staticmethod + def helper_dependency_links_install_test(pipenv_instance, deplink): + TestDependencyLinks.helper_dependency_links_install_make_setup(pipenv_instance, deplink) + c = pipenv_instance.pipenv("install -v -e .") + assert c.return_code == 0 + assert "test-private-dependency" in pipenv_instance.lockfile["default"] + assert "version" in pipenv_instance.lockfile["default"]["test-private-dependency"] + assert "0.1" in pipenv_instance.lockfile["default"]["test-private-dependency"]["version"] -def helper_dependency_links_install_test(pipenv_instance, deplink): - helper_dependency_links_install_make_setup(pipenv_instance, deplink) - c = pipenv_instance.pipenv("install -v -e .") - assert c.return_code == 0 - assert "test-private-dependency" in pipenv_instance.lockfile["default"] - assert "version" in pipenv_instance.lockfile["default"]["test-private-dependency"] - assert "0.1" in pipenv_instance.lockfile["default"]["test-private-dependency"]["version"] + @pytest.mark.install + @pytest.mark.local + @pytest.mark.needs_internet + @flaky + def test_https_dependency_links_install(self, PipenvInstance, pypi): + """Ensure dependency_links are parsed and installed (needed for private repo dependencies). + """ + with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p: + os.environ['PIP_PROCESS_DEPENDENCY_LINKS'] = '1' + TestDependencyLinks.helper_dependency_links_install_test( + p, + 'git+https://github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1' + ) - -@pytest.mark.install -@pytest.mark.local -@pytest.mark.needs_internet -@flaky -def test_https_dependency_links_install(PipenvInstance, pypi): - """Ensure dependency_links are parsed and installed (needed for private repo dependencies). - """ - with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p: - os.environ['PIP_PROCESS_DEPENDENCY_LINKS'] = '1' - helper_dependency_links_install_test( - p, - 'git+https://github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1' - ) - - -@pytest.mark.install -@pytest.mark.local -@pytest.mark.needs_internet -@pytest.mark.needs_github_ssh -@flaky -def test_ssh_dependency_links_install(PipenvInstance, pypi): - """Ensure dependency_links are parsed and installed (needed for private repo dependencies). - """ - with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p: - os.environ['PIP_PROCESS_DEPENDENCY_LINKS'] = '1' - helper_dependency_links_install_test( - p, - 'git+ssh://git@github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1' - ) + @pytest.mark.install + @pytest.mark.local + @pytest.mark.needs_internet + @pytest.mark.needs_github_ssh + @flaky + def test_ssh_dependency_links_install(self, PipenvInstance, pypi): + with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p: + os.environ['PIP_PROCESS_DEPENDENCY_LINKS'] = '1' + TestDependencyLinks.helper_dependency_links_install_test( + p, + 'git+ssh://git@github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1' + ) @pytest.mark.e From 86bbec18d9a6dbd58be5e15bf5c47bbd74c8d69b Mon Sep 17 00:00:00 2001 From: Alexandros Tzannes Date: Mon, 6 Aug 2018 10:44:10 -0700 Subject: [PATCH 12/19] Factor-out decorators for class tests --- tests/integration/test_install_twists.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index d9e571e1..8653e2c0 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -57,6 +57,10 @@ zip_safe=False assert "six" in p.lockfile["default"] +@pytest.mark.install +@pytest.mark.local +@pytest.mark.needs_internet +@flaky class TestDependencyLinks(object): """Ensure dependency_links are parsed and installed. @@ -93,10 +97,6 @@ setup( assert "version" in pipenv_instance.lockfile["default"]["test-private-dependency"] assert "0.1" in pipenv_instance.lockfile["default"]["test-private-dependency"]["version"] - @pytest.mark.install - @pytest.mark.local - @pytest.mark.needs_internet - @flaky def test_https_dependency_links_install(self, PipenvInstance, pypi): """Ensure dependency_links are parsed and installed (needed for private repo dependencies). """ @@ -107,11 +107,7 @@ setup( 'git+https://github.com/atzannes/test-private-dependency@v0.1#egg=test-private-dependency-v0.1' ) - @pytest.mark.install - @pytest.mark.local - @pytest.mark.needs_internet @pytest.mark.needs_github_ssh - @flaky def test_ssh_dependency_links_install(self, PipenvInstance, pypi): with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p: os.environ['PIP_PROCESS_DEPENDENCY_LINKS'] = '1' From c6742a84305ed5dae6c0d3b95eba0404e85cd5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B6=E4=BB=B6?= Date: Tue, 7 Aug 2018 09:33:21 +0800 Subject: [PATCH 13/19] Minor tense changes with basics.rst --- docs/basics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics.rst b/docs/basics.rst index 8d7ff825..678f58a4 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -326,7 +326,7 @@ You should do this for your shell too, in your ``~/.profile`` or ``~/.bashrc`` o .. note:: The shell launched in interactive mode. This means that if your shell reads its configuration from a specific file for interactive mode (e.g. bash by default looks for a ``~/.bashrc`` configuration file for interactive mode), then you'll need to modify (or create) this file. -If you get something wrong with ``$ pipenv shell``, just check ``PIPENV_SHELL`` environment variable, ``$ pipenv shell`` will use it if available. For detail, see :ref:`configuration-with-environment-variables`. +If you experience issues with ``$ pipenv shell``, just check the ``PIPENV_SHELL`` environment variable, which ``$ pipenv shell`` will use if available. For detail, see :ref:`configuration-with-environment-variables`. ☤ A Note about VCS Dependencies ------------------------------- From f9471d8e7e533bc71e00ca622609c15f4ffb2eab Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Tue, 7 Aug 2018 12:13:14 +0800 Subject: [PATCH 14/19] Fix Jinja2 mismatching --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 92110aa5..71c58644 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -7,7 +7,7 @@ docutils==0.14 first==2.0.1 idna==2.6 imagesize==0.7.1 -Jinja2==2.9.6 +Jinja2==2.10 MarkupSafe==1.0 pbr==3.1.1 pip-tools==1.9.0 From 1a5133c6f8457576a64b593c8ac577aba9771970 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Tue, 7 Aug 2018 12:14:35 +0800 Subject: [PATCH 15/19] Fix spaces in the warning message --- pipenv/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipenv/core.py b/pipenv/core.py index db60ee94..e84bafd5 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -550,8 +550,8 @@ def ensure_project( ): click.echo( "{0}: Your Pipfile requires {1} {2}, " - "but you are using {3} ({4}). Running" - "{5} and rebuilding the virtual environment" + "but you are using {3} ({4}). Running " + "{5} and rebuilding the virtual environment " "may resolve the issue".format( crayons.red("Warning", bold=True), crayons.normal("python_version", bold=True), From 908ad9d1bcb49eed20f6e439fd24f9c3a26db3c9 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Tue, 7 Aug 2018 12:21:49 +0800 Subject: [PATCH 16/19] Split the message into multiple lines --- pipenv/core.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pipenv/core.py b/pipenv/core.py index e84bafd5..31adf699 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -550,15 +550,19 @@ def ensure_project( ): click.echo( "{0}: Your Pipfile requires {1} {2}, " - "but you are using {3} ({4}). Running " - "{5} and rebuilding the virtual environment " - "may resolve the issue".format( + "but you are using {3} ({4}).".format( crayons.red("Warning", bold=True), crayons.normal("python_version", bold=True), crayons.blue(project.required_python_version), crayons.blue(python_version(path_to_python)), crayons.green(shorten_path(path_to_python)), - crayons.green("`pipenv --rm`"), + ), + err=True, + ) + click.echo( + " {0} and rebuilding the virtual environment " + "may resolve the issue.".format( + crayons.green("$ pipenv --rm"), ), err=True, ) From 92caefcb96a0d29c6e76db0b0e03484f0847bfa8 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Fri, 10 Aug 2018 04:41:12 -0400 Subject: [PATCH 17/19] Add news entry for #2671 --- news/2671.doc | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2671.doc diff --git a/news/2671.doc b/news/2671.doc new file mode 100644 index 00000000..859cc377 --- /dev/null +++ b/news/2671.doc @@ -0,0 +1 @@ +Added additional information about troubleshooting ``pipenv shell`` by using the the ``$PIPENV_SHELL`` environment variable. From a646b836bf791c54221049ce03111d9d5905e687 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Sun, 12 Aug 2018 04:27:22 +0800 Subject: [PATCH 18/19] Correctly pass verbosity to resolver --- pipenv/resolver.py | 13 ++++++++++--- pipenv/utils.py | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pipenv/resolver.py b/pipenv/resolver.py index e4c9b09b..6526d990 100644 --- a/pipenv/resolver.py +++ b/pipenv/resolver.py @@ -22,6 +22,7 @@ def which(*args, **kwargs): def main(): do_pre = "--pre" in " ".join(sys.argv) do_clear = "--clear" in " ".join(sys.argv) + is_verbose = "--verbose" in " ".join(sys.argv) is_debug = "--debug" in " ".join(sys.argv) system = "--system" in " ".join(sys.argv) new_sys_argv = [] @@ -35,11 +36,17 @@ def main(): os.environ["PIP_PYTHON_VERSION"] = ".".join([str(s) for s in sys.version_info[:3]]) os.environ["PIP_PYTHON_PATH"] = sys.executable - if int(os.environ.get("PIPENV_VERBOSITY", 0)) > 0: - logging.getLogger("notpip").setLevel(logging.INFO) + + verbosity = int(os.environ.get("PIPENV_VERBOSITY", 0)) if is_debug: - # Shit's getting real at this point. + verbosity = max(verbosity, 2) + elif is_verbose: + verbosity = max(verbosity, 1) + if verbosity > 1: # Shit's getting real at this point. logging.getLogger("notpip").setLevel(logging.DEBUG) + elif verbosity > 0: + logging.getLogger("notpip").setLevel(logging.INFO) + if "PIPENV_PACKAGES" in os.environ: packages = os.environ["PIPENV_PACKAGES"].strip().split("\n") else: diff --git a/pipenv/utils.py b/pipenv/utils.py index 1f0f4ef4..9d0427b7 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -352,11 +352,10 @@ def venv_resolve_deps( if not deps: return [] resolver = escape_grouped_arguments(resolver.__file__.rstrip("co")) - cmd = "{0} {1} {2} {3} {4} {5}".format( + cmd = "{0} {1} {2} {3} {4}".format( escape_grouped_arguments(which("python", allow_global=allow_global)), resolver, "--pre" if pre else "", - "--verbose" if (environments.is_verbose()) else "", "--clear" if clear else "", "--system" if allow_global else "", ) @@ -364,6 +363,7 @@ def venv_resolve_deps( os.environ["PIPENV_PACKAGES"] = "\n".join(deps) if pypi_mirror: os.environ["PIPENV_PYPI_MIRROR"] = str(pypi_mirror) + os.environ["PIPENV_VERBOSITY"] = str(environments.PIPENV_VERBOSITY) c = delegator.run(cmd, block=True) try: assert c.return_code == 0 From f4f8f10f2ededf0d8ffbb0a7e138ee4ab9738975 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Sun, 12 Aug 2018 04:36:46 +0800 Subject: [PATCH 19/19] News --- news/2732.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2732.bugfix diff --git a/news/2732.bugfix b/news/2732.bugfix new file mode 100644 index 00000000..d1cf591b --- /dev/null +++ b/news/2732.bugfix @@ -0,0 +1 @@ +Correctly pass `verbose` and `debug` flags to the resolver subprocess so it generates appropriate output. This also resolves a bug introduced by the fix to #2527.