#NEWLINE# def _filter_download_requires( self ) : #NEWLINE# #INDENT# yum_map = self . _get_known_yum_packages ( ) #NEWLINE# pip_origins = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for line in self . pips_to_install : #NEWLINE# #INDENT# req = pip_helper . extract_requirement ( line ) #NEWLINE# pip_origins [ req . key ] = line #NEWLINE# #UNINDENT# pips_to_download = [ ] #NEWLINE# req_to_install = [ pip_helper . extract_requirement ( line ) for line in self . pips_to_install ] #NEWLINE# requested_names = [ req . key for req in req_to_install ] #NEWLINE# rpm_names = self . py2rpm_helper . names_to_rpm_names ( requested_names ) #NEWLINE# satisfied_list = [ ] #NEWLINE# for req in req_to_install : #NEWLINE# #INDENT# rpm_name = rpm_names [ req . key ] #NEWLINE# rpm_info = self . _find_yum_match ( yum_map , req , rpm_name ) #NEWLINE# if ( not rpm_info ) : #NEWLINE# #INDENT# pips_to_download . append ( pip_origins [ req . key ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# satisfied_list . append ( ( req , rpm_name , rpm_info ) ) #NEWLINE# #UNINDENT# #UNINDENT# yum_buff = six . StringIO ( ) #NEWLINE# if satisfied_list : #NEWLINE# #INDENT# repos = collections . defaultdict ( list ) #NEWLINE# for ( req , rpm_name , rpm_info ) in satisfied_list : #NEWLINE# #INDENT# repo = rpm_info [ 'repo' ] #NEWLINE# rpm_found = ( '%s-%s' % ( rpm_name , rpm_info [ 'version' ] ) ) #NEWLINE# repos [ repo ] . append ( ( '%s as %s' % ( colorizer . quote ( req ) , colorizer . quote ( rpm_found ) ) ) ) #NEWLINE# dep_info = { #NEWLINE# #INDENT# 'requirement' : str ( req ) , #NEWLINE# 'rpm' : rpm_info , #NEWLINE# #UNINDENT# } #NEWLINE# yum_buff . write ( json . dumps ( dep_info ) ) #NEWLINE# yum_buff . write ( '\n' ) #NEWLINE# #UNINDENT# for r in sorted ( repos . keys ( ) ) : #NEWLINE# #INDENT# header = '%s Python packages are already available as RPMs from repository %s' #NEWLINE# header = ( header % ( len ( repos [ r ] ) , colorizer . quote ( r ) ) ) #NEWLINE# utils . log_iterable ( sorted ( repos [ r ] ) , logger = LOG , header = header , color = None ) #NEWLINE# #UNINDENT# #UNINDENT# sh . write_file ( self . yum_satisfies_filename , yum_buff . getvalue ( ) ) #NEWLINE# return pips_to_download