From 9ca7543a3255e7f5c4adb1178670fa7a7ddfffc9 Mon Sep 17 00:00:00 2001 From: Denis Otkidach Date: Tue, 11 Feb 2020 19:54:07 +0300 Subject: [PATCH 1/6] Fix setting of PIPENV_RESOLVE_VCS from environ (instroduced in f0e3bbaa) --- pipenv/environments.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pipenv/environments.py b/pipenv/environments.py index 622b76ff..0ca64834 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -247,7 +247,11 @@ PIP_EXISTS_ACTION = os.environ.get("PIP_EXISTS_ACTION", "w") Defaullts to (w)ipe """ -PIPENV_RESOLVE_VCS = _is_env_truthy(os.environ.get("PIPENV_RESOLVE_VCS", 'true')) +PIPENV_RESOLVE_VCS = ( + os.environ.get("PIPENV_RESOLVE_VCS") is None + or _is_env_truthy("PIPENV_RESOLVE_VCS") +) + """Tells Pipenv whether to resolve all VCS dependencies in full. As of Pipenv 2018.11.26, only editable VCS dependencies were resolved in full. From 5e7647878337224df5517281524c80ae62801518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=84=E5=A4=A9=E7=BF=BC?= Date: Fri, 17 Apr 2020 22:20:08 +0800 Subject: [PATCH 2/6] `pipenv lock -r` respect pypi_mirror args --- pipenv/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index fffbfb6b..4810057d 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -791,7 +791,7 @@ def do_install_dependencies( skip_lock=False, concurrent=True, requirements_dir=None, - pypi_mirror=False, + pypi_mirror=None, ): """" Executes the install functionality. @@ -826,6 +826,8 @@ def do_install_dependencies( deps_list = list(lockfile.get_requirements(dev=dev, only=requirements)) if requirements: index_args = prepare_pip_source_args(project.sources) + if pypi_mirror: + index_args.extend(["-i", pypi_mirror]) index_args = " ".join(index_args).replace(" -", "\n-") deps = [ req.as_line(sources=False, include_hashes=False) for req in deps_list From 0052f5e8474df70af9924b42bbb1ef45df586198 Mon Sep 17 00:00:00 2001 From: Yuhki Yano Date: Thu, 23 Apr 2020 14:21:21 +0900 Subject: [PATCH 3/6] Add general installation info --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a8f251db..f22c6776 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,10 @@ Or, if you\'re using FreeBSD: # pkg install py36-pipenv +When none of the above is an option: + + $ pip install pipenv + Otherwise, refer to the [documentation](https://pipenv.pypa.io/en/latest/#install-pipenv-today) for instructions. ✨🍰✨ From 92cff27f246ec50c2a8d5fd2698d47b3a57f341f Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Fri, 24 Apr 2020 20:51:23 +0800 Subject: [PATCH 4/6] use get_source_list --- pipenv/core.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pipenv/core.py b/pipenv/core.py index 2290d977..ec2a9b80 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -830,9 +830,7 @@ def do_install_dependencies( no_deps = not skip_lock # skip_lock true, no_deps False, pip resolves deps deps_list = list(lockfile.get_requirements(dev=dev, only=requirements)) if requirements: - index_args = prepare_pip_source_args(project.sources) - if pypi_mirror: - index_args.extend(["-i", pypi_mirror]) + index_args = prepare_pip_source_args(get_source_list(pypi_mirror=pypi_mirror, project=project)) index_args = " ".join(index_args).replace(" -", "\n-") deps = [ req.as_line(sources=False, include_hashes=False) for req in deps_list From db9f296ebe047e7457ad3a8bb23fa8512ab5e50b Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Fri, 24 Apr 2020 23:28:49 +0800 Subject: [PATCH 5/6] update test --- tests/integration/test_lock.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/integration/test_lock.py b/tests/integration/test_lock.py index 7b81e0be..4f202bea 100644 --- a/tests/integration/test_lock.py +++ b/tests/integration/test_lock.py @@ -379,10 +379,8 @@ fake-package = "*" assert c.return_code == 0 c = p.pipenv('lock -r --pypi-mirror {0}'.format(mirror_url)) assert c.return_code == 0 - assert '-i https://pypi.org/simple' in c.out.strip() + assert '-i {0}'.format(mirror_url) in c.out.strip() assert '--extra-index-url https://test.pypi.org/simple' in c.out.strip() - # Mirror url should not have replaced source URLs - assert '-i {0}'.format(mirror_url) not in c.out.strip() assert '--extra-index-url {}'.format(mirror_url) not in c.out.strip() From 18fcef61ba4b74360ff60b30ee55336bf5ba1c85 Mon Sep 17 00:00:00 2001 From: TennyZhuang Date: Fri, 24 Apr 2020 23:36:19 +0800 Subject: [PATCH 6/6] add news --- news/4199.behavior.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/4199.behavior.rst diff --git a/news/4199.behavior.rst b/news/4199.behavior.rst new file mode 100644 index 00000000..eb1dae3c --- /dev/null +++ b/news/4199.behavior.rst @@ -0,0 +1 @@ +Make sure `pipenv lock -r --pypi-mirror {MIRROR_URL}` will respect the pypi-mirror in requirements output.