a (Reg @s6ddlZddlZGdddZdZeeeddS)Nc@sXeZdZdZdddZeddZdd Zd d Zd d Z ddZ dddZ ddZ dS)VendorImporterz A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. NcCs&||_t||_|p|dd|_dS)NZextern_vendor) root_namesetvendored_namesreplace vendor_pkg)selfrrr rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/extern/__init__.py__init__ s zVendorImporter.__init__ccs|jdVdVdS)zL Search first the vendor package then as a natural package. .N)r r rrr search_paths zVendorImporter.search_pathcCs.||jd\}}}| o,tt|j|jS)z,Figure out if the target module is vendored.r ) partitionranymap startswithr)r fullnamerootbasetargetrrr _module_matches_namespacesz(VendorImporter._module_matches_namespacec Cs~||jd\}}}|jD]F}z.||}t|tj|}|tj|<|WSty`Yq0qtdjfitdS)zK Iterate over the search path to locate and load fullname. r zThe '{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__sysmodules ImportErrorformatlocals)r rrrrprefixZextantmodrrr load_modules     zVendorImporter.load_modulecCs ||jSN)r"name)r specrrr create_module3szVendorImporter.create_modulecCsdSr#r)r modulerrr exec_module6szVendorImporter.exec_modulecCs||rtj||SdS)z(Return a module spec for vendored names.N)r importlibutilspec_from_loader)r rpathrrrr find_spec9szVendorImporter.find_speccCs|tjvrtj|dS)zR Install this importer into sys.meta_path if not already present. N)r meta_pathappendrrrr install@s zVendorImporter.install)rN)NN) __name__ __module__ __qualname____doc__r propertyrrr"r&r(r-r0rrrr rs   r) packaging pyparsingZ ordered_setZmore_itertoolszsetuptools._vendor)importlib.utilr)rrnamesr1r0rrrr sC