Skip to content

Commit

Permalink
Don't override PIP_NO_DEPS by default
Browse files Browse the repository at this point in the history
- 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 <dan@danryan.co>
  • Loading branch information
techalchemy committed Jun 18, 2019
1 parent a453cdb commit bd3720d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 47 deletions.
64 changes: 25 additions & 39 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions news/3763.feature.rst
Original file line number Diff line number Diff line change
@@ -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.
17 changes: 10 additions & 7 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bd3720d

Please sign in to comment.