From bd3720d3b1016088dbcb09ab18e7518352a72d7b Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Mon, 17 Jun 2019 16:01:16 -0400 Subject: [PATCH] Don't override PIP_NO_DEPS by default - We used to override `PIP_NO_DEPS` by default when handling VCS or file dependencies - This PR exempts VCS and file dependencies from that rule since we are able to resolve them in a pre-lock resolution step - Fixes #3763 Signed-off-by: Dan Ryan --- Pipfile.lock | 64 +++++++++++++++++-------------------------- news/3763.feature.rst | 1 + pipenv/core.py | 17 +++++++----- tests/pypi | 2 +- 4 files changed, 37 insertions(+), 47 deletions(-) create mode 100644 news/3763.feature.rst diff --git a/Pipfile.lock b/Pipfile.lock index da7768f964..1675ad80ab 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -107,10 +107,10 @@ }, "certifi": { "hashes": [ - "sha256:59b7658e26ca9c7339e00f8f4636cdfe59d34fa37b9b04f6f9e9926b3cece1a5", - "sha256:b26104d6835d1f5e49452a26eb2ff87fe7090b89dfcaee5ea2212697e1e1d7ae" + "sha256:046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939", + "sha256:945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695" ], - "version": "==2019.3.9" + "version": "==2019.6.16" }, "chardet": { "hashes": [ @@ -127,13 +127,6 @@ "index": "pypi", "version": "==7.0" }, - "colorama": { - "hashes": [ - "sha256:05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", - "sha256:f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48" - ], - "version": "==0.4.1" - }, "configparser": { "hashes": [ "sha256:8be81d89d6e7b4c0d4e44bcc525845f6da25821de80cb5e06e7e0238a2899e32", @@ -212,7 +205,7 @@ "sha256:330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca", "sha256:a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50" ], - "markers": "python_version < '3.0'", + "markers": "python_version < '3.3'", "version": "==1.0.2" }, "functools32": { @@ -248,11 +241,11 @@ }, "importlib-metadata": { "hashes": [ - "sha256:027cfc6524613de726789072f95d2e4cc64dd1dee8096d42d13f2ead5bd302f5", - "sha256:0d05199e1f0b1a8707a1b9c46476d4a49807fb56cb1b0737db1d37feb42fe31d" + "sha256:6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", + "sha256:cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==0.15" + "version": "==0.18" }, "incremental": { "hashes": [ @@ -357,13 +350,6 @@ ], "version": "==5.0.0" }, - "orderedmultidict": { - "hashes": [ - "sha256:24e3b730cf84e4a6a68be5cc760864905cf66abc89851e724bd5b4e849eaa96b", - "sha256:b89895ba6438038d0bdf88020ceff876cf3eae0d5c66a69b526fab31125db2c5" - ], - "version": "==1.0" - }, "packaging": { "hashes": [ "sha256:0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af", @@ -402,10 +388,10 @@ }, "pbr": { "hashes": [ - "sha256:6901995b9b686cb90cceba67a0f6d4d14ae003cd59bc12beb61549bdfbe3bc89", - "sha256:d950c64aeea5456bbd147468382a5bb77fe692c13c9f00f0219814ce5b642755" + "sha256:089ccb087e9bd8f278caedfa6c2c5d461381437eda3db750b6834e78b319f404", + "sha256:9fb1c3371344cd617eb073c6c00872e9b0e5a7fefed6cd29f327a1b26ab5c498" ], - "version": "==5.2.0" + "version": "==5.3.0" }, "pipenv": { "editable": true, @@ -456,11 +442,11 @@ }, "pygments": { "hashes": [ - "sha256:36586500a94cd97f8c2c19d251cdb78868d1a822e0e491bfc1d811766aedb772", - "sha256:b437bc0d04dc36f1f5b3592985b3e0a3d0af46b7c39199231706d19a4ee63344" + "sha256:71e430bc85c88a430f000ac1d9b331d2407f681d6f6aec95e8bcfbc3df5b0127", + "sha256:881c4c157e45f30af185c1ffe8d549d48ac9127433f2c380c24b84572ad66297" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.4.1" + "version": "==2.4.2" }, "pyparsing": { "hashes": [ @@ -472,11 +458,11 @@ }, "pytest": { "hashes": [ - "sha256:1a8aa4fa958f8f451ac5441f3ac130d9fc86ea38780dd2715e6d5c5882700b24", - "sha256:b8bf138592384bd4e87338cb0f256bf5f615398a649d4bd83915f0e4047a5ca6" + "sha256:4a784f1d4f2ef198fe9b7aef793e9fa1a3b2f84e822d9b3a64a181293a572d45", + "sha256:926855726d8ae8371803f7b2e6ec0a69953d9c6311fa7c3b6c1b929ff92d27da" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==4.5.0" + "version": "==4.6.3" }, "pytest-forked": { "hashes": [ @@ -498,11 +484,11 @@ }, "pytest-xdist": { "hashes": [ - "sha256:b0bb4b0293ee8657b9eb3ff334a3b6aac4db74fd4a86b81e1982c879237a47eb", - "sha256:f83a485293e81fd57c8a5a85a3f12473a532c5ca7dec518857cbb72766bb526c" + "sha256:3489d91516d7847db5eaecff7a2e623dba68984835dbe6cedb05ae126c4fb17f", + "sha256:501795cb99e567746f30fe78850533d4cd500c93794128e6ab9988e92a17b1f8" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.28.0" + "version": "==1.29.0" }, "pytz": { "hashes": [ @@ -591,11 +577,11 @@ }, "sphinx-click": { "hashes": [ - "sha256:9ceb0ee39e9734f39f593f99499e2a2f8e62929ac0b5f040b1d0411c02efaab7", - "sha256:c9c45127bbbf720f1d24476cb3e57c806dd270662ae63b53a4b23be6c334491e" + "sha256:2c7847607d07bc0ddf28acff3aa639b2660d06c5d95d1efe89eca6494fc750de", + "sha256:814b2463b576dfafaf4a6f8ed9585f6d9696073ed5e4cca5b59d2dc9d29d3bc0" ], "index": "pypi", - "version": "==2.1.0" + "version": "==2.2.0" }, "sphinxcontrib-websupport": { "hashes": [ @@ -669,11 +655,11 @@ }, "virtualenv": { "hashes": [ - "sha256:99acaf1e35c7ccf9763db9ba2accbca2f4254d61d1912c5ee364f9cc4a8942a0", - "sha256:fe51cdbf04e5d8152af06c075404745a7419de27495a83f0d72518ad50be3ce8" + "sha256:b7335cddd9260a3dd214b73a2521ffc09647bde3e9457fcca31dc3be3999d04a", + "sha256:d28ca64c0f3f125f59cabf13e0a150e1c68e5eea60983cc4395d88c584495783" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==16.6.0" + "version": "==16.6.1" }, "virtualenv-clone": { "hashes": [ diff --git a/news/3763.feature.rst b/news/3763.feature.rst new file mode 100644 index 0000000000..544a1ace42 --- /dev/null +++ b/news/3763.feature.rst @@ -0,0 +1 @@ +Pipenv will no longer forcibly override ``PIP_NO_DEPS`` on all vcs and file dependencies as resolution happens on these in a pre-lock step. diff --git a/pipenv/core.py b/pipenv/core.py index 8490cdf2a2..e0df54e375 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -680,11 +680,12 @@ def _cleanup_procs(procs, failed_deps_queue, retry=True): def batch_install(deps_list, procs, failed_deps_queue, - requirements_dir, no_deps=False, ignore_hashes=False, + requirements_dir, no_deps=True, ignore_hashes=False, allow_global=False, blocking=False, pypi_mirror=None, retry=True): from .vendor.requirementslib.models.utils import strip_extras_markers_from_requirement failed = (not retry) + install_deps = not no_deps if not failed: label = INSTALL_LABEL if not PIPENV_HIDE_EMOJIS else "" else: @@ -721,7 +722,9 @@ def batch_install(deps_list, procs, failed_deps_queue, is_artifact = True elif dep.is_vcs: is_artifact = True - needs_deps = not no_deps if no_deps is True else is_artifact + if not PIPENV_RESOLVE_VCS and is_artifact and not dep.editable: + install_deps = True + no_deps = False extra_indexes = [] if not index and indexes: @@ -734,17 +737,17 @@ def batch_install(deps_list, procs, failed_deps_queue, os.environ["PIP_USER"] = vistir.compat.fs_str("0") if "PYTHONHOME" in os.environ: del os.environ["PYTHONHOME"] - if not needs_deps: + if not install_deps and not environments.PIPENV_RESOLVE_VCS: link = getattr(dep.req, "link", None) is_wheel = False if link: is_wheel = link.is_wheel - needs_deps = dep.is_file_or_url and not (is_wheel or dep.editable) + install_deps = dep.is_file_or_url and not (is_wheel or dep.editable) c = pip_install( dep, ignore_hashes=any([ignore_hashes, dep.editable, dep.is_vcs]), allow_global=allow_global, - no_deps=not needs_deps, + no_deps=not install_deps, block=any([dep.editable, dep.is_vcs, blocking]), index=index, requirements_dir=requirements_dir, @@ -803,7 +806,7 @@ def do_install_dependencies( ) ) # Allow pip to resolve dependencies when in skip-lock mode. - no_deps = not skip_lock + 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) @@ -1395,7 +1398,7 @@ def pip_install( if "PIP_SRC" in os.environ: src_dir = os.environ["PIP_SRC"] src = ["--src", os.environ["PIP_SRC"]] - if not requirement.editable: + if not requirement.editable and not environments.PIPENV_RESOLVE_VCS: # Leave this off becauase old lockfiles don't have all deps included # TODO: When can it be turned back on? no_deps = False diff --git a/tests/pypi b/tests/pypi index f3260ec6bf..fbd3539075 160000 --- a/tests/pypi +++ b/tests/pypi @@ -1 +1 @@ -Subproject commit f3260ec6bf5c435865d0def587e7f00f625952e9 +Subproject commit fbd3539075d67494119b0c642707a449bcbd0bd4