From e9687933d17206346d9ced0747cdfda04dc310ec Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 22 Sep 2017 19:39:40 -0400 Subject: [PATCH] maybe fix a bug Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 53 ++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index f3a77387..fa3b5e36 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -660,6 +660,32 @@ def do_install_dependencies( ): """"Executes the install functionality.""" + def cleanup_procs(procs, concurrent): + for c in procs: + + if concurrent: + c.block() + + if 'Ignoring' in c.out: + click.echo(crayons.yellow(c.out)) + + if verbose: + click.echo(crayons.blue(c.out or c.err)) + + # The Installtion failed... + if c.return_code != 0: + + # Save the Failed Dependency for later. + failed_deps_list.append((c.dep, ignore_hash)) + + # Alert the user. + click.echo( + '{0} {1}! Will try again.'.format( + crayons.red('An error occured while installing'), + crayons.green(c.dep.split('--hash')[0].strip()) + ) + ) + if requirements: bare = True @@ -738,32 +764,11 @@ def do_install_dependencies( procs.append(c) if len(procs) >= PIPENV_MAX_SUBPROCESS or len(procs) == len(deps_list): - for c in procs: - - if concurrent: - c.block() - - if 'Ignoring' in c.out: - click.echo(crayons.yellow(c.out)) - - if verbose: - click.echo(crayons.blue(c.out or c.err)) - - # The Installtion failed... - if c.return_code != 0: - - # Save the Failed Dependency for later. - failed_deps_list.append((c.dep, ignore_hash)) - - # Alert the user. - click.echo( - '{0} {1}! Will try again.'.format( - crayons.red('An error occured while installing'), - crayons.green(c.dep.split('--hash')[0].strip()) - ) - ) + cleanup_procs(procs, concurrent) procs = [] + cleanup_procs(procs, concurrent) + # Iterate over the hopefully-poorly-packaged dependencies... if failed_deps_list: