From cf21597953058c5fe784c8fdb1ec4e2bc758605f Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 25 Apr 2020 01:49:52 -0400 Subject: [PATCH] Allow additional installation attempts - If pep517 failure occurs on a retry, allow additional attempts to install with pep517 re-enabled - This might happen if the install locations in the environment don't align with the expected location when pip compares an editable dependency (i.e. an egg link) - This should fix the related CI failures that have been popping up here and there Signed-off-by: Dan Ryan --- pipenv/core.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index ec2a9b80..e26b6d50 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -677,6 +677,9 @@ def _cleanup_procs(procs, failed_deps_queue, retry=True): click.echo(crayons.blue(c.out.strip() or c.err.strip())) # The Installation failed… if failed: + # If there is a mismatch in installed locations or the install fails + # due to wrongful disabling of pep517, we should allow for + # additional passes at installation if "does not match installed location" in c.err: project.environment.expand_egg_links() click.echo("{0}".format( @@ -687,6 +690,10 @@ def _cleanup_procs(procs, failed_deps_queue, retry=True): ) )) dep = c.dep.copy() + dep.use_pep517 = True + elif "Disabling PEP 517 processing is invalid" in c.err: + dep = c.dep.copy() + dep.use_pep517 = True elif not retry: # The Installation failed… # We echo both c.out and c.err because pip returns error details on out. @@ -698,6 +705,7 @@ def _cleanup_procs(procs, failed_deps_queue, retry=True): else: # Alert the user. dep = c.dep.copy() + dep.use_pep517 = False click.echo( "{0} {1}! Will try again.".format( crayons.red("An error occurred while installing"), @@ -760,7 +768,7 @@ def batch_install(deps_list, procs, failed_deps_queue, del os.environ["GIT_CONFIG"] use_pep517 = True if failed and not dep.is_vcs: - use_pep517 = False + use_pep517 = getattr(dep, "use_pep517", False) c = pip_install( dep,