@,bi+2SSKJr SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK r SSK r SSK r SSK r SSK r SSKrSSKrSSKrSSKrSSKrSSKJr SSKJrJr SSKJrJr SSKJrJr SSKJrJr SS K J!r! SS K"J#r# SS K$J%r% SS KJ&r& SS K'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/ /SQr0"SS\15r2"SS5r3"SS5r4"SS\55r6"SS\ Rn5r8"SS5r9"SS5r:"SS\:5r;"SS \%5r<"S!S"5r="S#S$5r>"S%S&5r?"S'S(\<5r@"S)S*\;5rAS9S+jrBS:S,jrCS;S-jrDSS2jrJS?S3jrKS@S4jrLS5rMSAS6jrNSBS7jrOS8rPg)C) annotationsN)_meta)FreezableDefaultDictPair) method_cache pass_none)always_iterableunique_everseen)PackageMetadata SimplePath)suppress) import_module)MetaPathFinder)starmap)AnyIterableListMappingMatchOptionalSetcast) DistributionDistributionFinderr PackageNotFoundError distribution distributions entry_pointsfilesmetadatapackages_distributionsrequiresversionc6\rSrSrSrSSjr\SSj5rSrg)r1zThe package was not found.c SUR3$)Nz"No package metadata was found for nameselfs B/opt/alt/python313/lib64/python3.13/importlib/metadata/__init__.py__str__PackageNotFoundError.__str__4s3DII;??c"URunU$N)argsr+r)s r,r)PackageNotFoundError.name7s)) r/Nreturnstr) __name__ __module__ __qualname____firstlineno____doc__r-propertyr)__static_attributes__r5r/r,rr1s$@r/rc\rSrSrSr\R "S5R5r\ S5r \ S Sj5r \ S Sj5r Srg) Sectioned=a8 A simple entry point config parser for performance >>> for item in Sectioned.read(Sectioned._sample): ... print(item) Pair(name='sec1', value='# comments ignored') Pair(name='sec1', value='a = 1') Pair(name='sec1', value='b = 2') Pair(name='sec2', value='a = 2') >>> res = Sectioned.section_pairs(Sectioned._sample) >>> item = next(res) >>> item.name 'sec1' >>> item.value Pair(name='a', value='1') >>> item = next(res) >>> item.value Pair(name='b', value='2') >>> item = next(res) >>> item.name 'sec2' >>> item.value Pair(name='a', value='2') >>> list(res) [] zm [sec1] # comments ignored a = 1 b = 2 [sec2] a = 2 cBSURXRS95$)Nc3# UHAnURcMUR[R"UR5S9v MC g7f)N)value)r)_replacerparserE).0sections r, *Sectioned.section_pairs..hs; <|| >G  4::gmm#<  =`_ for more information. >>> ep = EntryPoint( ... name=None, group=None, value='package.module:attr [extra1, extra2]') >>> ep.module 'package.module' >>> ep.attr 'attr' >>> ep.extras ['extra1', 'extra2'] zH(?P[\w.]+)\s*(:\s*(?P[\w.]+)\s*)?((?P\[.*\])\s*)?$r8r)rEgroupNzOptional[Distribution]distc6[U5RXUS9 g)Nr)rErlvarsupdate)r+r)rErls r,__init__EntryPoint.__init__s T t>r/c8[[URRUR55n[ UR S55n[SUR S5=(d SRS55n[R"[X25$)zLoad the entry point from its definition. If only a module is indicated by the value, return that module. Otherwise, return the named object. moduleNattr.) rrpatternmatchrErrlrVsplit functoolsreducegetattr)r+r{rvattrss r,loadEntryPoint.loadsn UDLL..tzz:;u{{845tekk&17R>>sCD77r/cxURRUR5nUceURS5$)Nrvrzr{rErlr+r{s r,rvEntryPoint.modules5 ""4::.   {{8$$r/cxURRUR5nUceURS5$)Nrwrrs r,rwEntryPoint.attrs5 ""4::.   {{6""r/cURRUR5nUce[R"SUR S5=(d S5$)Nz\w+extrasrx)rzr{rErefindallrlrs r,rEntryPoint.extrassE ""4::.   zz&%++h"7"=2>>r/c6[U5RUS9 U$)Nrmrp)r+rms r,_forEntryPoint._fors T t$ r/c ^U4SjU5n[[[RUR 5U55$)a EntryPoint matches the given parameters. >>> ep = EntryPoint(group='foo', name='bar', value='bing:bong [extra1, extra2]') >>> ep.matches(group='foo') True >>> ep.matches(name='bar', value='bing:bong [extra1, extra2]') True >>> ep.matches(group='foo', name='other') False >>> ep.matches() True >>> ep.matches(extras=['extra1', 'extra2']) True >>> ep.matches(module='bing') True >>> ep.matches(attr='bong') True c3<># UHn[TU5v M g7fr1r)rHparamr+s r,rJ%EntryPoint.matches..s:6%u%%6s)allrWoperatoreqvalues)r+paramsrs` r,matchesEntryPoint.matchess-(;6:3x{{FMMOU;<BZZN! % r/c4[UR55$r1)hashrr*s r,__hash__EntryPoint.__hash__sDIIK  r/r5)r)r8rEr8rlr8r7None)r7rr6r7z List[str])r7int)r9r:r;r<r=rcompilerz__annotations__rmrsrr>rvrwrrrrrrrrrr?r5r/r,rjrj~s jj %G  I J J#'D '?8%% ## ?? =.1*+B !r/rjc~\rSrSrSrSrS SjrSrS Sjr\ SSj5r \ SSj5r \ S 5r \S 5rSrg ) EntryPointsz; An immutable collection of selectable EntryPoint objects. r5cx[[URUS955$![a [ U5ef=f)z+ Get the EntryPoint in self matching name. r()nextiterselect StopIterationKeyErrorr3s r, __getitem__EntryPoints.__getitem__s; !T[[d[345 5 !4.  !s #9cPURR<S[U5<S3$)zb Repr with classname and tuple constructor to signal that we deviate from regular tuple behavior. (r) __class__r9tupler*s r,rEntryPoints.__repr__ s  >>22E$K@@r/c .^[U4SjU55$)z^ Select entry points from self that match the given parameters (typically group and/or name). c3X># UHoR"S0TD6(dMUv M! g7fNr5)r)rHeprs r,rJ%EntryPoints.select..sE" 0DV0D22s* *)r)r+rs `r,rEntryPoints.selects EEEEr/cDUVs1sHoRiM sn$s snf)z2 Return the set of all names of all entry points. r(r+rs r,namesEntryPoints.namess #''$B$'''cDUVs1sHoRiM sn$s snf)z3 Return the set of all groups of all entry points. )rlrs r,groupsEntryPoints.groupss $((4R4(((rcF^U"U4SjURU555$)Nc3D># UHoRT5v M g7fr1)r)rHrrms r,rJ-EntryPoints._from_text_for..(s@+?R774==+? ) _from_text)rOrPrms `r,_from_text_forEntryPoints._from_text_for&s@3>>$+?@@@r/cLS[RU=(d S55$)Nc3# UHBn[URRURRURS9v MD g7f)roN)rjrEr))rHitems r,rJ)EntryPoints._from_text..,s6 ; DJJOO4::3C3C499 U;sA A rx)rArQ)rPs r,rEntryPoints._from_text*s# !// ;  r/N)r)r8r7rjr7r)r7zSet[str])r9r:r;r<r= __slots__rrrr>rrrgrrhrr?r5r/r,rrsqI!AF(( )) AA  r/rcZ\rSrSr%SrS\S'S\S'S\S'SSS jjrSS jrSS jrS r g ) PackagePathi2z"A reference to a path in a packagezOptional[FileHash]rrsizerrmc<UR5RUS9$)Nencoding)locate read_text)r+rs r,rPackagePath.read_text9s{{}&&&99r/c>UR5R5$r1)r read_bytesr*s r, read_binaryPackagePath.read_binary<s{{}''))r/c8URRU5$)z'Return a path-like object for this path)rm locate_filer*s r,rPackagePath.locate?syy$$T**r/r5N)utf-8)rr8r7r8)r7bytes)r7r ) r9r:r;r<r=rrrrr?r5r/r,rr2s%,  I :*+r/rc(\rSrSrSSjrSSjrSrg)FileHashiDc@URS5uUlo lg)N=) partitionmoderE)r+spec_s r,rsFileHash.__init__Es#'>>##6  1jr/c<SURSURS3$)NzrrEr*s r,rFileHash.__repr__Hs!$))HTZZLBBr/rN)rr8r7rr6)r9r:r;r<rsrr?r5r/r,rrDs 7Cr/rc(^\rSrSrU4SjrSrU=r$)DeprecatedNonAbstractiLc R>[R"U5VVs1sHn[U5HoDiM M nnnUVs1sH"n[[X5SS5(dM UiM$ nnU(a[R "SU3[ SS9 [TU]!U5$s snnfs snf)N__isabstractmethod__FzUnimplemented abstract methods ) stacklevel) inspectgetmrorqrwarningswarnDeprecationWarningsuper__new__)rOr2kwargssubclassr) all_namesabstractrs r,rDeprecatedNonAbstract.__new__Ns!(!4 !4XhDD!4  " !ws)+A5I !   MM1(<"  ws##  sBB$#B$r5)r9r:r;r<rr? __classcell__rs@r,rrLs $$r/rc\rSrSrSr\R SSj5r\R SSj5r\ SSj5r \ SS.SSjj5r \ S S j5r \ S 5r\S!S j5r\S"S j5r\S 5r\S"Sj5r\S#Sj5r\S$Sj5rSrSrSr\S%Sj5rSrSr\ S5r\ S5r\S5rSrSr g)&ri`a* An abstract Python distribution package. Custom providers may derive from this class and define the abstract methods to provide a concrete implementation for their environment. Some providers may opt to override the default implementation of some properties to bypass the file-reading mechanism. cg)a`Attempt to load metadata file given by the name. Python distribution metadata is organized by blobs of text typically represented as "files" in the metadata directory (e.g. package-1.0.dist-info). These files include things like: - METADATA: The distribution metadata including fields like Name and Version and Description. - entry_points.txt: A series of entry points as defined in `the entry points spec `_. - RECORD: A record of files according to `this recording spec `_. A package may provide any set of files, including those not listed here or none at all. :param filename: The name of the file in the distribution info. :return: The text if found, otherwise None. Nr5r+filenames r,rDistribution.read_textkr/cg)zI Given a path to a file in this distribution, return a SimplePath to it. Nr5r+paths r,rDistribution.locate_filerr/cU(d [S5e[[URUS955$![a [ U5ef=f)avReturn the Distribution for the given package name. :param name: The name of the distribution package to search for. :return: The Distribution instance (or subclass thereof) for the named package, if found. :raises PackageNotFoundError: When the named package's distribution metadata cannot be found. :raises ValueError: When an invalid value is supplied for name. z A distribution name is required.r() ValueErrorrrdiscoverrr)rOr)s r, from_nameDistribution.from_namesM?@ @ -S\\t\456 6 -&t, , -s 5A N)contextc ^T(aU(a [S5eT=(d [R"S0UD6m[RR U4SjUR 555$)a Return an iterable of Distribution objects for all packages. Pass a ``context`` or pass keyword arguments for constructing a context. :context: A ``DistributionFinder.Context`` object. :return: Iterable of Distribution objects for packages matching the context. z cannot accept context and kwargsc32># UH o"T5v M g7fr1r5)rHresolverr)s r,rJ(Distribution.discover..s- .G(HW  .Gsr5)r%rContext itertoolschain from_iterable_discover_resolvers)rOr)rs ` r,r&Distribution.discovers\ v?@ @A/77A&A,,- .1.E.E.G-   r/c@[[R"U55$)zReturn a Distribution for the indicated metadata path. :param path: a string or path-like object :return: a concrete Distribution instance for the path )PathDistributionpathlibPathr"s r,atDistribution.ats  T 233r/cHS[R5n[SU5$)z9Search the meta_path for resolvers (MetadataPathFinders).c3<# UHn[USS5v M g7f)find_distributionsNr)rHfinders r,rJ3Distribution._discover_resolvers..s  FSFGF0$ 7 7msN)sys meta_pathrV)declareds r,r2 Distribution._discover_resolverss$ FImm dH%%r/cSSKJn URS5=(d) URS5=(d URS5n[[U5nUR [ R"U55$)aFReturn the parsed metadata for this Distribution. The returned object will have keys that name the various bits of metadata per the `Core metadata specifications `_. Custom providers may provide the METADATA file or override this property. r) _adaptersMETADATAzPKG-INFOrx)rxrErrr8Messageemailmessage_from_string)r+rEopt_textrPs r,r!Distribution.metadatash  NN: & "~~j) " ~~b! C"  !:!:4!@AAr/c URS$)z8Return the 'Name' metadata for the distribution package.Namer!r*s r,r)Distribution.names}}V$$r/c@[RUR5$)z(Return a normalized version of the name.)Prepared normalizer)r*s r,_normalized_nameDistribution._normalized_names!!$)),,r/c URS$)z;Return the 'Version' metadata for the distribution package.VersionrNr*s r,r$Distribution.versions}}Y''r/cL[RURS5U5$)z Return EntryPoints for this distribution. Custom providers may provide the ``entry_points.txt`` file or override this property. zentry_points.txt)rrrr*s r,rDistribution.entry_pointss!))$..9K*LdSSr/c^^SU4Sjjm[U4Sj5n[S5nU"U"TR5=(d' TR5=(d TR555$)aFiles in this distribution. :return: List of PackagePath for this distribution or None Result is `None` if the metadata file that enumerates files (i.e. RECORD for dist-info, or installed-files.txt or SOURCES.txt for egg-info) is missing. Result may be empty if the metadata exists but is empty. Custom providers are recommended to provide a "RECORD" file (in ``read_text``) or override this property to allow for callers to be able to resolve filenames provided by the package. c>[U5nU(a [U5OSUlU(a [U5OSUlTUlU$r1)rrrrrrm)r)rsize_strresultr+s r, make_file%Distribution.files..make_files7 &F,0(4.dFK+3#h-FKFKMr/cB>SSKn[TURU55$)Nr)csvrreader)r\rar^s r, make_files&Distribution.files..make_files s 9cjj&78 8r/c.[[SU55$)Nc>UR5R5$r1)rexistsr8s r,@Distribution.files..skip_missing_files..sDKKM,@,@,Br/)listrV) package_pathss r,skip_missing_files.Distribution.files..skip_missing_filessBMRS Sr/)NN)r _read_files_distinfo_read_files_egginfo_installed_read_files_egginfo_sources)r+rcrlr^s` @r,r Distribution.filessw    9  9  T  T" ))+65576335   r/cVURS5nU=(a UR5$)z Read the lines of RECORD. RECORD)rrYr+rPs r,rn!Distribution._read_files_distinfos$~~h')))r/c^^TRS5n[TSS5mU(aT(dgUU4SjUR55n[SRU5$)a Read installed-files.txt and return lines in a similar CSV-parsable format as RECORD: each file must be placed relative to the site-packages directory and must also be quoted (since file names can contain literal commas). This file is written when the package is installed by pip, but it might not be written for other installation methods. Assume the file is accurate if it exists. zinstalled-files.txt_pathNc3># UHQnTU- R5RTRS5R5SS9R5v MS g7f)rxT)walk_upN)resolve relative_toras_posix)rHr)r+subdirs r,rJ=Distribution._read_files_egginfo_installed..7sU * d] WY [))"-557[ F XZ *sAA"{}")rrrYrWformat)r+rPpathsr}s` @r,ro*Distribution._read_files_egginfo_installed$sW~~34w-6  )  6==%((r/c~URS5nU=(a$ [SRUR55$)a Read SOURCES.txt and return lines in a similar CSV-parsable format as RECORD: each file name must be quoted (since it might contain literal commas). Note that SOURCES.txt is not a reliable source for what files are installed by a package. This file is generated for a source archive, and the files that are present there (e.g. setup.py) may not correctly reflect the files that are present after the package has been installed. z SOURCES.txtr)rrWrrYrts r,rp(Distribution._read_files_egginfo_sources@s/~~m,=FMM4??+<==r/cxUR5=(d UR5nU=(a [U5$)z6Generated requirements specified for this Distribution)_read_dist_info_reqs_read_egg_info_reqsrj)r+reqss r,r#Distribution.requiresOs/((*Hd.F.F.H"T "r/c8URRS5$)Nz Requires-Dist)r!get_allr*s r,r!Distribution._read_dist_info_reqsUs}}$$_55r/cZURS5n[UR5"U5$)Nz requires.txt)rr _deps_from_requires_text)r+sources r,r Distribution._read_egg_info_reqsXs&/667??r/cJUR[RU55$r1)%_convert_egg_info_reqs_to_simple_reqsrArM)rOrs r,r%Distribution._deps_from_requires_text\s889OPPr/c#^# SmU4SjnSnUH9nU"UR5nURU-U"UR5-v M; g7f)a Historically, setuptools would solicit and store 'extra' requirements, including those with environment markers, in separate sections. More modern tools expect each dependency to be defined separately, with any relevant extras and environment markers attached directly to that requirement. This method converts the former to the latter. See _test_deps_from_requires_text for an example. c U=(a SUS3$)Nz extra == ""r5r(s r,make_conditionJDistribution._convert_egg_info_reqs_to_simple_reqs..make_conditionls0ja0 0r/c >U=(d SnURS5upnU(a U(aSUS3n[[SUT"U5/55nU(aSSRU5-$S$)Nrx:rrz; z and )rrjrVjoin)rIextrasepmarkers conditionsrs r, quoted_markerIDistribution._convert_egg_info_reqs_to_simple_reqs..quoted_markerosimG")"3"3C"8 EgYa.fTG^E5J+KLMJ6@4',,z22 Hb Hr/cSSU;-$)zi PEP 508 requires a space between the url_spec and the quoted_marker. Ref python/importlib_metadata#357.  @r5)reqs r, url_req_spaceIDistribution._convert_egg_info_reqs_to_simple_reqs..url_req_spacews #*% %r/N)rEr))sectionsrrrIspacers @r,r2Distribution._convert_egg_info_reqs_to_simple_reqs`sM 1 I & G!'--0E--%'- *EE E sA Ac$URS5$)Nzdirect_url.json) _load_jsonr*s r,originDistribution.origins011r/c^[[R5"URU5SS9$)Nc.[R"S0UD6$r)typesSimpleNamespace)datas r,rh)Distribution._load_json..sU%:%:%BT%Br/) object_hook)r jsonloadsrrs r,rDistribution._load_jsons'$ NN8 $B  r/r5)r7 Optional[str]r"str | os.PathLike[str]r7r )r)r8r7r)r)z$Optional[DistributionFinder.Context]r7Iterable[Distribution])r"rr7r)r7_meta.PackageMetadatar6r)r7Optional[List[PackagePath]])r7Optional[List[str]])!r9r:r;r<r=abcabstractmethodrrrgr'r&rhr9r2r>r!r)rSr$rr rnrorpr#rrrrrrr?r5r/r,rr`s   ,   --"@D =   &44&&BB0%%--((TT( ( T*)8 >## 6@QQ F FD22 r/rcd\rSrSrSr"SS5r\R\"54SSjj5rSr g) riz A MetaPathFinder capable of discovering installed distributions. Custom providers should implement this interface in order to supply metadata. c8\rSrSrSrSrSr\SSj5rSr g)DistributionFinder.Contextia Keyword arguments presented by the caller to ``distributions()`` or ``Distribution.discover()`` to narrow the scope of a search for distributions in all DistributionFinders. Each DistributionFinder may expect any parameters and should attempt to honor the canonical parameters defined below when appropriate. This mechanism gives a custom provider a means to solicit additional details from the caller beyond "name" and "path" when searching distributions. For example, imagine a provider that exposes suites of packages in either a "public" or "private" ``realm``. A caller may wish to query only for distributions in a particular realm and could call ``distributions(realm="private")`` to signal to the custom provider to only include distributions from that realm. Nc 8[U5RU5 gr1rp)r+rs r,rs#DistributionFinder.Context.__init__s J  f %r/cT[U5RS[R5$)z The sequence of directory path that a distribution finder should search. Typically refers to Python installed package paths such as "site-packages" directories and defaults to ``sys.path``. r")rqgetr@r"r*s r,r"DistributionFinder.Context.paths:>>&#((3 3r/r5r) r9r:r;r<r=r)rsr>r"r?r5r/r,r.rs, ,  &  4  4r/r.cg)z Find distributions. Return an iterable of all Distribution instances capable of loading the metadata for packages matching the ``context``, a DistributionFinder.Context instance. Nr5)r+r)s r,r=%DistributionFinder.find_distributionsrr/r5Nr7r) r9r:r;r<r=r.rrr=r?r5r/r,rrs1)4)4V )0  r/rc^\rSrSrSr\R "5U4Sj5rSrSr Sr Sr Sr \ S 5r\S 5rS rU=r$) FastPathiaM Micro-optimized class for searching a root for children. Root is a path on the file system that may contain metadata directories either as natural directories or within a zip file. >>> FastPath('').children() ['...'] FastPath objects are cached and recycled for any given root. >>> FastPath('foobar') is FastPath('foobar') True c">[TU]U5$r1)rr)rOrootrs r,rFastPath.__new__sws##r/cXlgr1)r)r+rs r,rsFastPath.__init__s r/cD[R"URU5$r1)r6r7r)r+childs r,joinpathFastPath.joinpaths||DIIu--r/c[[5 [R"UR=(d S5sSSS5 $!,(df  O=f[[5 UR 5sSSS5 $!,(df  /$=fNry)r Exceptionoslistdirr zip_childrenr*s r,childrenFastPath.childrensP i ::dii.3/! i $$&!  s)A A#A== B c[R"UR5nURR5nURUl[ R SU55$)Nc3f# UH'oR[RS5Sv M) g7f)rrN)r| posixpathr)rHrs r,rJ(FastPath.zip_children..s"Q5%[[:1=5s/1)zipfiler7rnamelistrdictfromkeys)r+zip_pathrs r,rFastPath.zip_childrensH<< * &&( )) }}Q5QQQr/cVURUR5RU5$r1)lookupmtimesearchr3s r,rFastPath.searchs {{4::&--d33r/c[[5 [R"UR5R sSSS5 $!,(df  O=fUR R5 gr1)rOSErrorrstatrst_mtimer cache_clearr*s r,rFastPath.mtimes< g 77499%..   !s *A Ac[U5$r1)Lookup)r+rs r,rFastPath.lookups d|r/)rr)r9r:r;r<r=r} lru_cacherrsrrrrr>rrrr?rrs@r,rrsg $$.R4"" r/rc,\rSrSrSrSSjrSSjrSrg) rizC A micro-optimized class for searching a (fast) path for metadata. c[RRUR5R 5nUR S5n[ [5Ul[ [5Ul UR5GH nUR 5nUR S5(ajURS5SRS5Sn[RU5nURURUR!U55 MU(dMUS:XdMURS5SRS5Sn[R#U5nURURUR!U55 GM URR%5 URR%5 g)z Calculate all of the children representing metadata. From the children in the path, calculate early all of the children that appear to represent metadata (infos) or legacy metadata (eggs). z.eggz .dist-infoz .egg-inforyr-zegg-infoN)rr"basenamerlowerr[rrjinfoseggsr rpartitionrrQrRappendrlegacy_normalizefreeze) r+r"base base_is_eggrlowr) normalizedlegacy_normalizeds r,rsLookup.__init__sLww *002mmF+ )$/ (. ]]_E++-C||788~~c*1-77>> none = Prepared(None) >>> none.normalized >>> none.legacy_normalized >>> bool(none) False >>> sample = Prepared('Sample__Pkg-name.foo') >>> sample.normalized 'sample_pkg_name_foo' >>> sample.legacy_normalized 'sample__pkg_name.foo' >>> bool(sample) True NcpXlUcgURU5UlURU5Ulgr1)r)rRrrr r3s r,rsPrepared.__init__Ls2 < ...!%!6!6t!<r/cn[R"SSU5R5RSS5$)z3 PEP 503 normalization plus dashes as underscores. z[-_.]+rr)rsubrreplacer(s r,rRPrepared.normalizeSs- vvid+113;;CEEr/cBUR5RSS5$)zd Normalize the package name as found in the convention in older packaging tools versions and specs. rr)rrr(s r,rPrepared.legacy_normalizeZs zz|##C--r/c,[UR5$r1)boolr)r*s r,__bool__Prepared.__bool__bsDIIr/)r r)r)r)r) r9r:r;r<r=rr rsrhrRrrr?r5r/r,rQrQ5sH&J=FF ..r/rQcp\rSrSr\\R 54SSjj5r\S5r\SSj5r Sr g) MetadataPathFinderifcnURURUR5n[[U5$)z Find distributions. Return an iterable of all Distribution instances capable of loading the metadata for packages matching ``context.name`` (or all names if ``None`` indicated) along the paths in the list of directories ``context.path``. ) _search_pathsr)r"rWr5)rOr)founds r,r=%MetadataPathFinder.find_distributionsgs,!!',, =#U++r/c^[U5m[RRU4Sj[ [ U555$)z1Find metadata directories in paths heuristically.c3D># UHoRT5v M g7fr1)r)rHr"r s r,rJ3MetadataPathFinder._search_paths..zs- .BdKK ! !.Br)rQr/r0r1rWr)rOr)rr s @r,r MetadataPathFinder._search_pathsvs9D>,,- .1(E.B-   r/c@[RR5 gr1)rrr)rOs r,invalidate_caches$MetadataPathFinder.invalidate_caches~s$$&r/r5N)r7zIterable[PathDistribution])r7r) r9r:r;r<rgrr.r=rr&r?r5r/r,rrfsP'//1 , # , ,  ''r/rc^\rSrSrSSjrS Sjr\R R\lS Sjr\ U4Sj5r \ S5r Sr U=r$) r5icXlg)zVConstruct a distribution. :param path: SimplePath indicating the metadata directory. Nrwr!s r,rsPathDistribution.__init__s  r/c[[[[[[ 5 UR RU5RSS9sSSS5 $!,(df  g=f)Nrr) rFileNotFoundErrorIsADirectoryErrorrNotADirectoryErrorPermissionErrorrwrrrs r,rPathDistribution.read_textsP        ::&&x0::G:L   s (A A$c4URRU- $r1)rwparentr!s r,rPathDistribution.locate_fileszz  4''r/c>[RR[UR55n[ [ R5"URU55=(d [TU]($)zb Performance optimization: where possible, resolve the normalized name from the file system path. ) rr"rr8rwr rQrR_name_from_stemrrS)r+stemrs r,rS!PathDistribution._normalized_namesQ wwDJJ0 h(( )$*>*>t*D E (w' r/c~[RRU5upUS;agURS5up4nU$)z >>> PathDistribution._name_from_stem('foo-3.0.egg-info') 'foo' >>> PathDistribution._name_from_stem('CherryPy-3.0.dist-info') 'CherryPy' >>> PathDistribution._name_from_stem('face.egg-info') 'face' >>> PathDistribution._name_from_stem('foo.bar') rNr)rr"splitextr)r7rextr)rrests r,r6 PathDistribution._name_from_stems?((.  1 1 ",,S14 r/r*)r"r r7r)rrr7rr)r9r:r;r<rsrrr=rr>rSrhr6r?rrs@r,r5r5sP %..66I(    r/r5c,[RU5$)zGet the ``Distribution`` instance for the named package. :param distribution_name: The name of the distribution package as a string. :return: A ``Distribution`` instance (or subclass thereof). )rr'distribution_names r,rrs  ! !"3 44r/c .[R"S0UD6$)ztGet all ``Distribution`` instances in the current environment. :return: An iterable of ``Distribution`` instances. r5)rr&)rs r,rrs  *6 **r/c@[RU5R$)zGet the metadata for the named package. :param distribution_name: The name of the distribution package to query. :return: A PackageMetadata containing the parsed metadata. )rr'r!r?s r,r!r!s  ! !"3 4 = ==r/c,[U5R$)zGet the version string for the named package. :param distribution_name: The name of the distribution package to query. :return: The version string for the package as defined in the package's "Version" metadata key. )rr$r?s r,r$r$s ) * 2 22r/rS)keyc [RRS[[ 5555n[ U5R "S0UD6$)zReturn EntryPoint objects for all installed packages. Pass selection parameters (group or name) to filter the result to entry points matching those properties (see EntryPoints.select()). :return: EntryPoints for all installed packages. c38# UHoRv M g7fr1)r)rHrms r,rJentry_points..s(&>d&>sr5)r/r0r1_uniquerrr)repss r,rrsG // ' '(&-mo&>( C s  " " ,V ,,r/c,[U5R$)zReturn a list of files for the named package. :param distribution_name: The name of the distribution package to query. :return: List of files composing the distribution. )rr r?s r,r r s ) * 0 00r/c,[U5R$)z Return a list of requirements for the named package. :return: An iterable of requirements, suitable for packaging.requirement.Requirement. )rr#r?s r,r#r#s ) * 3 33r/c[R"[5n[5HGn[ U5=(d [ U5H#nXR URS5 M% MI [U5$)z Return a mapping of top-level packages to their distributions. >>> import collections.abc >>> pkgs = packages_distributions() >>> all(isinstance(dist, collections.abc.Sequence) for dist in pkgs.values()) True rM) collections defaultdictrjr_top_level_declared_top_level_inferredrr!r) pkg_to_distrmpkgs r,r"r" se))$/K&t,I0CD0IIC   # #DMM&$9 :J   r/cRURS5=(d SR5$)Nz top_level.txtrx)rr|rs r,rOrOs NN? + 1r 8 8 ::r/c2URtpU(aU$S$)z: Return the top-most parent as long as there is a parent. N)parts)r)topr<s r,_topmostrWsJC3 D r/cv[U5=(d( [R"U5=(d [U5$)a Infer a possibly importable module name from a name presumed on sys.path. >>> _get_toplevel_name(PackagePath('foo.py')) 'foo' >>> _get_toplevel_name(PackagePath('foo')) 'foo' >>> _get_toplevel_name(PackagePath('foo.pyc')) 'foo' >>> _get_toplevel_name(PackagePath('foo/__init__.py')) 'foo' >>> _get_toplevel_name(PackagePath('foo.pth')) 'foo.pth' >>> _get_toplevel_name(PackagePath('foo.dist-info')) 'foo.dist-info' )rWr  getmodulenamer8r(s r,_get_toplevel_namerZ&s/$ D> d#  t9r/cv[[[[UR555nSn[ X!5$)Nc SU;$rr5r(s r,importable_name,_top_level_inferred..importable_nameBs $r/)setrWrZr r rV)rm opt_namesr]s r,rPrP?s/C*ODJJ,GHII / --r/)r@r8r7rr)r@r8r7r)r@r8r7r8r)r@r8r7r)r@r8r7r)r7zMapping[str, List[str]])r)rr7r)r)rr7r8)Q __future__rrrrr@rrHrr r6rrrcrr}r/rrMrxr _collectionsrr _functoolsrr _itertoolsr r r r contextlibr importlibr importlib.abcrrtypingrrrrrrrr__all__ModuleNotFoundErrorrrArjrr PurePosixPathrrrrrrrrQrr5rrr!r$partial attrgetterrHrr r#r"rOrWrZrPr5r/r,rns}" 4/8.#(KKK  . >1>1By!y!x5 %5 p+'''+$CC$$(k (k \ ; ; |33l0,0,f..b'+':4|4n5+>3   ./  -14";!2.r/