zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
U
G=®dÁ§ãG@s”dZddlmZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZz ddlZWnek
rddlZYnXze Wne!k
r*e"Z YnXddl#m$Z$ddl%m&Z&m'Z'ddlm(Z(zddlm)Z)m*Z*m+Z+d    Z,Wnek
rŠd
Z,YnXdd lm-Z.dd l/m0Z0m1Z1zddl2m3Z4e4j5Wnek
rØdZ4YnXdd l#m6Z6ddl#m7Z7e8dƒe8dƒe8dƒe8dƒe9Z:dej;kr0dkr<nne<dƒ‚e$j=rLdZ>dZ?dZ@dZAdZBdZCdZDdZEdZFdZGdZHdZIdZJdZKdZLdZMdZNdZOdZPGdd„deQƒZRdd„ZSiZTdd„ZUdd„ZVdd„ZWd d!„ZXd"d#„ZYd$d%„ZZd&d'„Z[d(d)„Z\Z]d*d+„Z^d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKddLddMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpgGZ_GdqdG„dGe`ƒZaGdrdH„dHeaƒZbGdsdt„dtebƒZcGdudI„dIeaƒZdGdvdJ„dJeaƒZeiZfdwjgej;ŽZhdxZidyZjdzZkdZld{Zmd|dk„Znd}d.„Zogfd~d„Zpd€d„Zqd‚dƒ„Zre sd„¡Zte sd…¡ZuerZvd†dP„Zwd‡d-„ZxexZydˆd/„Zzd‰d0„Z{dÿdŠd1„Z|d‹d2„Z}GdŒd^„d^ƒZ~Gdd_„d_e~ƒZGdŽdB„dBƒZ€Gdd„deƒZ‚Gd‘dA„dAƒZƒeƒZ„Gd’dK„dKe<ƒZ…Gd“dC„dCƒZ†d”d@„Z‡d•dM„Zˆd–dN„Z‰d—dS„ZŠd˜dT„Z‹d™dU„ZŒddšdV„ZGd›de„deƒZŽeneeŽƒdœd„ZGdždf„dfeŽƒZ‘GdŸdg„dge‘ƒZ’e’ “¡Gd dc„dceŽƒZ”e”ƒZ•Gd¡d¢„d¢eƒZ–Gd£d¤„d¤e–ƒZ—Gd¥dh„dhe‘ƒZ˜ene
j™e˜ƒGd¦d`„d`e”ƒZšGd§da„dae’ƒZ›Gd¨db„dbe˜ƒZœeUd©idªd«di„Zdd¬d=„Zždd­d®„ZŸee
j™eŸƒdd¯d°„Z eee ƒd±d²„Z¡dd³d´„Z¢dµd¶„Z£Gd·d¸„d¸ƒZ¤d¹dº„Z¥d»d¼„Z¦d½d¾„Z§d¿dÀ„Z¨eej©e¢ƒeªe4dÁƒr¦ee4j«e¢ƒeUd©ideUd©idÍdÄdj„Z¬dÅdƄZ­dÇdȄZ®dÉd:„Z¯ddÊdl„Z°dËd̄Z±e¬ej©e±ƒe¬e
j™e±ƒeªe4dÁƒr"e¬e4j«e±ƒdÍd΄Z²e¬ee²ƒdÏdX„Z³dÐdфZ´ifdÒdӄZµdÔdՄZ¶dÖdׄZ·dØdلZ¸dÚdQ„Z¹e sdÛ¡jºZ»e sdÜej¼ej½B¡jºZ¾GdÝdF„dFƒZ¿dÞd߄ZÀGdàdD„dDƒZÁGdádâ„dâeÁƒZÂGdãdä„däeÁƒZÃeÁeÂeÃdåœZÄdædç„ZÅdèdL„ZÆGdédê„dêe7jÇjȃZÉGdëdE„dEe7jÇjʃZÊdìdí„ZËdîdï„ZÌdðdW„ZÍdñdò„ZÎdódR„ZÏdôdõ„ZÐe jÑdöeRd    d÷dødù„ZÒeÒeӃfdúdû„ƒZÔeÒdüdý„ƒZÕGdþdn„dneփZ×dS(aZ
Package resource API
--------------------
 
A resource is a logical file contained within a package, or a logical
subdirectory thereof.  The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is.  Do not use os.path operations to manipulate resource
names being passed into the API.
 
The package resource API is designed to work with normal filesystem packages,
.egg files, and unpacked .egg files.  It can also work in a limited way with
.zip files and with custom PEP 302 loaders that support the ``get_data()``
method.
é)Úabsolute_importN)Ú get_importer)Úsix)ÚmapÚfilter)Úutime)ÚmkdirÚrenameÚunlinkTF)Úopen)ÚisdirÚsplit)Úappdirs)Ú    packagingz&pkg_resources.extern.packaging.versionz)pkg_resources.extern.packaging.specifiersz+pkg_resources.extern.packaging.requirementsz&pkg_resources.extern.packaging.markers)ér)rézPython 3.5 or later is requiredc@seZdZdZdS)Ú PEP440Warningza
    Used when there is an issue with a version or specifier not complying with
    PEP 440.
    N©Ú__name__Ú
__module__Ú __qualname__Ú__doc__©rrúMD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pkg_resources/__init__.pyrwsrcCs8ztj |¡WStjjk
r2tj |¡YSXdS©N)rÚversionÚVersionÚInvalidVersionÚ LegacyVersion)ÚvrrrÚ parse_version~sr cKs"tƒ |¡t t ||¡¡dSr)ÚglobalsÚupdateÚ _state_varsÚdictÚfromkeys)ÚvartypeÚkwrrrÚ_declare_stateˆs r(cCs8i}tƒ}t ¡D] \}}|d|||ƒ||<q|S)NÚ_sget_)r!r#Úitems©ÚstateÚgÚkrrrrÚ __getstate__s
r/cCs8tƒ}| ¡D]$\}}|dt|||||ƒq|S)NÚ_sset_)r!r*r#r+rrrÚ __setstate__•sr1cCs| ¡Sr)Úcopy©ÚvalrrrÚ
_sget_dictœsr5cCs| ¡| |¡dSr)Úclearr"©ÚkeyÚobr,rrrÚ
_sset_dict sr:cCs| ¡Sr)r/r3rrrÚ _sget_object¥sr;cCs| |¡dSr)r1r7rrrÚ _sset_object©sr<cGsdSrr©ÚargsrrrÚ<lambda>­ór?cCsbtƒ}t |¡}|dk    r^tjdkr^z&dd tƒdd…¡| d¡f}Wntk
r\YnX|S)aQReturn this platform's maximum compatible version.
 
    distutils.util.get_platform() normally reports the minimum version
    of macOS that would be required to *use* extensions produced by
    distutils.  But what we want when checking compatibility is to know the
    version of macOS that we are *running*.  To allow usage of packages that
    explicitly require a newer version of macOS, we must also know the
    current version of the OS.
 
    If this condition occurs for any other platform with a version in its
    platform strings, this function should be extended accordingly.
    NÚdarwinz macosx-%s-%sÚ.ér)    Úget_build_platformÚmacosVersionStringÚmatchÚsysÚplatformÚjoinÚ _macos_versÚgroupÚ
ValueError)ÚplatÚmrrrÚget_supported_platform°s 
&rOÚrequireÚ
run_scriptÚ get_providerÚget_distributionÚload_entry_pointÚ get_entry_mapÚget_entry_infoÚiter_entry_pointsÚresource_stringÚresource_streamÚresource_filenameÚresource_listdirÚresource_existsÚresource_isdirÚdeclare_namespaceÚ working_setÚadd_activation_listenerÚfind_distributionsÚset_extraction_pathÚcleanup_resourcesÚget_default_cacheÚ EnvironmentÚ
WorkingSetÚResourceManagerÚ DistributionÚ RequirementÚ
EntryPointÚResolutionErrorÚVersionConflictÚDistributionNotFoundÚ UnknownExtraÚExtractionErrorÚparse_requirementsÚ    safe_nameÚ safe_versionÚ get_platformÚcompatible_platformsÚ yield_linesÚsplit_sectionsÚ
safe_extraÚ to_filenameÚinvalid_markerÚevaluate_markerÚensure_directoryÚnormalize_pathÚEGG_DISTÚ BINARY_DISTÚ SOURCE_DISTÚ CHECKOUT_DISTÚ DEVELOP_DISTÚIMetadataProviderÚIResourceProviderÚ FileMetadataÚ PathMetadataÚ EggMetadataÚ EmptyProviderÚempty_providerÚ NullProviderÚ EggProviderÚDefaultProviderÚ ZipProviderÚregister_finderÚregister_namespace_handlerÚregister_loader_typeÚfixup_namespace_packagesrÚPkgResourcesDeprecationWarningÚrun_mainÚAvailableDistributionsc@seZdZdZdd„ZdS)rkz.Abstract base for dependency resolution errorscCs|jjt|jƒSr)Ú    __class__rÚreprr>©ÚselfrrrÚ__repr__ýszResolutionError.__repr__N)rrrrr˜rrrrrkúsc@s<eZdZdZdZedd„ƒZedd„ƒZdd„Zd    d
„Z    d S) rlzª
    An already-installed version conflicts with the requested version.
 
    Should be initialized with the installed Distribution and the requested
    Requirement.
    z3{self.dist} is installed but {self.req} is requiredcCs
|jdS©Nrr=r–rrrÚdist szVersionConflict.distcCs
|jdS©Nér=r–rrrÚreqszVersionConflict.reqcCs|jjftƒŽSr©Ú    _templateÚformatÚlocalsr–rrrÚreportszVersionConflict.reportcCs|s|S|j|f}t|ŽS)zt
        If required_by is non-empty, return a version of self that is a
        ContextualVersionConflict.
        )r>ÚContextualVersionConflict)r—Ú required_byr>rrrÚ with_contexts zVersionConflict.with_contextN)
rrrrrŸÚpropertyršrr¢r¥rrrrrls
 
c@s&eZdZdZejdZedd„ƒZdS)r£z…
    A VersionConflict that accepts a third parameter, the set of the
    requirements that required the installed Distribution.
    z by {self.required_by}cCs
|jdS)NrCr=r–rrrr¤)sz%ContextualVersionConflict.required_byN)rrrrrlrŸr¦r¤rrrrr£!s
r£c@sHeZdZdZdZedd„ƒZedd„ƒZedd„ƒZd    d
„Z    d d „Z
d S)rmz&A requested distribution was not foundzSThe '{self.req}' distribution was not found and is required by {self.requirers_str}cCs
|jdSr™r=r–rrrr4szDistributionNotFound.reqcCs
|jdSr›r=r–rrrÚ    requirers8szDistributionNotFound.requirerscCs|js
dSd |j¡S)Nzthe applicationz, )r§rIr–rrrÚ requirers_str<sz"DistributionNotFound.requirers_strcCs|jjftƒŽSrržr–rrrr¢BszDistributionNotFound.reportcCs| ¡Sr)r¢r–rrrÚ__str__EszDistributionNotFound.__str__N) rrrrrŸr¦rr§r¨r¢r©rrrrrm.s
 
 
c@seZdZdZdS)rnz>Distribution doesn't have an "extra feature" of the given nameNrrrrrrnIsz{}.{}rrCrœéÿÿÿÿcCs |t|<dS)aRegister `provider_factory` to make providers for `loader_type`
 
    `loader_type` is the type or class of a PEP 302 ``module.__loader__``,
    and `provider_factory` is a function that, passed a *module* object,
    returns an ``IResourceProvider`` for that module.
    N)Ú_provider_factories)Ú loader_typeÚprovider_factoryrrrrWscCstt|tƒr$t |¡p"tt|ƒƒdSztj|}Wn&tk
rXt    |ƒtj|}YnXt
|ddƒ}t t |ƒ|ƒS)z?Return an IResourceProvider for the named module or requirementrÚ
__loader__N) Ú
isinstancerir_ÚfindrPÚstrrGÚmodulesÚKeyErrorÚ
__import__ÚgetattrÚ _find_adapterr«)Ú moduleOrReqÚmoduleÚloaderrrrrRas
 cCsd|s\t ¡d}|dkrLd}tj |¡rLttdƒrLt |¡}d|krL|d}| |     d¡¡|dS)NrÚz0/System/Library/CoreServices/SystemVersion.plistÚ    readPlistÚProductVersionrB)
rHÚmac_verÚosÚpathÚexistsÚhasattrÚplistlibr»Úappendr )Ú_cacherÚplistÚ plist_contentrrrrJns  
 
rJcCsdddœ ||¡S)NÚppc)ÚPowerPCÚPower_Macintosh)Úget)ÚmachinerrrÚ _macos_arch~srÌcCs~ddlm}|ƒ}tjdkrz| d¡szz>tƒ}t ¡d dd¡}dt    |dƒt    |d    ƒt
|ƒfWSt k
rxYnX|S)
zÁReturn this platform's string for platform-specific distributions
 
    XXX Currently this is the same as ``distutils.util.get_platform()``, but it
    needs some hacks for Linux and macOS.
    r)rsrAzmacosx-éú Ú_zmacosx-%d.%d-%srœ) Ú    sysconfigrsrGrHÚ
startswithrJr¾ÚunameÚreplaceÚintrÌrL)rsrMrrËrrrrD‚s 
 
þrDzmacosx-(\d+)\.(\d+)-(.*)zdarwin-(\d+)\.(\d+)\.(\d+)-(.*)cCsè|dks|dks||krdSt |¡}|rät |¡}|s”t |¡}|rt| d¡ƒ}d| d¡| d¡f}|dkr||dksŒ|dkr|d    krdSd
S| d¡| d¡ks¼| d ¡| d ¡krÀd
St| d¡ƒt| d¡ƒkràd
SdSd
S) zÛCan code for the `provided` platform run on the `required` platform?
 
    Returns true if either platform is ``None``, or the platforms are equal.
 
    XXX Needs compatibility checks for Linux and other unixy OSes.
    NTrœz%s.%srCéz10.3éz10.4Fr)rErFÚdarwinVersionStringrÔrK)ÚprovidedÚrequiredÚreqMacÚprovMacÚ
provDarwinÚdversionÚ macosversionrrrrt s2
 
 
ÿÿÿcCs<t d¡j}|d}| ¡||d<t|ƒd ||¡dS)z@Locate distribution `dist_spec` and run its `script_name` scriptrœrrN©rGÚ    _getframeÚ    f_globalsr6rPrQ)Z    dist_specÚ script_nameÚnsÚnamerrrrQÎs
 cCs@t|tjƒrt |¡}t|tƒr(t|ƒ}t|tƒs<td|ƒ‚|S)z@Return a current distribution object for a Requirement or stringz-Expected string, Requirement, or Distribution)r¯rÚ string_typesriÚparserRrhÚ    TypeError©ršrrrrSÛs 
 
 
 
cCst|ƒ ||¡S)zDReturn `name` entry point of `group` for `dist` or raise ImportError)rSrT©ršrKrärrrrTæscCst|ƒ |¡S)ú=Return the entry point map for `group`, or the full entry map)rSrU)ršrKrrrrUëscCst|ƒ ||¡S©z<Return the EntryPoint object for `group`+`name`, or ``None``)rSrVrérrrrVðsc@s<eZdZdd„Zdd„Zdd„Zdd„Zd    d
„Zd d „Zd S)r‚cCsdS)z;Does the package's distribution contain the named metadata?Nr©rärrrÚ has_metadataöszIMetadataProvider.has_metadatacCsdS)z'The named metadata resource as a stringNrrìrrrÚ get_metadataùszIMetadataProvider.get_metadatacCsdS)zÒYield named metadata resource as list of non-blank non-comment lines
 
       Leading and trailing whitespace is stripped from each line, and lines
       with ``#`` as the first non-blank character are omitted.NrrìrrrÚget_metadata_linesüsz$IMetadataProvider.get_metadata_linescCsdS)z>Is the named metadata a directory?  (like ``os.path.isdir()``)NrrìrrrÚmetadata_isdirsz IMetadataProvider.metadata_isdircCsdS)z?List of metadata names in the directory (like ``os.listdir()``)NrrìrrrÚmetadata_listdirsz"IMetadataProvider.metadata_listdircCsdS)z=Execute the named script in the supplied namespace dictionaryNr)râÚ    namespacerrrrQszIMetadataProvider.run_scriptN)    rrrrírîrïrðrñrQrrrrr‚õs c@s@eZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Zd d „Z    dS)rƒz3An object that provides access to package resourcescCsdS)zdReturn a true filesystem path for `resource_name`
 
        `manager` must be an ``IResourceManager``Nr©ÚmanagerÚ resource_namerrrÚget_resource_filenamesz'IResourceProvider.get_resource_filenamecCsdS)ziReturn a readable file-like object for `resource_name`
 
        `manager` must be an ``IResourceManager``NrrórrrÚget_resource_streamsz%IResourceProvider.get_resource_streamcCsdS)zmReturn a string containing the contents of `resource_name`
 
        `manager` must be an ``IResourceManager``NrrórrrÚget_resource_stringsz%IResourceProvider.get_resource_stringcCsdS)z,Does the package contain the named resource?Nr©rõrrrÚ has_resourceszIResourceProvider.has_resourcecCsdS)z>Is the named resource a directory?  (like ``os.path.isdir()``)Nrrùrrrr]!sz IResourceProvider.resource_isdircCsdS)z?List of resource names in the directory (like ``os.listdir()``)Nrrùrrrr[$sz"IResourceProvider.resource_listdirN)
rrrrrör÷rørúr]r[rrrrrƒ sc@s¬eZdZdZd'dd„Zedd„ƒZedd„ƒZd    d
„Zd d „Z    d d„Z
d(dd„Z dd„Z dd„Z d)dd„Zd*dd„Zd+dd„Zdd„Zd,dd „Zd!d"„Zd#d$„Zd%d&„ZdS)-rfzDA collection of active distributions on sys.path (or a similar list)NcCs>g|_i|_i|_g|_|dkr&tj}|D]}| |¡q*dS)z?Create working set from list of path entries (default=sys.path)N)ÚentriesÚ
entry_keysÚby_keyÚ    callbacksrGr¿Ú    add_entry)r—rûÚentryrrrÚ__init__+szWorkingSet.__init__cCsb|ƒ}zddlm}Wntk
r.|YSXz| |¡Wntk
r\| |¡YSX|S)z1
        Prepare the master working set.
        r)Ú __requires__)Ú__main__rÚ ImportErrorrPrlÚ_build_from_requirements)ÚclsÚwsrrrrÚ _build_master8s
zWorkingSet._build_mastercCsf|gƒ}t|ƒ}| |tƒ¡}|D]}| |¡q"tjD]}||jkr8| |¡q8|jtjdd…<|S)zQ
        Build a working set from a requirement spec. Rewrites sys.path.
        N)rpÚresolvereÚaddrGr¿rûrÿ)rÚreq_specrÚreqsÚdistsršrrrrrLs 
 
 z#WorkingSet._build_from_requirementscCs<|j |g¡|j |¡t|dƒD]}| ||d¡q$dS)aÝAdd a path item to ``.entries``, finding any distributions on it
 
        ``find_distributions(entry, True)`` is used to find distributions
        corresponding to the path entry, and they are added.  `entry` is
        always appended to ``.entries``, even if it is already present.
        (This is because ``sys.path`` can contain the same value more than
        once, and the ``.entries`` of the ``sys.path`` WorkingSet should always
        equal ``sys.path``.)
        TFN)rüÚ
setdefaultrûrÃrar
)r—rršrrrrÿbs
 zWorkingSet.add_entrycCs|j |j¡|kS)z9True if `dist` is the active distribution for its project)rýrÊr8©r—ršrrrÚ __contains__qszWorkingSet.__contains__cCs,|j |j¡}|dk    r(||kr(t||ƒ‚|S)aÐFind a distribution matching requirement `req`
 
        If there is an active distribution for the requested project, this
        returns it as long as it meets the version requirement specified by
        `req`.  But, if there is an active distribution for the project and it
        does *not* meet the `req` requirement, ``VersionConflict`` is raised.
        If there is no active distribution for the requested project, ``None``
        is returned.
        N)rýrÊr8rl)r—rršrrrr°us
 
zWorkingSet.findcs‡‡fdd„|DƒS)aYield entry point objects from `group` matching `name`
 
        If `name` is None, yields all entry points in `group` from all
        distributions in the working set, otherwise only ones matching
        both `group` and `name` are yielded (in distribution order).
        c3s8|]0}| ˆ¡ ¡D]}ˆdks*ˆ|jkr|VqqdSr)rUÚvaluesrä)Ú.0ršr©rKrärrÚ    <genexpr>Œs 
ýz/WorkingSet.iter_entry_points.<locals>.<genexpr>r©r—rKrärrrrW…s þzWorkingSet.iter_entry_pointscCs>t d¡j}|d}| ¡||d<| |¡d ||¡dS)z?Locate distribution for `requires` and run `script_name` scriptrœrrNrß)r—ÚrequiresrârãrärrrrQ“s
 zWorkingSet.run_scriptccsLi}|jD]<}||jkrq
|j|D] }||kr$d||<|j|Vq$q
dS)z¸Yield distributions for non-duplicate projects in the working set
 
        The yield order is the order in which the items' path entries were
        added to the working set.
        rœN)rûrürý)r—ÚseenÚitemr8rrrÚ__iter__›s
 
zWorkingSet.__iter__TFcCsœ|r|j|j||d|dkr$|j}|j |g¡}|j |jg¡}|sV|j|jkrVdS||j|j<|j|krx| |j¡|j|krŽ| |j¡| |¡dS)aAdd `dist` to working set, associated with `entry`
 
        If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
        On exit from this routine, `entry` is added to the end of the working
        set's ``.entries`` (if it wasn't already present).
 
        `dist` is only added to the working set if it's for a project that
        doesn't already have a distribution in the set, unless `replace=True`.
        If it's added, any callbacks registered with the ``subscribe()`` method
        will be called.
        ©rÓN)    Ú    insert_onrûÚlocationrürr8rýrÃÚ
_added_new)r—ršrÚinsertrÓÚkeysÚkeys2rrrr
¬s  
 
 zWorkingSet.addcCsxt|ƒddd…}i}i}g}tƒ}    t t¡}
|rt| d¡} | |krHq.|     | |¡sVq.| | j¡} | dkr|j     | j¡} | dksŽ| | krø|rø|} |dkr¾| dkr®t
|j ƒ}nt
gƒ}t gƒ} |j | | ||d} || j<| dkrø|
 | d¡}t| |ƒ‚| | ¡| | kr$|
| }t| | ƒ |¡‚|  | j¡ddd…}| |¡|D] }|
| | j¡| j|    |<qHd|| <q.|S)aÎList all distributions needed to (recursively) meet `requirements`
 
        `requirements` must be a sequence of ``Requirement`` objects.  `env`,
        if supplied, should be an ``Environment`` instance.  If
        not supplied, it defaults to all distributions available within any
        entry or distribution in the working set.  `installer`, if supplied,
        will be invoked with each requirement that cannot be met by an
        already-installed distribution; it should return a ``Distribution`` or
        ``None``.
 
        Unless `replace_conflicting=True`, raises a VersionConflict exception
        if
        any requirements are found on the path that have the correct name but
        the wrong version.  Otherwise, if an `installer` is supplied it will be
        invoked to obtain the correct version of the requirement and activate
        it.
 
        `extras` is a list of the extras to be used with these requirements.
        This is important because extra requirements may look like `my_req;
        extra = "my_extra"`, which would otherwise be interpreted as a purely
        optional requirement.  Instead, we want to be able to assert that these
        requirements are truly required.
        Nrªr)Úreplace_conflictingT)ÚlistÚ
_ReqExtrasÚ collectionsÚ defaultdictÚsetÚpopÚ markers_passrÊr8rýrerûrfÚ
best_matchrmrÃrlr¥rÚextrasÚextendr
Ú project_name)r—Ú requirementsÚenvÚ    installerr!r*Ú    processedÚbestÚ to_activateÚ
req_extrasr¤rršrr§Ú dependent_reqÚnew_requirementsÚnew_requirementrrrr    ÊsT
 
 
 þ 
 
 
 
 
zWorkingSet.resolvec Cs
t|ƒ}| ¡i}i}|dkr4t|jƒ}||7}n||}| g¡}    tt|    j|ƒƒ|D]–}
||
D]ˆ} |  ¡g} z|     | ||¡} WnBt    k
rÈ}z$||| <|r®WY¢qfn
WY¢qZW5d}~XYqfXtt|    j| ƒƒ| 
t   | ¡¡qZqfqZt|ƒ}| ¡||fS)asFind all activatable distributions in `plugin_env`
 
        Example usage::
 
            distributions, errors = working_set.find_plugins(
                Environment(plugin_dirlist)
            )
            # add plugins+libs to sys.path
            map(working_set.add, distributions)
            # display errors
            print('Could not load', errors)
 
        The `plugin_env` should be an ``Environment`` instance that contains
        only distributions that are in the project's "plugin directory" or
        directories. The `full_env`, if supplied, should be an ``Environment``
        contains all currently-available distributions.  If `full_env` is not
        supplied, one is created automatically from the ``WorkingSet`` this
        method is called on, which will typically mean that every directory on
        ``sys.path`` will be scanned for distributions.
 
        `installer` is a standard installer callback as used by the
        ``resolve()`` method. The `fallback` flag indicates whether we should
        attempt to resolve older versions of a plugin if the newest version
        cannot be resolved.
 
        This method returns a 2-tuple: (`distributions`, `error_info`), where
        `distributions` is a list of the distributions found in `plugin_env`
        that were loadable, along with any other distributions that are needed
        to resolve their dependencies.  `error_info` is a dictionary mapping
        unloadable plugin distributions to an exception instance describing the
        error that occurred. Usually this will be a ``DistributionNotFound`` or
        ``VersionConflict`` instance.
        N) r"Úsortrerûr”rr
Úas_requirementr    rkr"r$r%)r—Ú
plugin_envÚfull_envr/ÚfallbackÚplugin_projectsÚ
error_infoÚ distributionsr.Ú
shadow_setr,ršrÚ    resolveesrrrrÚ find_plugins&s4$
 
 
 
 
zWorkingSet.find_pluginscGs&| t|ƒ¡}|D]}| |¡q|S)a¾Ensure that distributions matching `requirements` are activated
 
        `requirements` must be a string or a (possibly-nested) sequence
        thereof, specifying the distributions and versions required.  The
        return value is a sequence of the distributions that needed to be
        activated to fulfill the requirements; all relevant distributions are
        included, even if they were already activated in this working set.
        )r    rpr
)r—r-ÚneededršrrrrPzs     zWorkingSet.requirecCs8||jkrdS|j |¡|s"dS|D] }||ƒq&dS)zƒInvoke `callback` for all distributions
 
        If `existing=True` (default),
        call on all existing ones, as well.
        N)rþrÃ)r—ÚcallbackÚexistingršrrrÚ    subscribeŠs
 zWorkingSet.subscribecCs|jD] }||ƒqdSr)rþ)r—ršrCrrrr˜s
zWorkingSet._added_newcCs,|jdd…|j ¡|j ¡|jdd…fSr)rûrür2rýrþr–rrrr/œs
  þzWorkingSet.__getstate__cCs@|\}}}}|dd…|_| ¡|_| ¡|_|dd…|_dSr)rûr2rürýrþ)r—Úe_k_b_crûrrýrþrrrr1¢s
 
 
zWorkingSet.__setstate__)N)N)NTF)NNFN)NNT)T)rrrrrÚ classmethodrrrÿrr°rWrQrr
r    rArPrErr/r1rrrrrf(s4
 
 
 
 
ÿ
]ÿ
T
c@seZdZdZddd„ZdS)r#z>
    Map each requirement to the extras that demanded it.
    Ncs2‡fdd„| ˆd¡|pdDƒ}ˆj p0t|ƒS)z»
        Evaluate markers for req against each extra that
        demanded it.
 
        Return False if the req has a marker and fails
        evaluation. Otherwise, return True.
        c3s|]}ˆj d|i¡VqdS)ÚextraN©ÚmarkerÚevaluate)rrH©rrrr·sÿz*_ReqExtras.markers_pass.<locals>.<genexpr>rr)rÊrJÚany)r—rr*Ú extra_evalsrrLrr(¯s
þz_ReqExtras.markers_pass)N)rrrrr(rrrrr#ªsr#c@sxeZdZdZdeƒefdd„Zdd„Zdd„Zdd    d
„Z    d d „Z
d d„Z ddd„Z ddd„Z dd„Zdd„Zdd„ZdS)rez5Searchable snapshot of distributions on a search pathNcCs i|_||_||_| |¡dS)a!Snapshot distributions available on a search path
 
        Any distributions found on `search_path` are added to the environment.
        `search_path` should be a sequence of ``sys.path`` items.  If not
        supplied, ``sys.path`` is used.
 
        `platform` is an optional string specifying the name of the platform
        that platform-specific distributions must be compatible with.  If
        unspecified, it defaults to the current platform.  `python` is an
        optional string naming the desired version of Python (e.g. ``'3.6'``);
        it defaults to the current version.
 
        You may explicitly set `platform` (and/or `python`) to ``None`` if you
        wish to map *all* distributions, not just those compatible with the
        running platform or Python version.
        N)Ú_distmaprHÚpythonÚscan)r—Ú search_pathrHrPrrrrÁszEnvironment.__init__cCs2|jdkp|jdkp|j|jk}|o0t|j|jƒS)zåIs distribution `dist` acceptable for this environment?
 
        The distribution must match the platform and python version
        requirements specified when this environment was created, or False
        is returned.
        N)rPÚ
py_versionrtrH)r—ršÚ    py_compatrrrÚcan_addÙs 
ÿ
ýzEnvironment.can_addcCs|j|j |¡dS)z"Remove `dist` from the environmentN)rOr8ÚremoverrrrrVçszEnvironment.removecCs4|dkrtj}|D]}t|ƒD]}| |¡qqdS)adScan `search_path` for distributions usable in this environment
 
        Any distributions found are added to the environment.
        `search_path` should be a sequence of ``sys.path`` items.  If not
        supplied, ``sys.path`` is used.  Only distributions conforming to
        the platform/python version defined at initialization are added.
        N)rGr¿rar
)r—rRrršrrrrQës
 zEnvironment.scancCs| ¡}|j |g¡S)aReturn a newest-to-oldest list of distributions for `project_name`
 
        Uses case-insensitive `project_name` comparison, assuming all the
        project's distributions use their project's name converted to all
        lowercase as their key.
 
        )ÚlowerrOrÊ)r—r,Údistribution_keyrrrÚ __getitem__úszEnvironment.__getitem__cCsL| |¡rH| ¡rH|j |jg¡}||krH| |¡|jt d¡dddS)zLAdd `dist` if we ``can_add()`` it and it has not already been added
        ÚhashcmpT©r8ÚreverseN)    rUÚ has_versionrOrr8rÃr7ÚoperatorÚ
attrgetter)r—ršr rrrr
s
 
zEnvironment.addFcCsfz| |¡}Wntk
r,|s$‚d}YnX|dk    r:|S||jD]}||krD|SqD| ||¡S)a¸Find distribution best matching `req` and usable on `working_set`
 
        This calls the ``find(req)`` method of the `working_set` to see if a
        suitable distribution is already active.  (This may raise
        ``VersionConflict`` if an unsuitable version of the project is already
        active in the specified `working_set`.)  If a suitable distribution
        isn't active, this method returns the newest distribution in the
        environment that meets the ``Requirement`` in `req`.  If no suitable
        distribution is found, and `installer` is supplied, then the result of
        calling the environment's ``obtain(req, installer)`` method will be
        returned.
        N)r°rlr8Úobtain)r—rr_r/r!ršrrrr)s
 
zEnvironment.best_matchcCs|dk    r||ƒSdS)aÞObtain a distribution matching `requirement` (e.g. via download)
 
        Obtain a distro that matches requirement (e.g. via download).  In the
        base ``Environment`` class, this routine just returns
        ``installer(requirement)``, unless `installer` is None, in which case
        None is returned instead.  This method is a hook that allows subclasses
        to attempt other ways of obtaining a distribution before falling back
        to the `installer` argument.Nr)r—Ú requirementr/rrrr`*s    zEnvironment.obtainccs"|j ¡D]}||r
|Vq
dS)z=Yield the unique project names of the available distributionsN)rOr©r—r8rrrr6szEnvironment.__iter__cCsVt|tƒr| |¡n<t|tƒrD|D]}||D]}| |¡q0q$ntd|fƒ‚|S)z2In-place addition of a distribution or environmentzCan't add %r to environment)r¯rhr
rerç)r—ÚotherÚprojectršrrrÚ__iadd__<s
 
 zEnvironment.__iadd__cCs*|jgddd}||fD] }||7}q|S)z4Add an environment or distribution to an environmentN)rHrP©r”)r—rcÚnewr.rrrÚ__add__Hs 
zEnvironment.__add__)N)NF)N)rrrrrOÚPY_MAJORrrUrVrQrYr
r)r`rrerhrrrrre¾s"þ
 
 
ÿ
 
 c@seZdZdZdS)roaTAn error occurred extracting a resource
 
    The following attributes are available from instances of this exception:
 
    manager
        The resource manager that raised this exception
 
    cache_path
        The base directory for resource extraction
 
    original_error
        The exception instance that caused extraction to fail
    NrrrrrroTsc@s„eZdZdZdZdd„Zdd„Zdd„Zd    d
„Zd d „Z    d d„Z
dd„Z dd„Z ddd„Z edd„ƒZdd„Zdd„Zd dd„ZdS)!rgz'Manage resource extraction and packagesNcCs
i|_dSr)Ú cached_filesr–rrrrhszResourceManager.__init__cCst|ƒ |¡S)zDoes the named resource exist?)rRrú©r—Úpackage_or_requirementrõrrrr\kszResourceManager.resource_existscCst|ƒ |¡S)z,Is the named resource an existing directory?)rRr]rkrrrr]osÿzResourceManager.resource_isdircCst|ƒ ||¡S)z4Return a true filesystem path for specified resource)rRrörkrrrrZusÿz!ResourceManager.resource_filenamecCst|ƒ ||¡S)z9Return a readable file-like object for specified resource)rRr÷rkrrrrY{sÿzResourceManager.resource_streamcCst|ƒ ||¡S)z%Return specified resource as a string)rRrørkrrrrXsÿzResourceManager.resource_stringcCst|ƒ |¡S)z1List the contents of the named resource directory)rRr[rkrrrr[‡sÿz ResourceManager.resource_listdircCsRt ¡d}|jptƒ}t d¡ ¡}t|jft    ƒŽƒ}||_
||_ ||_ |‚dS)z5Give an error message for problems extracting file(s)rœa
            Can't extract file(s) to egg cache
 
            The following error occurred while trying to extract file(s)
            to the Python egg cache:
 
              {old_exc}
 
            The Python egg cache directory is currently set to:
 
              {cache_path}
 
            Perhaps your account does not have write access to this directory?
            You can change the cache directory by setting the PYTHON_EGG_CACHE
            environment variable to point to an accessible directory.
            N) rGÚexc_infoÚextraction_pathrdÚtextwrapÚdedentÚlstripror r¡rôÚ
cache_pathÚoriginal_error)r—Úold_excrrÚtmplÚerrrrrÚextraction_errors  z ResourceManager.extraction_errorrcCsf|jp
tƒ}tjj||df|žŽ}z t|ƒWntk
rL| ¡YnX| |¡d|j    |<|S)a®Return absolute location in cache for `archive_name` and `names`
 
        The parent directory of the resulting path will be created if it does
        not already exist.  `archive_name` should be the base filename of the
        enclosing egg (which may not be the name of the enclosing zipfile!),
        including its ".egg" extension.  `names`, if provided, should be a
        sequence of path name parts "under" the egg's extraction location.
 
        This method should only be called by resource providers that need to
        obtain an extraction location, and only for names they intend to
        extract, as it tracks the generated names for possible cleanup later.
        z-tmprœ)
rnrdr¾r¿rIÚ_bypass_ensure_directoryÚ    ExceptionrwÚ_warn_unsafe_extraction_pathrj)r—Ú archive_nameÚnamesÚ extract_pathÚ target_pathrrrÚget_cache_path©s  
 
zResourceManager.get_cache_pathcCs\tjdkr| tjd¡sdSt |¡j}|tj@s>|tj@rXdjft    ƒŽ}t
  |t ¡dS)aN
        If the default extraction path is overridden and set to an insecure
        location, such as /tmp, it opens up an opportunity for an attacker to
        replace an extracted file with an unauthorized payload. Warn the user
        if a known insecure location is used.
 
        See Distribute #375 for more details.
        ÚntÚwindirNzáExtraction path is writable by group/others and vulnerable to attack when used with get_resource_filename ({path}). Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).) r¾rärÑÚenvironÚstatÚst_modeÚS_IWOTHÚS_IWGRPr r¡ÚwarningsÚwarnÚ UserWarning)r¿ÚmodeÚmsgrrrrzÂs
 ÿùz,ResourceManager._warn_unsafe_extraction_pathcCs.tjdkr*t |¡jdBd@}t ||¡dS)a4Perform any platform-specific postprocessing of `tempname`
 
        This is where Mac header rewrites should be done; other platforms don't
        have anything special they should do.
 
        Resource providers should call this method ONLY after successfully
        extracting a compressed resource.  They must NOT call it on resources
        that are already in the filesystem.
 
        `tempname` is the current (temporary) name of the file, and `filename`
        is the name it will be renamed to by the caller after this routine
        returns.
        ÚposiximiÿN)r¾rärƒr„Úchmod)r—ÚtempnameÚfilenamerŠrrrÚ postprocessÝs
zResourceManager.postprocesscCs|jrtdƒ‚||_dS)aÒSet the base path where resources will be extracted to, if needed.
 
        If you do not call this routine before any extractions take place, the
        path defaults to the return value of ``get_default_cache()``.  (Which
        is based on the ``PYTHON_EGG_CACHE`` environment variable, with various
        platform-specific fallbacks.  See that routine's documentation for more
        details.)
 
        Resources are extracted to subdirectories of this path based upon
        information given by the ``IResourceProvider``.  You may set this to a
        temporary directory, but then you must call ``cleanup_resources()`` to
        delete the extracted files when done.  There is no guarantee that
        ``cleanup_resources()`` will be able to remove all extracted files.
 
        (Note: you may not change the extraction path for a given resource
        manager once resources have been extracted, unless you first call
        ``cleanup_resources()``.)
        z5Can't change extraction path, files already extractedN)rjrLrn©r—r¿rrrrbñs
ÿz#ResourceManager.set_extraction_pathFcCsdS)aB
        Delete all extracted resource files and directories, returning a list
        of the file and directory names that could not be successfully removed.
        This function does not have any concurrency protection, so it should
        generally only be called when the extraction path is a temporary
        directory exclusive to a single process.  This method is not
        automatically called; you must call it explicitly or register it as an
        ``atexit`` function if you wish to ensure cleanup of a temporary
        directory used for extractions.
        Nr)r—Úforcerrrrc sz!ResourceManager.cleanup_resources)r)F)rrrrrnrr\r]rZrYrXr[rwrÚ staticmethodrzrrbrcrrrrrgds 
 
cCstj d¡ptjddS)zŒ
    Return the ``PYTHON_EGG_CACHE`` environment variable
    or a platform-relevant user cache dir for an app
    named "Python-Eggs".
    ÚPYTHON_EGG_CACHEz Python-Eggs)Úappname)r¾r‚rÊrÚuser_cache_dirrrrrrds 
þcCst dd|¡S)zConvert an arbitrary string to a standard distribution name
 
    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    ú[^A-Za-z0-9.]+ú-)ÚreÚsubrìrrrrq%scCsJzttj |¡ƒWStjjk
rD| dd¡}t dd|¡YSXdS)zB
    Convert an arbitrary string to a standard version string
    rÎrBr—r˜N)r±rrrrrÓr™rš)rrrrrr-s
 cCst dd|¡ ¡S)z±Convert an arbitrary string to a standard 'extra' name
 
    Any runs of non-alphanumeric characters are replaced with a single '_',
    and the result is always lowercased.
    z[^A-Za-z0-9.-]+rÏ)r™ršrW)rHrrrrw9scCs | dd¡S)z|Convert a project or version name to its filename-escaped form
 
    Any '-' characters are currently replaced with '_'.
    r˜rÏrrìrrrrxBsc
CsHz t|ƒWn6tk
rB}zd|_d|_|WY¢Sd}~XYnXdS)zo
    Validate text as a PEP 508 environment marker; return an exception
    if invalid or False otherwise.
    NF)rzÚ SyntaxErrorrÚlineno)ÚtextÚerrrryJs c
CsLztj |¡}| ¡WStjjk
rF}zt|ƒ|‚W5d}~XYnXdS)zÙ
    Evaluate a PEP 508 environment marker.
    Return a boolean indicating the marker result in this environment.
    Raise SyntaxError if marker is invalid.
 
    This implementation uses the 'pyparsing' module.
    N)rÚmarkersÚMarkerrKÚ InvalidMarkerr›)rrHrJržrrrrzXs
 
c@sÀeZdZdZdZdZdZdd„Zdd„Zdd„Z    d    d
„Z
d d „Z d d„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zed'd(„ƒZd)d*„ZdS)+r‰zETry to implement resources and metadata for arbitrary PEP 302 loadersNcCs(t|ddƒ|_tj t|ddƒ¡|_dS)Nr®Ú__file__rº)rµr¹r¾r¿ÚdirnameÚ module_path©r—r¸rrrrnszNullProvider.__init__cCs| |j|¡Sr)Ú_fnr¤©r—rôrõrrrrörsz"NullProvider.get_resource_filenamecCst | ||¡¡Sr)ÚioÚBytesIOrør§rrrr÷usz NullProvider.get_resource_streamcCs| | |j|¡¡Sr)Ú_getr¦r¤r§rrrrøxsz NullProvider.get_resource_stringcCs| | |j|¡¡Sr)Ú_hasr¦r¤©r—rõrrrrú{szNullProvider.has_resourcecCs| |j|¡Sr)r¦Úegg_info©r—rärrrÚ_get_metadata_path~szNullProvider._get_metadata_pathcCs |js |jS| |¡}| |¡Sr)r­r¯r«©r—rär¿rrrrís
zNullProvider.has_metadatac
Cst|js
dS| |¡}| |¡}tjr(|Sz | d¡WStk
rn}z|jd ||¡7_‚W5d}~XYnXdS)Nrºúutf-8z in {} file at path: {})    r­r¯rªrÚPY2ÚdecodeÚUnicodeDecodeErrorÚreasonr )r—rär¿ÚvalueÚexcrrrrîˆs
 
 zNullProvider.get_metadatacCst| |¡ƒSr©rurîr®rrrrï—szNullProvider.get_metadata_linescCs| | |j|¡¡Sr)Ú_isdirr¦r¤r¬rrrr]šszNullProvider.resource_isdircCs|jo| | |j|¡¡Sr)r­r¹r¦r®rrrrðszNullProvider.metadata_isdircCs| | |j|¡¡Sr)Ú_listdirr¦r¤r¬rrrr[ szNullProvider.resource_listdircCs|jr| | |j|¡¡SgSr)r­rºr¦r®rrrrñ£szNullProvider.metadata_listdirc     CsÜd|}| |¡s$tdjftƒŽƒ‚| |¡ dd¡}| dd¡}| |j|¡}||d<tj     
|¡ršt |ƒ}|  ¡}W5QRXt ||dƒ}t|||ƒn>dd    lm}    t|ƒd| d¡|f|    |<t ||dƒ}
t|
||ƒdS)
Nzscripts/z<Script {script!r} not found in metadata at {self.egg_info!r}z
Ú
ú r¢Úexecr)Úcache)rírkr r¡rîrÓr¦r­r¾r¿rÀr ÚreadÚcompiler½Ú    linecacher¾Úlenr ) r—râròÚscriptÚ script_textÚscript_filenameZfidÚsourceÚcoder¾Ú script_coderrrrQ¨s0
ÿÿ  
  ÿ zNullProvider.run_scriptcCs tdƒ‚dS©Nz9Can't perform this operation for unregistered loader type©ÚNotImplementedErrorr‘rrrr«ÀsÿzNullProvider._hascCs tdƒ‚dSrÉrÊr‘rrrr¹ÅsÿzNullProvider._isdircCs tdƒ‚dSrÉrÊr‘rrrrºÊsÿzNullProvider._listdircCs*| |¡|r&tjj|f| d¡žŽS|S)Nú/)Ú_validate_resource_pathr¾r¿rIr )r—Úbaserõrrrr¦Ïs
zNullProvider._fncCsptjj| tj¡kp&t |¡p&t |¡}|s0dSd}t |¡rPt |¡sPt|ƒ‚t    j
|dd…dt dddS)aO
        Validate the resource paths according to the docs.
        https://setuptools.readthedocs.io/en/latest/pkg_resources.html#basic-resource-access
 
        >>> warned = getfixture('recwarn')
        >>> warnings.simplefilter('always')
        >>> vrp = NullProvider._validate_resource_path
        >>> vrp('foo/bar.txt')
        >>> bool(warned)
        False
        >>> vrp('../foo/bar.txt')
        >>> bool(warned)
        True
        >>> warned.clear()
        >>> vrp('/foo/bar.txt')
        >>> bool(warned)
        True
        >>> vrp('foo/../../bar.txt')
        >>> bool(warned)
        True
        >>> warned.clear()
        >>> vrp('foo/f../bar.txt')
        >>> bool(warned)
        False
 
        Windows path separators are straight-up disallowed.
        >>> vrp(r'\foo/bar.txt')
        Traceback (most recent call last):
        ...
        ValueError: Use of .. or absolute path in a resource path is not allowed.
 
        >>> vrp(r'C:\foo/bar.txt')
        Traceback (most recent call last):
        ...
        ValueError: Use of .. or absolute path in a resource path is not allowed.
 
        Blank values are allowed
 
        >>> vrp('')
        >>> bool(warned)
        False
 
        Non-string values are not.
 
        >>> vrp(None)
        Traceback (most recent call last):
        ...
        AttributeError: ...
        Nz=Use of .. or absolute path in a resource path is not allowed.rªz/ and will raise exceptions in a future release.rÍ©Ú
stacklevel) r¾r¿Úpardirr Ú    posixpathÚsepÚisabsÚntpathrLr‡rˆÚDeprecationWarning)r¿Úinvalidr‹rrrrÍÕs6ÿýýz$NullProvider._validate_resource_pathcCs$t|jdƒr|j |¡Stdƒ‚dS)NÚget_dataz=Can't perform this operation for loaders without 'get_data()')rÁr¹rØrËr‘rrrrª s
  ÿzNullProvider._get)rrrrÚegg_namer­r¹rrör÷rørúr¯rírîrïr]rðr[rñrQr«r¹rºr¦r“rÍrªrrrrr‰gs2
Jccs,d}||kr(|V|}tj |¡\}}qdS)z2
    yield all parents of path including path
    N)r¾r¿r )r¿ÚlastrÏrrrÚ_parents+s
rÛc@s(eZdZdZdd„Zdd„Zdd„ZdS)    rŠz&Provider based on a virtual filesystemcCst ||¡| ¡dSr)r‰rÚ _setup_prefixr¥rrrr9s zEggProvider.__init__cCs,ttt|jƒƒ}t|dƒ}|o&| |¡dSr)rÚ _is_egg_pathrÛr¤ÚnextÚ_set_egg)r—ÚeggsZeggrrrrÜ=s
zEggProvider._setup_prefixcCs(tj |¡|_tj |d¡|_||_dS)NúEGG-INFO)r¾r¿ÚbasenamerÙrIr­Úegg_rootr‘rrrrßDszEggProvider._set_eggN)rrrrrrÜrßrrrrrŠ6sc@sDeZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Ze    d d „ƒZ
dS)r‹z6Provides access to package resources in the filesystemcCs tj |¡Sr)r¾r¿rÀr‘rrrr«MszDefaultProvider._hascCs tj |¡Sr)r¾r¿r r‘rrrr¹PszDefaultProvider._isdircCs
t |¡Sr)r¾Úlistdirr‘rrrrºSszDefaultProvider._listdircCst| |j|¡dƒS©NÚrb)r r¦r¤r§rrrr÷Vsz#DefaultProvider.get_resource_streamc
Cs*t|dƒ}| ¡W5QR£SQRXdSrå)r r¿)r—r¿ÚstreamrrrrªYs zDefaultProvider._getcCs,d}|D]}tt|tdƒƒ}t||ƒqdS)N)ÚSourceFileLoaderÚSourcelessFileLoader)rµÚimportlib_machineryÚtyper)rÚ loader_namesräÚ
loader_clsrrrÚ    _register]szDefaultProvider._registerN) rrrrr«r¹rºr÷rªrGrîrrrrr‹Jsc@s8eZdZdZdZdd„ZZdd„Zdd„Zd    d
„Z    dS) r‡z.Provider that returns nothing for all requestsNcCsdS©NFrr‘rrrr?mr@zEmptyProvider.<lambda>cCsdS©Nrºrr‘rrrrªoszEmptyProvider._getcCsgSrrr‘rrrrºrszEmptyProvider._listdircCsdSrrr–rrrruszEmptyProvider.__init__)
rrrrr¤r¹r«rªrºrrrrrr‡hs  c@s eZdZdZedd„ƒZeZdS)Ú ZipManifestsz
    zip manifest builder
    c
s@t |¡,‰‡fdd„ˆ ¡Dƒ}t|ƒW5QR£SQRXdS)a
        Build a dictionary similar to the zipimport directory
        caches, except instead of tuples, store ZipInfo objects.
 
        Use a platform-specific path separator (os.sep) for the path keys
        for compatibility with pypy on Windows.
        c3s&|]}| dtj¡ˆ |¡fVqdS)rÌN)rÓr¾rÓÚgetinfo©rrä©Úzfilerrr‹sý þz%ZipManifests.build.<locals>.<genexpr>N)ÚzipfileÚZipFileÚnamelistr$)rr¿r*rrôrÚbuilds
     
ûzZipManifests.buildN)rrrrrGrùÚloadrrrrrñ|s
rñc@s$eZdZdZe dd¡Zdd„ZdS)ÚMemoizedZipManifestsz%
    Memoized zipfile manifests.
    Ú manifest_modzmanifest mtimecCsRtj |¡}t |¡j}||ks.||j|krH| |¡}| ||¡||<||jS)zW
        Load a manifest at path or return a suitable manifest already loaded.
        )    r¾r¿ÚnormpathrƒÚst_mtimeÚmtimerùrüÚmanifest)r—r¿rÿrrrrrús   
zMemoizedZipManifests.loadN)rrrrr$Ú
namedtuplerürúrrrrrû—s rûc@sšeZdZdZdZeƒZdd„Zdd„Zdd„Z    e
d    d
„ƒZ d d „Z e d d„ƒZdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd „ZdS)!rŒz"Resource support for zips and eggsNcCs t ||¡|jjtj|_dSr)rŠrr¹Úarchiver¾rÓÚzip_prer¥rrrr±s zZipProvider.__init__cCsP| tj¡}||jjkrdS| |j¡r:|t|jƒd…Std||jfƒ‚dS)Nrºú%s is not a subpath of %s)    Úrstripr¾rÓr¹rrÑrrÂÚAssertionError©r—ÚfspathrrrÚ _zipinfo_nameµs    ÿzZipProvider._zipinfo_namecCsP|j|}| |jtj¡r:|t|jƒdd… tj¡Std||jfƒ‚dS)Nrœr)rrÑrãr¾rÓrÂr r)r—Úzip_pathrrrrÚ_partsÁs 
 ÿzZipProvider._partscCs|j |jj¡Sr)Ú_zip_manifestsrúr¹rr–rrrÚzipinfoËszZipProvider.zipinfocCs\|jstdƒ‚| |¡}| ¡}d | |¡¡|krP|D]}| || |¡¡q8| ||¡S)Nz5resource_filename() only supported for .egg, not .ziprÌ)rÙrËÚ_resource_to_zipÚ_get_eager_resourcesrIr Ú_extract_resourceÚ _eager_to_zip)r—rôrõr
ÚeagersrärrrröÏsÿ
z!ZipProvider.get_resource_filenamecCs"|j}|jd}t |¡}||fS)N)rrrª)Ú    file_sizeÚ    date_timeÚtimeÚmktime)Úzip_statÚsizerÚ    timestamprrrÚ_get_date_and_sizeÜs
 
zZipProvider._get_date_and_sizec
Csx|| ¡kr@| ¡|D]}| |tj ||¡¡}qtj |¡S| |j|¡\}}ts`t    dƒ‚zò| 
|j |  |¡¡}|  ||¡rˆ|WStdtj |¡d\}}    t ||j |¡¡t |¡t|    ||fƒ| |    |¡zt|    |ƒWnhtjk
rNtj |¡rH|  ||¡r |YWStjdkrHt|ƒt|    |ƒ|YWS‚YnXWn tjk
rr| ¡YnX|S)Nz>"os.rename" and "os.unlink" are not supported on this platformz    .$extract)Údirr€)Ú_indexrr¾r¿rIr£rr Ú WRITE_SUPPORTÚIOErrorrrÙr Ú _is_currentÚ_mkstempÚwriter¹rØÚcloserrr    ÚerrorÚisfilerär
rw)
r—rôr
rärÚrrÚ    real_pathÚoutfÚtmpnamrrrråsN  ÿ ÿ 
þ
 
 
 
 
 zZipProvider._extract_resourcec        Csx| |j|¡\}}tj |¡s$dSt |¡}|j|ksB|j|krFdS|j     |¡}t
|dƒ}|  ¡}W5QRX||kS)zK
        Return True if the file_path is current for this zip_path
        Fræ) rr r¾r¿r$rƒÚst_sizerþr¹rØr r¿)    r—Ú    file_pathr
rrrƒÚ zip_contentsÚfÚ file_contentsrrrrs 
  zZipProvider._is_currentcCs>|jdkr8g}dD]}| |¡r| | |¡¡q||_|jS)N)znative_libs.txtzeager_resources.txt)rrír+rï)r—rrärrrr,s
 
z ZipProvider._get_eager_resourcesc    CsŽz|jWStk
rˆi}|jD]V}| tj¡}|r"tj |dd…¡}||krh|| |d¡q"q2| ¡g||<q2q"||_|YSXdS)Nrª)    Ú    _dirindexÚAttributeErrorr r r¾rÓrIrÃr')r—Úindr¿ÚpartsÚparentrrrr5s
 zZipProvider._indexcCs | |¡}||jkp|| ¡kSr)r    r r)r—rr
rrrr«Fs
zZipProvider._hascCs| |¡| ¡kSr)r    rrrrrr¹JszZipProvider._isdircCst| ¡ | |¡d¡ƒS©Nr)r"rrÊr    rrrrrºMszZipProvider._listdircCs| | |j|¡¡Sr)r    r¦rãr¬rrrrPszZipProvider._eager_to_zipcCs| | |j|¡¡Sr)r    r¦r¤r¬rrrrSszZipProvider._resource_to_zip)rrrrrrûr rr    r r¦r rör“rrrrrr«r¹rºrrrrrrrŒ«s( 
 
 
7    c@s@eZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Zd d „Z    dS)r„a*Metadata handler for standalone PKG-INFO files
 
    Usage::
 
        metadata = FileMetadata("/path/to/PKG-INFO")
 
    This provider rejects all data and metadata requests except for PKG-INFO,
    which is treated as existing, and will be the contents of the file at
    the provided location.
    cCs
||_dSr©r¿r‘rrrrfszFileMetadata.__init__cCs|jSrr3r®rrrr¯iszFileMetadata._get_metadata_pathcCs|dkotj |j¡S)NúPKG-INFO)r¾r¿r$r®rrrrílszFileMetadata.has_metadatac    CsD|dkrtdƒ‚tj|jddd}| ¡}W5QRX| |¡|S)Nr4z(No metadata except PKG-INFO is availabler±rÓ)ÚencodingÚerrors)r³r¨r r¿r¿Ú_warn_on_replacement)r—rär+Úmetadatarrrrîos 
zFileMetadata.get_metadatacCs2d d¡}||kr.d}|jftƒŽ}t |¡dS)Ns�r±z2{self.path} could not be properly decoded in UTF-8)r³r r¡r‡rˆ)r—r8Úreplacement_charrur‹rrrr7xs
 
z!FileMetadata._warn_on_replacementcCst| |¡ƒSrr¸r®rrrrï€szFileMetadata.get_metadata_linesN)
rrrrrr¯rírîr7rïrrrrr„Zs     c@seZdZdZdd„ZdS)r…asMetadata provider for egg directories
 
    Usage::
 
        # Development eggs:
 
        egg_info = "/path/to/PackageName.egg-info"
        base_dir = os.path.dirname(egg_info)
        metadata = PathMetadata(base_dir, egg_info)
        dist_name = os.path.splitext(os.path.basename(egg_info))[0]
        dist = Distribution(basedir, project_name=dist_name, metadata=metadata)
 
        # Unpacked egg directories:
 
        egg_path = "/path/to/PackageName-ver-pyver-etc.egg"
        metadata = PathMetadata(egg_path, os.path.join(egg_path,'EGG-INFO'))
        dist = Distribution.from_filename(egg_path, metadata=metadata)
    cCs||_||_dSr)r¤r­)r—r¿r­rrrr˜szPathMetadata.__init__N©rrrrrrrrrr…„sc@seZdZdZdd„ZdS)r†z Metadata provider for .egg filescCsD|jtj|_||_|jr0tj |j|j¡|_n|j|_|     ¡dS)z-Create a metadata provider from a zipimporterN)
rr¾rÓrr¹Úprefixr¿rIr¤rÜ)r—Úimporterrrrr s zEggMetadata.__init__Nr:rrrrr†sr$©Ú_distribution_finderscCs |t|<dS)axRegister `distribution_finder` to find distributions in sys.path items
 
    `importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
    handler), and `distribution_finder` is a callable that, passed a path
    item and the importer instance, yields ``Distribution`` instances found on
    that path item.  See ``pkg_resources.find_on_path`` for an example.Nr=)Ú importer_typeÚdistribution_finderrrrr¯scCst|ƒ}tt|ƒ}||||ƒS)z.Yield distributions accessible via `path_item`)rr¶r>)Ú    path_itemÚonlyr<Úfinderrrrra¹s
c    csÆ|j d¡rdSt|ƒ}| d¡r2tj||dV|r:dS| d¡D]|}t|ƒr€tj     
||¡}t t   |¡|ƒ}|D]
}|VqrqD| ¡ d¡rDtj     
||¡}tt   |¡ƒ}||_t |||¡VqDdS)z@
    Find eggs in zip files; possibly multiple nested eggs.
    z.whlNr4©r8rºú
.dist-info)rÚendswithr†rírhÚ from_filenamer[rÝr¾r¿rIÚfind_eggs_in_zipÚ    zipimportÚ zipimporterrWr­Ú from_location)    r<rArBr8ÚsubitemÚsubpathr ršÚsubmetarrrrHÀs$ 
 
rHcCsdSr2r)r<rArBrrrÚ find_nothingÞsrOcCsdd„}t||ddS)aL
    Given a list of filenames, return them in descending order
    by version number.
 
    >>> names = 'bar', 'foo', 'Python-2.7.10.egg', 'Python-2.7.2.egg'
    >>> _by_version_descending(names)
    ['Python-2.7.10.egg', 'Python-2.7.2.egg', 'foo', 'bar']
    >>> names = 'Setuptools-1.2.3b1.egg', 'Setuptools-1.2.3.egg'
    >>> _by_version_descending(names)
    ['Setuptools-1.2.3.egg', 'Setuptools-1.2.3b1.egg']
    >>> names = 'Setuptools-1.2.3b1.egg', 'Setuptools-1.2.3.post1.egg'
    >>> _by_version_descending(names)
    ['Setuptools-1.2.3.post1.egg', 'Setuptools-1.2.3b1.egg']
    cSs2tj |¡\}}t | d¡|g¡}dd„|DƒS)z6
        Parse each component of the filename
        r˜cSsg|]}tj |¡‘qSr)rrræ)rÚpartrrrÚ
<listcomp>úsz?_by_version_descending.<locals>._by_version.<locals>.<listcomp>)r¾r¿ÚsplitextÚ    itertoolsÚchainr )räÚextr0rrrÚ _by_versionôsz+_by_version_descending.<locals>._by_versionTr[)Úsorted)r|rVrrrÚ_by_version_descendingåsrXc
#s”tˆƒ‰tˆƒr4tjˆtˆtj ˆd¡ƒdVdStˆƒ}‡‡fdd„|Dƒ}t    |ƒ}|D]2}tj ˆ|¡}t
ˆ|ˆƒ}||ƒD]
}    |    Vq‚q\dS)z6Yield distributions accessible on a sys.path directoryrárDNc3s|]}tˆ|ˆƒr|VqdSr)Ú dist_factory)rr©rBrArrrs þzfind_on_path.<locals>.<genexpr>) Ú_normalize_cachedÚ_is_unpacked_eggrhrGr…r¾r¿rIÚ safe_listdirrXrY)
r<rArBrûÚfilteredÚpath_item_entriesrÚfullpathÚfactoryršrrZrÚ find_on_pathÿs( ÿÿ þ  rbcCsj| ¡}| d¡}| d¡o0tj tj ||¡¡}|p8|}|rBtS|sRt|ƒrRtS|sd| d¡rdt    St
ƒS)z*Return a dist_factory for the given entry.ú    .egg-inforEz    .egg-link) rWrFr¾r¿r rIÚdistributions_from_metadatarÝraÚresolve_egg_linkÚNoDists)rArrBrWZ is_egg_infoZ is_dist_infoÚis_metarrrrYs$
 
þÿÿÿÿÿùrYc@s*eZdZdZdd„ZejreZdd„ZdS)rfzS
    >>> bool(NoDists())
    False
 
    >>> list(NoDists()('anything'))
    []
    cCsdSrïrr–rrrÚ__bool__;szNoDists.__bool__cCstdƒSr2)Úiter)r—r`rrrÚ__call__@szNoDists.__call__N)    rrrrrhrr²Ú __nonzero__rjrrrrrf3s
rfc
Csvz t |¡WSttfk
r$YnNtk
rp}z0|jtjtjtjfkpXt    |ddƒdk}|s`‚W5d}~XYnXdS)zI
    Attempt to list contents of path, but suppress some exceptions.
    ÚwinerrorNi r)
r¾räÚPermissionErrorÚNotADirectoryErrorÚOSErrorÚerrnoÚENOTDIRÚEACCESÚENOENTrµ)r¿ržÚ    ignorablerrrr]Ds ýr]ccsftj |¡}tj |¡r:tt |¡ƒdkr.dSt||ƒ}nt|ƒ}tj |¡}t    j
|||t dVdS)Nr)Ú
precedence) r¾r¿r£r rÂrär…r„rârhrKr)r¿Úrootr8rrrrrdYs    ÿrdc    cs4t|ƒ"}|D]}| ¡}|r|VqW5QRXdS)z1
    Yield non-empty lines from file at path
    N)r Ústrip)r¿r+ÚlinerrrÚnon_empty_lineshs
 
rycs.tˆƒ}‡fdd„|Dƒ}tt|ƒ}t|dƒS)za
    Given a path to an .egg-link, resolve distributions
    present in the referenced path.
    c3s$|]}tj tj ˆ¡|¡VqdSr)r¾r¿rIr£)rÚrefr3rrrysÿz#resolve_egg_link.<locals>.<genexpr>r)ryrrarÞ)r¿Úreferenced_pathsÚresolved_pathsÚ dist_groupsrr3rress 
þ
reÚ
FileFinder©Ú_namespace_handlers)Ú_namespace_packagescCs |t|<dS)ašRegister `namespace_handler` to declare namespace packages
 
    `importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
    handler), and `namespace_handler` is a callable like this::
 
        def namespace_handler(importer, path_entry, moduleName, module):
            # return a path_entry to use for child packages
 
    Namespace handlers are only called if the importer object has already
    agreed that it can handle the relevant path item, and they should only
    return a subpath if the module __path__ does not already contain an
    equivalent subpath.  For an example namespace handler, see
    ``pkg_resources.file_ns_handler``.
    Nr)r?Únamespace_handlerrrrrŽŠsc Cst|ƒ}|dkrdSz| |¡j}Wn<tk
r`t ¡t d¡| |¡}W5QRXYnX|dkrndStj     
|¡}|dkr¦t   |¡}tj    |<g|_ t|ƒnt|dƒsºtd|ƒ‚tt|ƒ}|||||ƒ}|dk    r|j }| |¡| |¡t|||ƒ|S)zEEnsure that named package includes a subpath of path_item (if needed)NÚignoreÚ__path__úNot a package:)rÚ    find_specr¹r.r‡Úcatch_warningsÚ simplefilterÚ find_modulerGr²rÊÚtypesÚ
ModuleTyper„Ú_set_parent_nsrÁrçr¶r€rÃÚ load_moduleÚ_rebuild_mod_path)Ú packageNamerAr<r¹r¸ÚhandlerrMr¿rrrÚ
_handle_nsœs4
 
 
 
 
 
 
 
 
 r‘csjdd„tjDƒ‰‡fdd„‰‡‡fdd„}t||d}dd„|Dƒ}t|jtƒr`||jd    d    …<n||_d    S)
zq
    Rebuild module.__path__ ensuring that all entries are ordered
    corresponding to their sys.path order
    cSsg|] }t|ƒ‘qSr©r[©rÚprrrrQÄsz%_rebuild_mod_path.<locals>.<listcomp>cs.z ˆ |¡WStk
r(tdƒYSXdS)z/
        Workaround for #520 and #513.
        ÚinfN)ÚindexrLÚfloat)r)Úsys_pathrrÚsafe_sys_path_indexÆs z._rebuild_mod_path.<locals>.safe_sys_path_indexcs<| tj¡}ˆ d¡d}|d| …}ˆttj |¡ƒƒS)zR
        Return the ordinal of the path based on its position in sys.path
        rBrœN)r r¾rÓÚcountr[rI)r¿Ú
path_partsÚ module_partsr0)Ú package_namer™rrÚposition_in_sys_pathÏs z/_rebuild_mod_path.<locals>.position_in_sys_path)r8cSsg|] }t|ƒ‘qSrr’r“rrrrQÙsN)rGr¿rWr¯r„r")Ú    orig_pathrr¸ržÚnew_pathr)rr™r˜rrŽ¿s           rŽc
CsÔt ¡z¼|tkrW¢°dStj}| d¡\}}}|rŒt|ƒ|tkrLt|ƒztj    |j
}Wn.t k
rŠ}zt d|ƒ|‚W5d}~XYnXt  |p–dg¡ |¡t  |g¡|D]}t||ƒq²W5t ¡XdS)z9Declare that package 'packageName' is a namespace packageNrBr…)Ú_impÚ acquire_lockÚ release_lockrrGr¿Ú
rpartitionr^r´r²r„r.rçrrÃr‘)rr¿r1rÏržrArrrr^ás& cCsFt ¡z.t |d¡D]}t||ƒ}|rt||ƒqW5t ¡XdS)zDEnsure that previously-declared namespace packages include path_itemrN)r¡r¢r£rrÊr‘r)rAr1ÚpackagerMrrrr    s
cCsDtj || d¡d¡}t|ƒ}|jD]}t|ƒ|kr&q@q&|SdS)zBCompute an ns-package subpath for a filesystem or zipfile importerrBrªN)r¾r¿rIr r[r„)r<rArr¸rMÚ
normalizedrrrrÚfile_ns_handler    s 
 r§cCsdSrr)r<rArr¸rrrÚnull_ns_handler#    sr¨cCs tj tj tj t|ƒ¡¡¡S)z1Normalize a file/dir name for comparison purposes)r¾r¿ÚnormcaseÚrealpathrýÚ _cygwin_patch©rrrrr|*    sÿcCstjdkrtj |¡S|S)a
    Contrary to POSIX 2008, on Cygwin, getcwd (3) contains
    symlink components. Using
    os.path.abspath() works around this limitation. A fix in os.getcwd()
    would probably better, in Cygwin even more so, except
    that this seems to be by design...
    Úcygwin)rGrHr¾r¿Úabspathr¬rrrr«0    sr«cCs8z
||WStk
r2t|ƒ||<}|YSXdSr)r³r|)rrÄÚresultrrrr[;    s
 
r[cCs| ¡ d¡S)z7
    Determine if given path appears to be an egg.
    ú.egg)rWrFr3rrrrÝC    srÝcCs t|ƒotj tj |dd¡¡S)z@
    Determine if given path appears to be an unpacked egg.
    rár4)rÝr¾r¿r$rIr3rrrr\J    sþr\cCs<| d¡}| ¡}|r8d |¡}ttj||tj|ƒdS)NrB)r r'rIÚsetattrrGr²)rr0rär1rrrrŒT    s
 
 
rŒccsZt|tjƒr8| ¡D] }| ¡}|r| d¡s|Vqn|D]}t|ƒD]
}|VqHq<dS)z9Yield non-empty/non-comment lines of a string or sequenceú#N)r¯rråÚ
splitlinesrwrÑru)ÚstrsÚsÚssrrrru\    s  
 z \w+(\.\w+)*$z–
    (?P<name>[^-]+) (
        -(?P<ver>[^-]+) (
            -py(?P<pyver>[^-]+) (
                -(?P<plat>.+)
            )?
        )?
    )?
    c@s†eZdZdZddd„Zdd„Zdd    „Zdd d „Zd d„Zddd„Z    e
  d¡Z e ddd„ƒZe dd„ƒZe ddd„ƒZe ddd„ƒZdS) rjz3Object representing an advertised importable objectrNcCs<t|ƒstd|ƒ‚||_||_t|ƒ|_t|ƒ|_||_dS)NzInvalid module name)ÚMODULErLräÚ module_nameÚtupleÚattrsr*rš)r—rär¸rºr*ršrrrr|    s
 
 
zEntryPoint.__init__cCsHd|j|jf}|jr*|dd |j¡7}|jrD|dd |j¡7}|S)Nz%s = %sú:rBz [%s]ú,)rär¸rºrIr*)r—rµrrrr©…    s zEntryPoint.__str__cCs dt|ƒS)NzEntryPoint.parse(%r)©r±r–rrrr˜    szEntryPoint.__repr__TcOs4|r |s |rtjdtdd|r,|j||Ž| ¡S)zH
        Require packages for this EntryPoint, then resolve it.
        zJParameters to load are deprecated.  Call .resolve and .require separately.rCrÏ)r‡rˆr‘rPr    )r—rPr>Úkwargsrrrrú    s ü zEntryPoint.loadc
CsZt|jdgdd}zt t|j|¡WStk
rT}ztt|ƒƒ|‚W5d}~XYnXdS)zD
        Resolve the entry point from its module and attrs.
        rr)ÚfromlistÚlevelN)    r´r¸Ú    functoolsÚreducerµrºr.rr±)r—r¸r·rrrr    Ÿ    s
zEntryPoint.resolvecCsL|jr|jstd|ƒ‚|j |j¡}tj||||jd}tttj|ƒƒdS)Nz&Can't require() without a distribution)r*)    r*ršrnrr_r    r"rr
)r—r.r/r r*rrrrP©    s
 
zEntryPoint.requirez]\s*(?P<name>.+?)\s*=\s*(?P<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+))?\s*(?P<extras>\[.*\])?\s*$cCsf|j |¡}|sd}t||ƒ‚| ¡}| |d¡}|drJ|d d¡nd}||d|d|||ƒS)aParse a single entry point from string `src`
 
        Entry point syntax follows the form::
 
            name = some.module:some.attr [extra1, extra2]
 
        The entry name and module name are required, but the ``:attrs`` and
        ``[extras]`` parts are optional
        z9EntryPoint must be in 'name=module:attrs [extras]' formatr*ÚattrrBrrär¸)ÚpatternrFrLÚ    groupdictÚ _parse_extrasr )rÚsrcršrNr‹Úresr*rºrrrræ¿    s 
zEntryPoint.parsecCs(|sdSt d|¡}|jr"tƒ‚|jS)NrÚx)riræÚspecsrLr*)rÚ extras_specrrrrrÆÓ    s zEntryPoint._parse_extrascCsVt|ƒstd|ƒ‚i}t|ƒD]2}| ||¡}|j|krFtd||jƒ‚|||j<q|S)zParse an entry point groupzInvalid group namezDuplicate entry point)r·rLrurærä)rrKÚlinesršÚthisrxÚeprrrÚ parse_groupÜ    s
 
 zEntryPoint.parse_groupcCstt|tƒr| ¡}nt|ƒ}i}|D]J\}}|dkrB|s:q$tdƒ‚| ¡}||kr\td|ƒ‚| |||¡||<q$|S)z!Parse a map of entry point groupsNz%Entry points must be listed in groupszDuplicate group name)r¯r$r*rvrLrwrÏ)rÚdataršÚmapsrKrÌrrrÚ    parse_mapé    s
 
 
zEntryPoint.parse_map)rrN)T)NN)N)N)N)rrrrrr©r˜rúr    rPr™rÀrÄrGrærÆrÏrÒrrrrrjy    s$
    
 
 
ÿ     
 cCs@dd„}t||ƒ}tt|ƒdƒ}| d¡\}}}t| ¡ƒp>dS)z„
    Given an iterable of lines from a Metadata file, return
    the value of the Version field, if present, or None otherwise.
    cSs| ¡ d¡S)Nzversion:)rWrÑ)rxrrrÚis_version_line
sz+_version_from_file.<locals>.is_version_linerºr»N)rrÞriÚ    partitionrrrw)rÌrÓÚ version_linesrxrÏr¶rrrÚ_version_from_fileý    s
 
rÖcsšeZdZdZdZddddedefdd„ZedSdd„ƒZ    dd    „Z
e d
d „ƒZ d d „Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Ze dd„ƒZe dd„ƒZdd„Ze d d!„ƒZe d"d#„ƒZed$d%„ƒZd&d'„ZdTd)d*„Zd+d,„Zd-d.„Zd/d0„ZdUd2d3„Z d4d5„Z!d6d7„Z"d8d9„Z#d:d;„Z$‡fd<d=„Z%e&e'd>ƒs4[%edVd?d@„ƒZ(dAdB„Z)dCdD„Z*dWdEdF„Z+dGdH„Z,dXdIdJ„Z-dKdL„Z.dMdN„Z/dOdP„Z0e dQdR„ƒZ1‡Z2S)Yrhz5Wrap an actual or potential sys.path entry w/metadatar4NcCsFt|pdƒ|_|dk    r t|ƒ|_||_||_||_||_|p>t|_    dS)NÚUnknown)
rqr,rrÚ_versionrSrHrrurˆÚ    _provider)r—rr8r,rrSrHrurrrr
s
zDistribution.__init__c Ks~dgd\}}}}tj |¡\}}    |     ¡tkr^t|     ¡}t|ƒ}
|
r^|
 dddd¡\}}}}|||f||||dœ|—Ž ¡S)NrÍräÚverÚpyverrM)r,rrSrH)r¾r¿rRrWÚ_distributionImplÚEGG_NAMErKÚ_reload_version) rrrâr8r'r,rrSrHrUrFrrrrK
s.  ÿ ÿþþzDistribution.from_locationcCs|Srrr–rrrrÞ,
szDistribution._reload_versioncCs$|j|j|j|j|jpd|jp dfSrð)Úparsed_versionrur8rrSrHr–rrrrZ/
súzDistribution.hashcmpcCs
t|jƒSr)ÚhashrZr–rrrÚ__hash__:
szDistribution.__hash__cCs |j|jkSr©rZ©r—rcrrrÚ__lt__=
szDistribution.__lt__cCs |j|jkSrrârãrrrÚ__le__@
szDistribution.__le__cCs |j|jkSrrârãrrrÚ__gt__C
szDistribution.__gt__cCs |j|jkSrrârãrrrÚ__ge__F
szDistribution.__ge__cCst||jƒsdS|j|jkSrï)r¯r”rZrãrrrÚ__eq__I
s zDistribution.__eq__cCs
||k SrrrãrrrÚ__ne__O
szDistribution.__ne__cCs6z|jWStk
r0|j ¡|_}|YSXdSr)Ú_keyr.r,rWrbrrrr8V
s
zDistribution.keycCst|dƒst|jƒ|_|jS)NÚ_parsed_version)rÁr rrër–rrrrß^
s
 zDistribution.parsed_versioncCsXtjj}t|j|ƒ}|sdS|js&dSt d¡ ¡ dd¡}t     
|j ft |ƒŽt ¡dS)Na>
            '{project_name} ({version})' is being parsed as a legacy,
            non PEP 440,
            version. You may find odd behavior and sort order.
            In particular it will be sorted as less than 0.0. It
            is recommended to migrate to PEP 440 compatible
            versions.
            r»rÎ)rrrr¯rërorprwrÓr‡rˆr Úvarsr)r—ÚLVÚ    is_legacyrurrrÚ_warn_legacy_versione
s ù    z!Distribution._warn_legacy_versionc
Csnz|jWStk
rh}zB| ¡}|dkrP| |j¡}d |j|¡}t||ƒ|‚|WY¢Sd}~XYnXdS)Nz4Missing 'Version:' header and/or {} file at path: {})rØr.Ú _get_versionÚ_get_metadata_path_for_displayÚPKG_INFOr rL)r—ržrr¿r‹rrrr
s ÿþ zDistribution.versioncCs4z|jWStk
r,| | ¡¡|_YnX|jS)z~
        A map of extra to its list of (direct) requirements
        for this distribution, including the null extra.
        )Ú_Distribution__dep_mapr.Ú_filter_extrasÚ_build_dep_mapr–rrrÚ_dep_mapŽ
s
zDistribution._dep_mapcCsrttd|ƒƒD]^}|}| |¡}| d¡\}}}|oDt|ƒpDt|ƒ }|rNg}t|ƒpXd}| |g¡ |¡q|S)z¤
        Given a mapping of extras to dependencies, strip off
        environment markers and filter out any dependencies
        not matching the markers.
        Nr»)    r"rr'rÔryrzrwrr+)ÚdmrHÚ    new_extrar rÏrJÚ fails_markerrrrrôš
s
þ zDistribution._filter_extrascCs@i}dD]2}t| |¡ƒD]\}}| |g¡ t|ƒ¡qq|S)N)z requires.txtz depends.txt)rvÚ _get_metadatarr+rp)r—r÷rärHr rrrrõ°
s
zDistribution._build_dep_maprc Csv|j}g}| | dd¡¡|D]P}z| |t|ƒ¡Wq tk
rn}ztd||fƒ|‚W5d}~XYq Xq |S)z@List of Requirements needed for this distro if `extras` are usedNrz%s has no such extra feature %r)rör+rÊrwr³rn)r—r*r÷ÚdepsrUržrrrr·
s
ÿþzDistribution.requirescCs,z|j |¡}Wntk
r&YdSX|S)zK
        Return the path to the given metadata file, if available.
        z[could not detect])rÙr¯ryr°rrrrñÅ
s
z+Distribution._get_metadata_path_for_displayccs$| |¡r | |¡D]
}|VqdSr)rírï)r—rärxrrrrúÖ
s
zDistribution._get_metadatacCs| |j¡}t|ƒ}|Sr)rúròrÖ)r—rÌrrrrrðÛ
s zDistribution._get_versionFcCsV|dkrtj}|j||d|tjkrRt|jƒ| d¡D]}|tjkr:t|ƒq:dS)z>Ensure distribution is importable on `path` (default=sys.path)Nrúnamespace_packages.txt)rGr¿rrrrúr²r^)r—r¿rÓÚpkgrrrÚactivateá
s
 
 
zDistribution.activatecCs8dt|jƒt|jƒ|jptf}|jr4|d|j7}|S)z@Return what this distribution's standard .egg filename should bez
%s-%s-py%sr˜)rxr,rrSrirH)r—rrrrrÙì
sþzDistribution.egg_namecCs |jrd||jfSt|ƒSdS)Nz%s (%s))rr±r–rrrr˜÷
szDistribution.__repr__cCs@zt|ddƒ}Wntk
r(d}YnX|p0d}d|j|fS)Nrz[unknown version]z%s %s)rµrLr,)r—rrrrr©ý
s 
zDistribution.__str__cCs| d¡rt|ƒ‚t|j|ƒS)zADelegate all unrecognized public attributes to .metadata providerrÏ)rÑr.rµrÙ)r—rÃrrrÚ __getattr__ s
zDistribution.__getattr__cs.tttt|ƒ ¡ƒtdd„|j ¡DƒƒBƒS)Ncss|]}| d¡s|VqdS©rÏN)rÑ)rrÃrrrr s
ÿz'Distribution.__dir__.<locals>.<genexpr>)r"r&ÚsuperrhÚ__dir__rÙr–rfrrr sÿÿÿzDistribution.__dir__rcKs|jt|ƒtj |¡|f|ŽSr)rKr[r¾r¿râ)rrr8r'rrrrG s
ÿþzDistribution.from_filenamecCs<t|jtjjƒr"d|j|jf}nd|j|jf}t |¡S)z?Return a ``Requirement`` that matches this distribution exactlyz%s==%sz%s===%s)r¯rßrrrr,riræ)r—Úspecrrrr8 szDistribution.as_requirementcCs.| ||¡}|dkr&td||ffƒ‚| ¡S)z=Return the `name` entry point of `group` or raise ImportErrorNzEntry point %r not found)rVrrú)r—rKrärÎrrrrT( s zDistribution.load_entry_pointcCsPz
|j}Wn,tk
r6t | d¡|¡}|_YnX|dk    rL| |i¡S|S)rêzentry_points.txtN)Ú_ep_mapr.rjrÒrúrÊ)r—rKÚep_maprrrrU/ s
ÿ zDistribution.get_entry_mapcCs| |¡ |¡Srë)rUrÊrrrrrV; szDistribution.get_entry_infoc
Cs4|p|j}|sdSt|ƒ}tj |¡}dd„|Dƒ}t|ƒD]|\}}||kr^|rVqìq¸dSq<||kr<|jtkr<|sŠ|||d…krŠdS|tjkrœ|     ¡| 
||¡| 
||¡qìq<|tjkrÌ|     ¡|rÞ| 
d|¡n
|  |¡dSz|  ||d¡}    Wnt k
rYq0YqìX||    =||    =|    }qìdS)aäEnsure self.location is on path
 
        If replace=False (default):
            - If location is already in path anywhere, do nothing.
            - Else:
              - If it's an egg and its parent directory is on path,
                insert just ahead of the parent.
              - Else: add to the end of path.
        If replace=True:
            - If location is already on path anywhere (not eggs)
              or higher priority than its parent (eggs)
              do nothing.
            - Else:
              - If it's an egg and its parent directory is on path,
                insert just ahead of the parent,
                removing any lower-priority entries.
              - Else: add it to the front of path.
        NcSsg|]}|rt|ƒp|‘qSrr’r“rrrrQY sz*Distribution.insert_on.<locals>.<listcomp>rrœ)rr[r¾r¿r£Ú    enumeraterur}rGÚcheck_version_conflictrrÃr–rL)
r—r¿ÚlocrÓÚnlocÚbdirÚnpathr”rÚnprrrr? s@
 
 
 
  zDistribution.insert_oncCs¨|jdkrdSt | d¡¡}t|jƒ}| d¡D]p}|tjks2||ks2|tkrRq2|dkr\q2t    tj|ddƒ}|rŽt|ƒ 
|¡s2| 
|j¡rŽq2t d|||jfƒq2dS)NÚ
setuptoolsrüz top_level.txt)Ú pkg_resourcesr Úsiter¢zIModule %s was already imported from %s, but %s is being added to sys.path) r8r$r%rúr|rrGr²rrµrÑÚ issue_warning)r—ÚnsprÚmodnameÚfnrrrrƒ s*
 
ÿ
ÿ
ÿÿz#Distribution.check_version_conflictcCs6z
|jWn&tk
r0tdt|ƒƒYdSXdS)NzUnbuilt egg for FT)rrLrr•r–rrrr]™ s 
zDistribution.has_versioncKs@d}| ¡D]}| |t||dƒ¡q | d|j¡|jf|ŽS)z@Copy this distribution, substituting in any changed keyword argsz<project_name version py_version platform location precedenceNr8)r rrµrÙr”)r—r'r|rÃrrrÚclone¡ s
 zDistribution.clonecCsdd„|jDƒS)NcSsg|] }|r|‘qSrr)rÚdeprrrrQ« sz'Distribution.extras.<locals>.<listcomp>)rör–rrrr*© szDistribution.extras)N)r)NF)N)N)NF)3rrrrròrir}rrGrKrÞr¦rZrárärårærçrèrér8rßrïrrör“rôrõrrñrúrðrþrÙr˜r©rÿrrÁÚobjectrGr8rTrUrVrrr]rr*Ú __classcell__rrrfrrh
 
stý
 
 
 
 
 
 
 
 
 
            
 
Dc@seZdZdd„ZdS)ÚEggInfoDistributioncCs| ¡}|r||_|S)añ
        Packages installed by distutils (e.g. numpy or scipy),
        which uses an old safe_version, and so
        their version numbers can get mangled when
        converted to filenames (e.g., 1.11.0.dev0+2329eae to
        1.11.0.dev0_2329eae). These distributions will not be
        parsed properly
        downstream by Distribution and safe_version, so
        take an extra step and try to get the version number from
        the metadata file itself instead of the filename.
        )rðrØ)r—Ú
md_versionrrrrÞ¯ s z#EggInfoDistribution._reload_versionN)rrrrÞrrrrr® src@s>eZdZdZdZe d¡Zedd„ƒZ    edd„ƒZ
dd    „Z d
S) ÚDistInfoDistributionzV
    Wrap an actual or potential sys.path entry
    w/metadata, .dist-info style.
    ÚMETADATAz([\(,])\s*(\d.*?)\s*([,\)])cCsFz|jWStk
r@| |j¡}tj ¡ |¡|_|jYSXdS)zParse and cache metadataN)Ú    _pkg_infor.rîròÚemailÚparserÚParserÚparsestr)r—r8rrrÚ_parsed_pkg_infoÉ s  z%DistInfoDistribution._parsed_pkg_infocCs2z|jWStk
r,| ¡|_|jYSXdSr)Ú_DistInfoDistribution__dep_mapr.Ú_compute_dependenciesr–rrrröÓ s
 
zDistInfoDistribution._dep_mapcsšdgi}|_g‰|j d¡p gD]}ˆ t|ƒ¡q"‡fdd„}t|dƒƒ}|d |¡|j d¡pjgD](}t| ¡ƒ}tt||ƒƒ|ƒ||<ql|S)z+Recompute this distribution's dependencies.Nz Requires-Distc3s*ˆD] }|jr|j d|i¡r|VqdS)NrHrI)rHr©r rrÚreqs_for_extraä szBDistInfoDistribution._compute_dependencies.<locals>.reqs_for_extrazProvides-Extra)    r"r!Úget_allr+rpÚ    frozensetrwrwr")r—r÷rr%ÚcommonrHÚs_extrarr$rr#Û s   z*DistInfoDistribution._compute_dependenciesN) rrrrròr™rÀÚEQEQr¦r!rör#rrrrrÁ s
 
    
r)r°rcrEcOsZd}tƒ}zt |¡j|kr&|d7}q Wntk
r<YnXtj|d|di|—ŽdS)NrœrÐ)r!rGràrárLr‡rˆ)r>r'rÀr-rrrrú src    cs‚tt|ƒƒ}|D]l}d|kr.|d| d¡…}| d¡rr|dd… ¡}z|t|ƒ7}Wntk
rpYdSXt|ƒVqdS)zŠYield ``Requirement`` objects for each specification in `strs`
 
    `strs` must be a string, or a (possibly-nested) iterable thereof.
    z #Nú\éþÿÿÿ)rirur°rFrwrÞÚ StopIterationri)r´rÌrxrrrrp s 
 
c@seZdZdZdS)ÚRequirementParseErrorz,Compatibility wrapper for InvalidRequirementNrrrrrr. sr.csPeZdZ‡fdd„Zdd„Zdd„Zdd„Zd    d
„Zd d „Ze    d d„ƒZ
‡Z S)rics”tt|ƒ |¡|j|_t|jƒ}|| ¡|_|_dd„|j    Dƒ|_
t t t |jƒƒ|_|j|j|j    t|jƒ|jr|t|jƒndf|_t|jƒ|_dS)z>DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!cSsg|]}|j|jf‘qSr)r^r)rrrrrrQ( sz(Requirement.__init__.<locals>.<listcomp>N)rrirräÚ unsafe_namerqrWr,r8Ú    specifierrÊr¹rrwr*Úurlr'rJr±ÚhashCmpràÚ_Requirement__hash)r—Úrequirement_stringr,rfrrr" s
ÿûzRequirement.__init__cCst|tƒo|j|jkSr)r¯rir2rãrrrrè4 s
 
þzRequirement.__eq__cCs
||k Srrrãrrrré: szRequirement.__ne__cCs0t|tƒr |j|jkrdS|j}|jj|ddS)NFT)Ú prereleases)r¯rhr8rr0Úcontains)r—rrrrr= s
 
 zRequirement.__contains__cCs|jSr)r3r–rrrráI szRequirement.__hash__cCs dt|ƒS)NzRequirement.parse(%r)r½r–rrrr˜L szRequirement.__repr__cCst|ƒ\}|Sr)rp)rµrrrrræO s
zRequirement.parse) rrrrrèrérrár˜r“rærrrrfrri! s  cCst|kr|tfS|S)zJ
    Ensure object appears in the mro even
    for old-style classes.
    )r)ÚclassesrrrÚ_always_objectU s
r8cCs<tt t|dt|ƒƒ¡ƒ}|D]}||kr||SqdS)z2Return an adapter factory for `ob` from `registry`r”N)r8ÚinspectÚgetmrorµrë)Úregistryr9rŠÚtrrrr¶_ sr¶cCstj |¡}tj|dddS)z1Ensure that the parent directory of `path` existsT)Úexist_okN)r¾r¿r£Úmakedirs)r¿r£rrrr{g s cCsXts tdƒ‚t|ƒ\}}|rT|rTt|ƒsTt|ƒzt|dƒWntk
rRYnXdS)z/Sandbox-bypassing version of ensure_directory()z*"os.mkdir" not supported on this platform.iíN)rrr r rxrÚFileExistsError)r¿r£rrrrrxm s rxccsvd}g}t|ƒD]V}| d¡r\| d¡rP|s0|r:||fV|dd… ¡}g}qftd|ƒ‚q| |¡q||fVdS)asSplit a string or iterable thereof into (section, content) pairs
 
    Each ``section`` is a stripped version of the section header ("[section]")
    and each ``content`` is a list of stripped lines excluding blank lines and
    comment-only lines.  If there are any such lines before the first section
    header, they're returned in a first ``section`` of ``None``.
    Nú[ú]rœrªzInvalid section heading)rurÑrFrwrLrÃ)rµÚsectionÚcontentrxrrrrvz s 
 
 
  cOs*tj}ztt_tj||ŽW¢S|t_XdSr)r¾r Úos_openÚtempfileÚmkstemp)r>r'Úold_openrrrr ” s
r rƒ)ÚcategoryrÃcOs|||Ž|Srr)r+r>r¾rrrÚ _call_aside§ s
rIcs.tƒ‰ˆ|d<| ‡fdd„tˆƒDƒ¡dS)z=Set up global resource manager (deliberately not state-saved)Ú_managerc3s&|]}| d¡s|tˆ|ƒfVqdSr)rÑrµró©rôrrr± s
þz_initialize.<locals>.<genexpr>N)rgr"r)r-rrKrÚ _initialize¬ s
þrLcCs|t ¡}td|d|j}|j}|j}|j}|}tdd„|Dƒƒ|dd„ddg|_t    t
|j t j ƒƒtƒ tƒ¡d    S)
aE
    Prepare the master working set and make the ``require()``
    API available.
 
    This function has explicit effects on the global state
    of pkg_resources. It is intended to be invoked once at
    the initialization of this module.
 
    Invocation by other packages is unsupported and done
    at their own risk.
    r)r_css|]}|jddVqdS)FrN©rþ)rršrrrrÒ sÿz1_initialize_master_working_set.<locals>.<genexpr>cSs |jddS)NTrrMrèrrrr?× r@z0_initialize_master_working_set.<locals>.<lambda>F)rDN)rfrr(rPrWrErQr¹rûr"rrÿrGr¿r!r"r¡)r_rPrWr`rQr’rrrÚ_initialize_master_working_set¸ s"  þþrNc@seZdZdZdS)r‘z«
    Base class for warning about deprecations in ``pkg_resources``
 
    This class is not derived from ``DeprecationWarning``, and as such is
    visible by default.
    Nrrrrrr‘à s)N)N)F)F)F)F)N)ØrÚ
__future__rrGr¾r¨rr™rŠrörIr‡rƒrÁÚpkgutilr^rHr$rÂÚ email.parserrrprErorSr9rÕrÒrr¡rÚimpr?Ú    NameErrorroZpkg_resources.externrZpkg_resources.extern.six.movesrrrrr    r
rr rDÚos.pathr r Úimportlib.machineryÚ    machineryrêrrrr´rëÚ __metaclass__Ú version_infoÚ RuntimeErrorr²rmrnrPr_r`Úresources_streamrcÚ resource_dirrYrbr]rXrWr[rZr\r>r€rÚRuntimeWarningrr r#r(r/r1r5r:r;r<Ú
_sget_noneÚ
_sset_nonerOÚ__all__ryrkrlr£rmrnr«r rir}r~rr€rrrRrJrÌrDrÀrEr×rsrtrQr’rSrTrUrVr‚rƒrfr$r#rer“rorgrdrqrrrwrxryrzr‰rrÛrŠr‹rîr‡rˆrñrûrŒrJr„r…r†rrarHrOrXrbrYrfr]rdryreÚ ImpImporterrÁr~rŽr‘rŽr^rr§r¨r|r«r[rÝr\rŒrurFr·ÚVERBOSEÚ
IGNORECASErÝrjrÖrhrrrÜrrpr-ÚInvalidRequirementr.rir8r¶r{rxrvr ÚfilterwarningsrIr!rLrNÚWarningr‘rrrrÚ<module>sX   
 
 
 
   Ò2   
 
 
.
 
6       B
 - * 
 
        #""     
 
     
ö '3ý 4
 
'