From f3c8b0d71a2e169f41a41f88088a1da2170b27f3 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 1 Oct 2017 06:31:41 -0400 Subject: [PATCH] max_rounds Signed-off-by: Kenneth Reitz --- pipenv/environments.py | 3 +++ pipenv/utils.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pipenv/environments.py b/pipenv/environments.py index 43683572..3e763bf6 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -19,6 +19,9 @@ PIPENV_COLORBLIND = bool(os.environ.get('PIPENV_COLORBLIND')) # Disable spinner for better test and deploy logs (for the unworthy). PIPENV_NOSPIN = bool(os.environ.get('PIPENV_NOSPIN')) +# Tells Pipenv how many rounds of resolving to do for Pip-Tools. +PIPENV_MAX_ROUNDS = int(os.environ.get('PIPENV_MAX_ROUNDS', '16')) + # Specify a custom Pipfile location. PIPENV_PIPFILE = os.environ.get('PIPENV_PIPFILE') diff --git a/pipenv/utils.py b/pipenv/utils.py index 1b19eb4f..284aad13 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -31,7 +31,7 @@ from pip.exceptions import DistributionNotFound from requests.exceptions import HTTPError from .pep508checker import lookup -from .environments import SESSION_IS_INTERACTIVE +from .environments import SESSION_IS_INTERACTIVE, PIPENV_MAX_ROUNDS specifiers = [k for k in lookup.keys()] @@ -418,7 +418,7 @@ def resolve_deps(deps, which, which_pip, project, sources=None, verbose=False, p resolver = Resolver(constraints=constraints, repository=pypi, clear_caches=clear, prereleases=pre) # pre-resolve instead of iterating to avoid asking pypi for hashes of editable packages try: - resolved_tree.update(resolver.resolve()) + resolved_tree.update(resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS)) except (NoCandidateFound, DistributionNotFound, HTTPError) as e: click.echo( '{0}: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.\n '