mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
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 <dan@danryan.co>
This commit is contained in:
+9
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user