#NEWLINE# def _do_install_dependency( logger , project , dependency , upgrade , force_reinstall , target_dir , log_file ) : #NEWLINE# #INDENT# batch = isinstance ( dependency , collections . Iterable ) #NEWLINE# pip_command_line = list ( ) #NEWLINE# pip_command_line . extend ( PIP_EXEC_STANZA ) #NEWLINE# pip_command_line . append ( 'install' ) #NEWLINE# pip_command_line . extend ( build_pip_install_options ( project . get_property ( 'install_dependencies_index_url' ) , project . get_property ( 'install_dependencies_extra_index_url' ) , upgrade , project . get_property ( 'install_dependencies_insecure_installation' ) , force_reinstall , target_dir , project . get_property ( 'verbose' ) , project . get_property ( 'install_dependencies_trusted_host' ) ) ) #NEWLINE# pip_command_line . extend ( as_pip_install_target ( dependency ) ) #NEWLINE# logger . debug ( 'Invoking pip: %s' , pip_command_line ) #NEWLINE# exit_code = execute_command ( pip_command_line , log_file , env = os . environ , shell = False ) #NEWLINE# if ( exit_code != 0 ) : #NEWLINE# #INDENT# if batch : #NEWLINE# #INDENT# dependency_name = ' batch dependencies.' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dependency_name = ( " dependency '%s'." % dependency . name ) #NEWLINE# #UNINDENT# if project . get_property ( 'verbose' ) : #NEWLINE# #INDENT# print_file_content ( log_file ) #NEWLINE# raise BuildFailedException ( ( 'Unable to install%s' % dependency_name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise BuildFailedException ( 'Unable to install%s See %s for details.' , dependency_name , log_file )