#NEWLINE# def _link_package_versions( self , link , search_name ) : #NEWLINE# #INDENT# '\n        Return an iterable of triples (pkg_resources_version_key,\n        link, python_version) that can be extracted from the given\n        link.\n\n        Meant to be overridden by subclasses, not called by clients.\n        ' #NEWLINE# platform = get_platform ( ) #NEWLINE# version = None #NEWLINE# if link . egg_fragment : #NEWLINE# #INDENT# egg_info = link . egg_fragment #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( egg_info , ext ) = link . splitext ( ) #NEWLINE# if ( not ext ) : #NEWLINE# #INDENT# if ( link not in self . logged_links ) : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping link %s; not a file' % link ) ) #NEWLINE# self . logged_links . add ( link ) #NEWLINE# #UNINDENT# return [ ] #NEWLINE# #UNINDENT# if egg_info . endswith ( '.tar' ) : #NEWLINE# #INDENT# egg_info = egg_info [ : ( - 4 ) ] #NEWLINE# ext = ( '.tar' + ext ) #NEWLINE# #UNINDENT# if ( ext not in self . _known_extensions ( ) ) : #NEWLINE# #INDENT# if ( link not in self . logged_links ) : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping link %s; unknown archive format: %s' % ( link , ext ) ) ) #NEWLINE# self . logged_links . add ( link ) #NEWLINE# #UNINDENT# return [ ] #NEWLINE# #UNINDENT# if ( ( 'macosx10' in link . path ) and ( ext == '.zip' ) ) : #NEWLINE# #INDENT# if ( link not in self . logged_links ) : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping link %s; macosx10 one' % link ) ) #NEWLINE# self . logged_links . add ( link ) #NEWLINE# #UNINDENT# return [ ] #NEWLINE# #UNINDENT# if ( ext == wheel_ext ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# wheel = Wheel ( link . filename ) #NEWLINE# #UNINDENT# except InvalidWheelFilename : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping %s because the wheel filename is invalid' % link ) ) #NEWLINE# return [ ] #NEWLINE# #UNINDENT# if ( wheel . name . lower ( ) != search_name . lower ( ) ) : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping link %s; wrong project name (not %s)' % ( link , search_name ) ) ) #NEWLINE# return [ ] #NEWLINE# #UNINDENT# if ( not wheel . supported ( ) ) : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping %s because it is not compatible with this Python' % link ) ) #NEWLINE# return [ ] #NEWLINE# #UNINDENT# comes_from = getattr ( link , 'comes_from' , None ) #NEWLINE# if ( ( ( not platform . startswith ( 'win' ) ) and ( not platform . startswith ( 'macosx' ) ) ) and ( comes_from is not None ) and urlparse . urlparse ( comes_from . url ) . netloc . endswith ( 'pypi.python.org' ) ) : #NEWLINE# #INDENT# if ( not wheel . supported ( tags = supported_tags_noarch ) ) : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping %s because it is a pypi-hosted binary Wheel on an unsupported platform' % link ) ) #NEWLINE# return [ ] #NEWLINE# #UNINDENT# #UNINDENT# version = wheel . version #NEWLINE# #UNINDENT# #UNINDENT# if ( not version ) : #NEWLINE# #INDENT# version = self . _egg_info_matches ( egg_info , search_name , self ) #NEWLINE# #UNINDENT# if ( version is None ) : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping link %s; wrong project name (not %s)' % ( link , search_name ) ) ) #NEWLINE# return [ ] #NEWLINE# #UNINDENT# if ( ( link . internal is not None ) and ( not link . internal ) and ( not ( normalize_name ( search_name ) . lower ( ) in self . allow_external ) ) and ( not self . allow_all_external ) ) : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping %s because it is externally hosted.' % link ) ) #NEWLINE# self . need_warn_external = True #NEWLINE# return [ ] #NEWLINE# #UNINDENT# if ( ( link . verifiable is not None ) and ( not link . verifiable ) and ( not ( normalize_name ( search_name ) . lower ( ) in self . allow_unverified ) ) ) : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping %s because it is an insecure and unverifiable file.' % link ) ) #NEWLINE# self . need_warn_unverified = True #NEWLINE# return [ ] #NEWLINE# #UNINDENT# match = self . _py_version_re . search ( version ) #NEWLINE# if match : #NEWLINE# #INDENT# version = version [ : match . start ( ) ] #NEWLINE# py_version = match . group ( 1 ) #NEWLINE# if ( py_version != sys . version [ : 3 ] ) : #NEWLINE# #INDENT# logger . debug ( ( 'Skipping %s because Python version is incorrect' % link ) ) #NEWLINE# return [ ] #NEWLINE# #UNINDENT# #UNINDENT# logger . debug ( ( 'Found link %s, version: %s' % ( link , version ) ) ) #NEWLINE# return [ ( pkg_resources . parse_version ( version ) , link , version ) ]