3 ­ž‘eg ã@s6ddlZddlZGdd„dƒZd ZeeedƒjƒdS) éNc@s\eZdZdZfdfdd„Zedd„ƒZdd„Zd d „Zd d „Z d d„Z ddd„Z dd„Z dS)ÚVendorImporterz„ A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. NcCs&||_t|ƒ|_|p|jddƒ|_dS)NZexternÚ_vendor)Ú root_nameÚsetÚvendored_namesÚreplaceÚ vendor_pkg)Úselfrrr©r ú@/tmp/pip-build-vlmub77e/setuptools/setuptools/extern/__init__.pyÚ__init__ s zVendorImporter.__init__ccs|jdVdVdS)zL Search first the vendor package then as a natural package. Ú.ÚN)r)r r r r Ú search_paths zVendorImporter.search_pathcCs.|j|jdƒ\}}}| o,tt|j|jƒƒS)z,Figure out if the target module is vendored.r )Ú partitionrÚanyÚmapÚ startswithr)r ÚfullnameÚrootÚbaseÚtargetr r r Ú_module_matches_namespacesz(VendorImporter._module_matches_namespacec Csz|j|jdƒ\}}}x^|jD]B}y(||}t|ƒtj|}|tj|<|Stk r^YqXqWtdjftƒŽƒ‚dS)zK Iterate over the search path to locate and load fullname. r z•The '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.N) rrrÚ __import__ÚsysÚmodulesÚ ImportErrorÚformatÚlocals)r rrrrÚprefixZextantÚmodr r r Ú load_modules    zVendorImporter.load_modulecCs |j|jƒS)N)r!Úname)r Úspecr r r Ú create_module3szVendorImporter.create_modulecCsdS)Nr )r Úmoduler r r Ú exec_module6szVendorImporter.exec_modulecCs|j|ƒrtjj||ƒSdS)z(Return a module spec for vendored names.N)rÚ importlibÚutilÚspec_from_loader)r rÚpathrr r r Ú find_spec9szVendorImporter.find_speccCs|tjkrtjj|ƒdS)zR Install this importer into sys.meta_path if not already present. N)rÚ meta_pathÚappend)r r r r Úinstall@s zVendorImporter.install)NN) Ú__name__Ú __module__Ú __qualname__Ú__doc__r Úpropertyrrr!r$r&r+r.r r r r rs  rÚ packagingÚ pyparsingÚ ordered_setÚmore_itertoolszsetuptools._vendor)r4r5r6r7)Úimportlib.utilr'rrÚnamesr/r.r r r r ÚsC