#NEWLINE# def __call__( self , packages = None , index = None , requirements = None , args = '' ) : #NEWLINE# #INDENT# if args : #NEWLINE# #INDENT# args = ( ' ' + args ) #NEWLINE# #UNINDENT# if requirements : #NEWLINE# #INDENT# cmd = ' ' . join ( [ 'pip' , 'install' , '-f' , self . build . files , args , '--no-index' , '-r' , requirements ] ) #NEWLINE# try : #NEWLINE# #INDENT# self . sh ( cmd , log = self . log ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# self . message ( ( 'pip install %s' % requirements ) , 'error' , indent = 8 ) #NEWLINE# if index : #NEWLINE# #INDENT# o_index = ( '-i %s ' % index ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# o_index = '' #NEWLINE# #UNINDENT# cmd = ' ' . join ( [ 'pip' , 'install' , o_index , args , '-r' , requirements ] ) #NEWLINE# self . sh ( cmd , log = self . log ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not isinstance ( packages , ( tuple , list ) ) ) : #NEWLINE# #INDENT# packages = [ packages ] #NEWLINE# #UNINDENT# #UNINDENT# for p in packages : #NEWLINE# #INDENT# self . _install ( args , index , args )