1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
U
ß=®dxã @s&ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z ddlZddlZddlmZmZmZddlmZmZddlmZmZmZmZddlmZmZddlm Z m!Z!ddlm"Z"m#Z#dd    l$m%Z%dd
l&m'Z'dd l(m)Z)dd l m*Z*dd l+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1ddddddddddddg Z2Gdd„de3ƒZ4Gdd„dƒZ5Gdd„dƒZ6Gdd „d e6ƒZ7Gd!d"„d"e8ƒZ9Gd#d$„d$ej:ƒZ;Gd%d&„d&ƒZ<Gd'd(„d(ƒZ=Gd)d„de=ƒZ>Gd*d„de)ƒZ?Gd+d,„d,ƒZ@Gd-d.„d.ƒZAGd/d0„d0ƒZBeGd1d2„d2ee?ƒƒZCGd3d4„d4e>ƒZDeEe>d5œd6d„ZFe,e>d7œd8d„ZGeEej"d5œd9d„ZHeEeEd5œd:d„ZIe jJe!ejKd;ZLe9d7œd<d„ZMeEe/e-e;d5œd=d„ZNeEe/e-eEd5œd>d„ZOe.eEe-eEfd7œd?d„ZPd@dA„ZQe;e/eEdBœdCdD„ZRe;eEdBœdEdF„ZSdGdH„ZTdS)IéNé)Ú    _adaptersÚ_metaÚ _py39compat)ÚFreezableDefaultDictÚPair)Ú
NullFinderÚStrPathÚinstallÚ pypy_partial)Ú method_cacheÚ    pass_none)Úalways_iterableÚunique_everseen)ÚPackageMetadataÚ
SimplePath)Úsuppress)Ú import_module)ÚMetaPathFinder)Ústarmap)ÚIterableÚListÚMappingÚOptionalÚSetÚcastÚ DistributionÚDistributionFinderrÚPackageNotFoundErrorÚ distributionÚ distributionsÚ entry_pointsÚfilesÚmetadataÚpackages_distributionsÚrequiresÚversionc@s0eZdZdZedœdd„Zeedœdd„ƒZdS)rzThe package was not found.©ÚreturncCs d|j›S)Nz"No package metadata was found for ©Úname©Úself©r-úRd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\importlib_metadata/__init__.pyÚ__str__7szPackageNotFoundError.__str__cCs |j\}|S©N)Úargs©r,r*r-r-r.r*:szPackageNotFoundError.nameN)Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ústrr/Úpropertyr*r-r-r-r.r4sc@sJeZdZdZe d¡ ¡Zedd„ƒZ    e
d dd„ƒZ e
e dœd    d
„ƒZ dS) Ú    Sectioneda˜
    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
        cCsdd„|j||jdDƒS)Ncss,|]$}|jdk    r|jt |j¡dVqdS)N)Úvalue)r*Ú_replacerÚparser:)Ú.0Úsectionr-r-r.Ú    <genexpr>ks
þz*Sectioned.section_pairs.<locals>.<genexpr>)Úfilter_)ÚreadÚvalid)ÚclsÚtextr-r-r.Ú section_pairsisþzSectioned.section_pairsNccsXt|ttj| ¡ƒƒ}d}|D]4}| d¡o4| d¡}|rF| d¡}qt||ƒVqdS)Nú[ú]z[])ÚfilterÚmapr7ÚstripÚ
splitlinesÚ
startswithÚendswithr)rDr@Úlinesr*r:Z section_matchr-r-r.rAqs
zSectioned.read©ÚlinecCs|o| d¡ S)Nú#)rLrOr-r-r.rB|szSectioned.valid)N)r3r4r5r6ÚtextwrapÚdedentÚlstripZ_sampleÚ classmethodrEÚ staticmethodrAr7rBr-r-r-r.r9@sÿ 
 
r9c@s0eZdZdZejejdee    dƒdZ
dd„Z dS)ÚDeprecatedTuplea
    Provide subscript item access for backward compatibility.
 
    >>> recwarn = getfixture('recwarn')
    >>> ep = EntryPoint(name='name', value='value', group='group')
    >>> ep[:]
    ('name', 'value', 'group')
    >>> ep[0]
    'name'
    >>> len(recwarn)
    1
    zAEntryPoint tuple interface is deprecated. Access members by name.é©Ú
stacklevelcCs| ¡| ¡|Sr0)Ú_warnÚ_key)r,Úitemr-r-r.Ú __getitem__—szDeprecatedTuple.__getitem__N) r3r4r5r6Ú    functoolsÚpartialÚwarningsÚwarnÚDeprecationWarningr r[r^r-r-r-r.rWsürWc@sàeZdZUdZe d¡Zeed<eed<eed<dZ    e
ded<eeedd    œd
d „Z d d „Z e edœdd„ƒZe edœdd„ƒZe eedœdd„ƒZdd„Zdd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zedœd#d$„ZdS)%Ú
EntryPointa An entry point as defined by Python packaging conventions.
 
    See `the packaging docs on entry points
    <https://packaging.python.org/specifications/entry-points/>`_
    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<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+)\s*)?((?P<extras>\[.*\])\s*)?$r*r:ÚgroupNrÚdist)r*r:rer(cCst|ƒj|||ddS)N©r*r:re©ÚvarsÚupdate)r,r*r:rer-r-r.Ú__init__ÈszEntryPoint.__init__cCsD|j |j¡}t| d¡ƒ}td| d¡p,d d¡ƒ}t t    ||¡S)z¦Load the entry point from its definition. If only a module
        is indicated by the value, return that module. Otherwise,
        return the named object.
        ÚmoduleNÚattrÚÚ.)
ÚpatternÚmatchr:rrerHÚsplitr_ÚreduceÚgetattr)r,rqrlÚattrsr-r-r.ÚloadËszEntryPoint.loadr'cCs$|j |j¡}|dk    st‚| d¡S)Nrl©rprqr:ÚAssertionErrorre©r,rqr-r-r.rlÕs zEntryPoint.modulecCs$|j |j¡}|dk    st‚| d¡S)Nrmrwryr-r-r.rmÛs zEntryPoint.attrcCs0|j |j¡}|dk    st‚t d| d¡p,d¡S)Nz\w+Úextrasrn)rprqr:rxÚreÚfindallreryr-r-r.rzás zEntryPoint.extrascCst|ƒj|d|S)N©rfrh)r,rfr-r-r.Ú_forçszEntryPoint._forc s(‡fdd„|Dƒ}tttj| ¡|ƒƒS)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
        c3s|]}tˆ|ƒVqdSr0©rt)r=Úparamr+r-r.r?ÿsz%EntryPoint.matches.<locals>.<genexpr>)ÚallrIÚoperatorÚeqÚvalues)r,Úparamsrur-r+r.ÚmatchesëszEntryPoint.matchescCs|j|j|jfSr0rgr+r-r-r.r\szEntryPoint._keycCs| ¡| ¡kSr0©r\©r,Úotherr-r-r.Ú__lt__szEntryPoint.__lt__cCs| ¡| ¡kSr0r‡rˆr-r-r.Ú__eq__szEntryPoint.__eq__cCs tdƒ‚dS)Nz!EntryPoint objects are immutable.)ÚAttributeError)r,r*r:r-r-r.Ú __setattr__ szEntryPoint.__setattr__cCsd|j›d|j›d|j›dS)NzEntryPoint(name=z, value=z, group=ú)rgr+r-r-r.Ú__repr__sÿzEntryPoint.__repr__cCs t| ¡ƒSr0)Úhashr\r+r-r-r.Ú__hash__szEntryPoint.__hash__)r3r4r5r6r{Úcompilerpr7Ú__annotations__rfrrkrvr8rlrmrrzr~r†r\rŠr‹rrÚintr‘r-r-r-r.rdœs0
ÿ
rdc@speZdZdZdZeedœdd„Zdd„Ze    e
edœd    d
„ƒZ e    e
edœd d „ƒZ e d d„ƒZedd„ƒZdS)Ú EntryPointszC
    An immutable collection of selectable EntryPoint objects.
    r-©r*r(cCs8ztt|j|dƒƒWStk
r2t|ƒ‚YnXdS)z;
        Get the EntryPoint in self matching name.
        r)N)ÚnextÚiterÚselectÚ StopIterationÚKeyErrorr2r-r-r.r^szEntryPoints.__getitem__c st‡fdd„|DƒƒS)zv
        Select entry points from self that match the
        given parameters (typically group and/or name).
        c3s |]}tj|fˆŽr|VqdSr0)rZ
ep_matches©r=Úep©r…r-r.r?-sz%EntryPoints.select.<locals>.<genexpr>)r•)r,r…r-ržr.r™(szEntryPoints.selectr'cCsdd„|DƒS)zB
        Return the set of all names of all entry points.
        cSsh|]
}|j’qSr-r)rœr-r-r.Ú    <setcomp>4sz$EntryPoints.names.<locals>.<setcomp>r-r+r-r-r.Únames/szEntryPoints.namescCsdd„|DƒS)zC
        Return the set of all groups of all entry points.
        cSsh|]
}|j’qSr-)rerœr-r-r.rŸ;sz%EntryPoints.groups.<locals>.<setcomp>r-r+r-r-r.Úgroups6szEntryPoints.groupscs|‡fdd„| |¡DƒƒS)Nc3s|]}| ˆ¡VqdSr0)r~rœr}r-r.r??sz-EntryPoints._from_text_for.<locals>.<genexpr>)Ú
_from_text)rCrDrfr-r}r.Ú_from_text_for=szEntryPoints._from_text_forcCsdd„t |pd¡DƒS)Ncss&|]}t|jj|jj|jdVqdS)rgN)rdr:r*)r=r]r-r-r.r?Csÿz)EntryPoints._from_text.<locals>.<genexpr>rn)r9rE)rDr-r-r.r¢As þzEntryPoints._from_textN)r3r4r5r6Ú    __slots__r7rdr^r™r8rr r¡rUr£rVr¢r-r-r-r.r•s    
r•c@s^eZdZUdZeded<eed<ded<deedœd    d
„Ze    d œd d „Z
e j d œdd„Z dS)Ú PackagePathz"A reference to a path in a packageÚFileHashrÚsizerrfúutf-8)Úencodingr(c
Cs0| ¡j|d}| ¡W5QR£SQRXdS)N©r©©ÚlocateÚopenrA)r,r©Ústreamr-r-r.Ú    read_textPszPackagePath.read_textr'c
Cs.| ¡ d¡}| ¡W5QR£SQRXdS)NÚrbr«)r,r®r-r-r.Ú read_binaryTszPackagePath.read_binarycCs |j |¡S)z'Return a path-like object for this path)rfÚ locate_filer+r-r-r.r¬XszPackagePath.locateN)r¨)r3r4r5r6rr“r”r7r¯Úbytesr±ÚpathlibÚPathr¬r-r-r-r.r¥Is
 r¥c@s*eZdZeddœdd„Zedœdd„ZdS)r¦N)Úspecr(cCs| d¡\|_}|_dS)Nú=)Ú    partitionÚmoder:)r,r¶Ú_r-r-r.rk^szFileHash.__init__r'cCsd|j›d|j›dS)Nz<FileHash mode: z value: ú>)r¹r:r+r-r-r.raszFileHash.__repr__)r3r4r5r7rkrr-r-r-r.r¦]sr¦cseZdZ‡fdd„Z‡ZS)ÚDeprecatedNonAbstractcsLdd„t ˆ¡Dƒ}‡fdd„|Dƒ}|r@tjd|›tddtƒ ˆ¡S)NcSsh|]}t|ƒD]}|’qqSr-)ri)r=Úsubclassr*r-r-r.rŸgs
z0DeprecatedNonAbstract.__new__.<locals>.<setcomp>cs"h|]}ttˆ|ƒddƒr|’qS)Ú__isabstractmethod__Fr©r=r*©rCr-r.rŸjsþzUnimplemented abstract methods rXrY)ÚinspectÚgetmrorarbrcÚsuperÚ__new__)rCr1ÚkwargsZ    all_namesZabstract©Ú    __class__rÀr.rÄfsÿ
þýzDeprecatedNonAbstract.__new__)r3r4r5rÄÚ __classcell__r-r-rÆr.r¼esr¼c@sTeZdZdZejeedœdd„ƒZeje    e
j dœdd„ƒZ e eddœd    d
„ƒZe eddœd d „ƒZee    ddœd d„ƒZedd„ƒZeejdœdd„ƒZeedœdd„ƒZedd„ƒZeedœdd„ƒZeedœdd„ƒZeeeedœdd„ƒZdd„Z dd „Z!d!d"„Z"eeeedœd#d$„ƒZ#d%d&„Z$d'd(„Z%e d)d*„ƒZ&ed+d,„ƒZ'd-S).rzA Python distribution package.r'cCsdS)z¶Attempt to load metadata file given by the name.
 
        :param filename: The name of the file in the distribution info.
        :return: The text if found, otherwise None.
        Nr-©r,Úfilenamer-r-r.r¯{szDistribution.read_text©Úpathr(cCsdS)z[
        Given a path to a file in this distribution, return a path
        to it.
        Nr-©r,rÌr-r-r.r²ƒszDistribution.locate_filer–cCsD|s tdƒ‚ztt|j|dƒƒWStk
r>t|ƒ‚YnXdS)a®Return 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)N)Ú
ValueErrorr—r˜Údiscoverršr)rCr*r-r-r.Ú    from_nameŠs zDistribution.from_namec sJ| dd¡‰ˆr|rtdƒ‚ˆp*tjf|މtj ‡fdd„| ¡Dƒ¡S)aReturn 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 all packages.
        ÚcontextNz cannot accept context and kwargsc3s|]}|ˆƒVqdSr0r-)r=Úresolver©rÑr-r.r?ªsz(Distribution.discover.<locals>.<genexpr>)ÚpoprÎrÚContextÚ    itertoolsÚchainÚ from_iterableÚ_discover_resolvers)rCrÅr-rÓr.rϜs
ÿzDistribution.discovercCstt |¡ƒS)z°Return a Distribution for the indicated metadata path
 
        :param path: a string or path-like object
        :return: a concrete Distribution instance for the path
        )ÚPathDistributionr´rµ©rÌr-r-r.Úat®szDistribution.atcCsdd„tjDƒ}td|ƒS)z#Search the meta_path for resolvers.css|]}t|ddƒVqdS)Úfind_distributionsNr)r=Úfinderr-r-r.r?ºsz3Distribution._discover_resolvers.<locals>.<genexpr>N)ÚsysÚ    meta_pathrH)Zdeclaredr-r-r.rÙ·sÿz Distribution._discover_resolverscCs8| d¡p| d¡p| d¡}tt|ƒ}t t |¡¡S)z°Return the parsed metadata for this Distribution.
 
        The returned object will have keys that name the various bits of
        metadata.  See PEP 566 for details.
        ÚMETADATAzPKG-INFOrn)r¯rr7rÚMessageÚemailÚmessage_from_string)r,Zopt_textrDr-r-r.r#¿s
ÿú
zDistribution.metadatacCs
|jdS)z8Return the 'Name' metadata for the distribution package.ÚName©r#r+r-r-r.r*ÑszDistribution.namecCs t |j¡S)z(Return a normalized version of the name.)ÚPreparedÚ    normalizer*r+r-r-r.Ú_normalized_nameÖszDistribution._normalized_namecCs
|jdS)z;Return the 'Version' metadata for the distribution package.ÚVersionrær+r-r-r.r&ÛszDistribution.versioncCst | d¡|¡S)Nzentry_points.txt)r•r£r¯r+r-r-r.r!àszDistribution.entry_pointscsJd‡fdd„    ‰t‡fdd„ƒ}tdd„ƒ}||ˆ ¡pDˆ ¡pDˆ ¡ƒƒS)    aZFiles 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.
        Ncs6t|ƒ}|rt|ƒnd|_|r&t|ƒnd|_ˆ|_|Sr0)r¥r¦rr”r§rf)r*rZsize_strÚresultr+r-r.Ú    make_fileðs
z%Distribution.files.<locals>.make_filecstˆt |¡ƒSr0)rÚcsvÚreader)rN)rìr-r.Ú
make_files÷sz&Distribution.files.<locals>.make_filescSsttdd„|ƒƒS)NcSs | ¡ ¡Sr0)r¬ÚexistsrÛr-r-r.Ú<lambda>ýóz@Distribution.files.<locals>.skip_missing_files.<locals>.<lambda>)ÚlistrH)Z package_pathsr-r-r.Úskip_missing_filesûsz.Distribution.files.<locals>.skip_missing_files)NN)r Ú_read_files_distinfoÚ_read_files_egginfo_installedÚ_read_files_egginfo_sources)r,rïrôr-)rìr,r.r"äs 
ÿýÿzDistribution.filescCs| d¡}|o| ¡S)z*
        Read the lines of RECORD
        ÚRECORD)r¯rK©r,rDr-r-r.rõs
z!Distribution._read_files_distinfocsFˆ d¡}tˆddƒ‰|rˆs"dS‡‡fdd„| ¡Dƒ}tdj|ƒS)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Ú_pathNc3s.|]&}ˆ| ¡ ˆ d¡ ¡¡ ¡VqdS)rnN)ÚresolveÚ relative_tor²Úas_posixr¿©r,Úsubdirr-r.r?!sü  þz=Distribution._read_files_egginfo_installed.<locals>.<genexpr>ú"{}")r¯rtrKrIÚformat)r,rDÚpathsr-rþr.rös
  ûz*Distribution._read_files_egginfo_installedcCs| d¡}|otdj| ¡ƒS)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)r¯rIrrKrùr-r-r.r÷*s
z(Distribution._read_files_egginfo_sourcescCs| ¡p| ¡}|ot|ƒS)z6Generated requirements specified for this Distribution)Ú_read_dist_info_reqsÚ_read_egg_info_reqsró)r,Úreqsr-r-r.r%9szDistribution.requirescCs |j d¡S)Nz Requires-Dist)r#Úget_allr+r-r-r.r?sz!Distribution._read_dist_info_reqscCs| d¡}t|jƒ|ƒS)Nz requires.txt)r¯r Ú_deps_from_requires_text)r,Úsourcer-r-r.rBs
z Distribution._read_egg_info_reqscCs| t |¡¡Sr0)Ú%_convert_egg_info_reqs_to_simple_reqsr9rA)rCrr-r-r.rFsz%Distribution._deps_from_requires_textc#sJdd„‰‡fdd„}dd„}|D]$}||jƒ}|j|||jƒVq dS)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.
        cSs|od|›dS)Nz
extra == "ú"r-r)r-r-r.Úmake_conditionVszJDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.make_conditioncsX|pd}| d¡\}}}|r,|r,d|›d}ttd|ˆ|ƒgƒƒ}|rTdd |¡SdS)Nrnú:ú(rŽz; z and )r¸rórHÚjoin)r>ÚextraÚsepÚmarkersZ
conditions©r r-r.Ú quoted_markerYs  zIDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.quoted_markercSs dd|kS)z
            PEP 508 requires a space between the url_spec and the quoted_marker.
            Ref python/importlib_metadata#357.
            ú ú@r-)Úreqr-r-r.Ú url_req_spaceaszIDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.url_req_spaceN)r:r*)Úsectionsrrr>Úspacer-rr.r    Js  
z2Distribution._convert_egg_info_reqs_to_simple_reqsN)(r3r4r5r6ÚabcÚabstractmethodrr7r¯r    r´rµr²rUrÐrrÏrVrÜrÙr8rrr#r*rér&r•r!rr¥r"rõrör÷r%rrrr    r-r-r-r.rxsH
 
"
c@s<eZdZdZGdd„dƒZejeƒfeedœdd„ƒZ    dS)rzJ
    A MetaPathFinder capable of discovering installed distributions.
    c@s2eZdZdZdZdd„Zeeedœdd„ƒZ    dS)zDistributionFinder.Contextaw
        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.
        NcKst|ƒ |¡dSr0rh)r,rÅr-r-r.rk…sz#DistributionFinder.Context.__init__r'cCst|ƒ dtj¡S)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Ì)riÚgetrßrÌr+r-r-r.r̈s    zDistributionFinder.Context.path)
r3r4r5r6r*rkr8rr7rÌr-r-r-r.rÕss
 rÕr'cCsdS)zÝ
        Find distributions.
 
        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching the ``context``,
        a DistributionFinder.Context instance.
        Nr-)r,rÑr-r-r.rݓsz%DistributionFinder.find_distributionsN)
r3r4r5r6rÕrrrrrÝr-r-r-r.rns csheZdZdZe ¡‡fdd„ƒZdd„Zdd„Zdd    „Z    d
d „Z
d d „Z e dd„ƒZ edd„ƒZ‡ZS)ÚFastPathzs
    Micro-optimized class for searching a path for
    children.
 
    >>> FastPath('').children()
    ['...']
    cs tƒ |¡Sr0)rÃrÄ)rCÚrootrÆr-r.rħszFastPath.__new__cCs
||_dSr0)r)r,rr-r-r.rk«szFastPath.__init__cCst |j|¡Sr0)r´rµr)r,Úchildr-r-r.Újoinpath®szFastPath.joinpathc
CsTttƒt |jpd¡W5QR£SQRXttƒ| ¡W5QR£SQRXgS©Nro)rÚ    ExceptionÚosÚlistdirrÚ zip_childrenr+r-r-r.Úchildren±s
 
"
zFastPath.childrencCs2t |j¡}|j ¡}|j|_t dd„|Dƒ¡S)Ncss |]}| tjd¡dVqdS)rrN)rrÚ    posixpathr)r=rr-r-r.r?½sz(FastPath.zip_children.<locals>.<genexpr>)ÚzipprµrÚnamelistr ÚdictÚfromkeys)r,Úzip_pathr r-r-r.r%¸s 
zFastPath.zip_childrencCs| |j¡ |¡Sr0)ÚlookupÚmtimeÚsearchr2r-r-r.r/¿szFastPath.searchc
Cs8ttƒt |j¡jW5QR£SQRX|j ¡dSr0)rÚOSErrorr#ÚstatrÚst_mtimer-Ú cache_clearr+r-r-r.r.Âs
 zFastPath.mtimecCst|ƒSr0)ÚLookup)r,r.r-r-r.r-ÈszFastPath.lookup)r3r4r5r6r_Ú    lru_cacherÄrkr r&r%r/r8r.r r-rÈr-r-rÆr.ržs
rc@s"eZdZedœdd„Zdd„ZdS)r4rÛc    Csætj |j¡ ¡}| d¡}ttƒ|_ttƒ|_    | 
¡D]”}| ¡}| d¡rˆ|  d¡d  d¡d}t  |¡}|j| | |¡¡q8|r8|dkr8|  d¡d  d¡d}t  |¡}|j    | | |¡¡q8|j ¡|j     ¡dS)Nz.egg©z
.dist-infoz    .egg-infororú-zegg-info)r#rÌÚbasenamerÚlowerrMrróÚinfosÚeggsr&Ú
rpartitionr¸rçrèÚappendr Úlegacy_normalizeÚfreeze)    r,rÌÚbaseZ base_is_eggrÚlowr*Ú
normalizedÚlegacy_normalizedr-r-r.rkÎs 
 
 
 
 
 
 
zLookup.__init__cCsP|r|j|jntj |j ¡¡}|r2|j|jntj |j ¡¡}t ||¡Sr0)r:rBrÖr×rØr„r;rC)r,Úpreparedr:r;r-r-r.r/ãsÿýÿýz Lookup.searchN)r3r4r5rrkr/r-r-r-r.r4Ísr4c@s@eZdZdZdZdZdd„Zedd„ƒZedd„ƒZ    d    d
„Z
dS) rçzE
    A prepared search for metadata on a possibly-named package.
    NcCs.||_|dkrdS| |¡|_| |¡|_dSr0)r*rèrBr>rCr2r-r-r.rkùs
 zPrepared.__init__cCst dd|¡ ¡ dd¡S)zC
        PEP 503 normalization plus dashes as underscores.
        z[-_.]+r7rº)r{Úsubr9Úreplacer)r-r-r.rèszPrepared.normalizecCs| ¡ dd¡S)z|
        Normalize the package name as found in the convention in
        older packaging tools versions and specs.
        r7rº)r9rFr)r-r-r.r>szPrepared.legacy_normalizecCs
t|jƒSr0)Úboolr*r+r-r-r.Ú__bool__szPrepared.__bool__) r3r4r5r6rBrCrkrVrèr>rHr-r-r-r.rçñs
 
rçc@sDeZdZdZe ¡feddœdd„Zedd„ƒZ    ddœd    d
„Z
dS) ÚMetadataPathFinderzÒA degenerate finder for distribution packages on the file system.
 
    This finder supplies only a find_distributions() method for versions
    of Python that do not have a PathFinder find_distributions().
    rÚr'cCs| |j|j¡}tt|ƒS)a 
        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ÌrIrÚ)r,rÑÚfoundr-r-r.rÝs z%MetadataPathFinder.find_distributionscs(t|ƒ‰tj ‡fdd„tt|ƒDƒ¡S)z1Find metadata directories in paths heuristically.c3s|]}| ˆ¡VqdSr0)r/)r=rÌ©rDr-r.r?-sz3MetadataPathFinder._search_paths.<locals>.<genexpr>)rçrÖr×rØrIr)rCr*rr-rLr.rJ)sÿz MetadataPathFinder._search_pathsNcCstj ¡dSr0)rrÄr3rÀr-r-r.Úinvalidate_caches1sz$MetadataPathFinder.invalidate_caches) r3r4r5r6rrÕrrÝrUrJrMr-r-r-r.rIsÿþ 
rIcsleZdZeddœdd„Zeeedœdd„Ze    jj
e_
ee j dœdd    „Z e‡fd
d „ƒZed d „ƒZ‡ZS)rÚNrËcCs
||_dS)zfConstruct a distribution.
 
        :param path: SimplePath indicating the metadata directory.
        N)rúrÍr-r-r.rk6szPathDistribution.__init__)rÊr(c
Cs<ttttttƒ"|j |¡jddW5QR£SQRXdS)Nr¨rª)    rÚFileNotFoundErrorÚIsADirectoryErrorr›ÚNotADirectoryErrorÚPermissionErrorrúr r¯rÉr-r-r.r¯=sû&zPathDistribution.read_textcCs |jj|Sr0)rúÚparentrÍr-r-r.r²KszPathDistribution.locate_filecs.tj t|jƒ¡}ttjƒ| |¡ƒp,t    ƒj
S)zz
        Performance optimization: where possible, resolve the
        normalized name from the file system path.
        ) r#rÌr8r7rúr rçrèÚ_name_from_stemrÃré)r,ÚstemrÆr-r.réNsþz!PathDistribution._normalized_namecCs0tj |¡\}}|dkrdS| d¡\}}}|S)a7
        >>> 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')
        r6Nr7)r#rÌÚsplitextr¸)rTrÊÚextr*rÚrestr-r-r.rSZs
z PathDistribution._name_from_stem)r3r4r5rrkr    rr7r¯rr6r´rµr²r8rérVrSrÈr-r-rÆr.rÚ5s
 rÚ)Údistribution_namer(cCs
t |¡S)zÎGet 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ЩrXr-r-r.rlsr'cKs tjf|ŽS)z|Get all ``Distribution`` instances in the current environment.
 
    :return: An iterable of ``Distribution`` instances.
    )rrÏ)rÅr-r-r.r uscCs t |¡jS)z¹Get 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#rYr-r-r.r#}scCs
t|ƒjS)zìGet 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&rYr-r-r.r&†s)ÚkeycKs,tj dd„ttƒƒDƒ¡}t|ƒjf|ŽS)aReturn 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.
    css|] }|jVqdSr0)r!)r=rfr-r-r.r?¢szentry_points.<locals>.<genexpr>)rÖr×rØÚ_uniquer r•r™)r…Zepsr-r-r.r!™s     ÿcCs
t|ƒjS)z·Return 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"rYr-r-r.r"¨scCs
t|ƒjS)z¡
    Return a list of requirements for the named package.
 
    :return: An iterable of requirements, suitable for
        packaging.requirement.Requirement.
    )rr%rYr-r-r.r%±scCsHt t¡}tƒD].}t|ƒp"t|ƒD]}|| |jd¡q$qt|ƒS)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
    rå)    Ú collectionsÚ defaultdictrór Ú_top_level_declaredÚ_top_level_inferredr=r#r*)Z pkg_to_distrfÚpkgr-r-r.r$»s
 
 
 
cCs| d¡p d ¡S)Nz top_level.txtrn)r¯rrr}r-r-r.r^Ìsr^r–cCs|j^}}|r|SdS)zB
    Return the top-most parent as long as there is a parent.
    N)Úparts)r*ÚtoprWr-r-r.Ú_topmostÐs
rccCst|ƒpt |¡pt|ƒS)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'
    )rcrÁÚ getmodulenamer7r)r-r-r.Ú_get_toplevel_nameØs
ýrecCs&tttt|jƒƒƒ}dd„}t||ƒS)NcSsd|kSr!r-r)r-r-r.Úimportable_nameôsz,_top_level_inferred.<locals>.importable_name)ÚsetrIrerr"rH)rfÚ    opt_namesrfr-r-r.r_ñsr_)Ur#r{rrírßr(rãrÁr´r‚rRrar_rÖr'r\rnrrrÚ _collectionsrrÚ_compatrr    r
r Ú
_functoolsr r Ú
_itertoolsrrrrÚ
contextlibrÚ    importlibrÚ importlib.abcrrÚtypingrrrrrrÚ__all__ÚModuleNotFoundErrorrr9rWrdÚtupler•Ú PurePosixPathr¥r¦r¼rrrr4rçrIrÚr7rr r#r&r`Znormalized_namer[r!r"r%r$r^rcrer_r-r-r-r.Ú<module>s     ô A|1w0/$"!7        
þ