zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
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
U
G=®dŒSã@s4dZddlmZddlmZddlmZmZddlmZmZm    Z    m
Z
ddl m Z m Z ddlmZmZddlmZdd    lmZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
l Z dd
l!Z!dd
l"Z"dd
l#Z#dd
l$Z$dd
l%Z%dd l&m'Z'm(Z(dd l)m*Z*dd l+m,Z,ddl-m.Z.m/Z/ddl)m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:m;Z;m<Z<ddl5m=Z=m>Z>ddl?m@Z@ddlAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPdd
lAZAeQZRejSdeAjTdddddddgZUd d!„ZVd"d„ZWe,jXrBd#d$„ZYd%d&„ZZnd'd$„ZYd(d&„ZZd)d*„Z[Gd+d„de0ƒZ\d,d-„Z]d.d/„Z^d0d1„Z_d2d„Z`d3d„ZaGd4d„deHƒZbGd5d6„d6ebƒZcejd ed7d8¡d9krÊecZbd:d;„Zfd<d=„Zgd>d?„Zhd@dA„ZidsdBdC„ZjdDdE„ZkdFdG„ZldHejmkrelZnndIdJ„ZndtdLdM„ZodNdO„ZpdPdQ„ZqdRdS„ZrzddTlmsZtWneuk
rndUdV„ZtYnXdWdX„ZsGdYdZ„dZevƒZwew x¡ZyGd[d\„d\ewƒZzGd]d^„d^ƒZ{Gd_d`„d`e{ƒZ|Gdadb„dbe|ƒZ}e{j~Z~e{jZdcdd„Z€dedf„Zdgegfdhdi„Z‚djdk„Zƒdldm„Z„dudnd„Z…e"j†dodp„ƒZ‡Gdqdr„dre*ƒZˆd
S)va%
Easy Install
------------
 
A tool for doing automatic download/extract/build of distutils-based Python
packages.  For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
 
__ https://setuptools.readthedocs.io/en/latest/easy_install.html
 
é)Úglob)Ú get_platform)Ú convert_pathÚ
subst_vars)ÚDistutilsArgErrorÚDistutilsOptionErrorÚDistutilsErrorÚDistutilsPlatformError)ÚINSTALL_SCHEMESÚ SCHEME_KEYS)ÚlogÚdir_util)Ú first_line_re)Úfind_executableN)Úget_config_varsÚget_path)ÚSetuptoolsDeprecationWarning)Úsix)Ú configparserÚmap)ÚCommand)Ú    run_setup)Ú rmtree_safe)Úsetopt)Úunpack_archive)Ú PackageIndexÚparse_requirement_argÚ
URL_SCHEME)Ú    bdist_eggÚegg_info)ÚWheel)Ú yield_linesÚnormalize_pathÚresource_stringÚensure_directoryÚget_distributionÚfind_distributionsÚ EnvironmentÚ RequirementÚ DistributionÚ PathMetadataÚ EggMetadataÚ
WorkingSetÚDistributionNotFoundÚVersionConflictÚ DEVELOP_DISTÚdefault)ÚcategoryÚsamefileÚ easy_installÚPthDistributionsÚextract_wininst_cfgÚmainÚget_exe_prefixescCst d¡dkS)NÚPé)ÚstructÚcalcsize©r<r<úVD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/command/easy_install.pyÚis_64bitOsr>cCsjtj |¡otj |¡}ttjdƒo&|}|r:tj ||¡Stj tj |¡¡}tj tj |¡¡}||kS)z 
    Determine if two paths reference the same file.
 
    Augments os.path.samefile to work on Windows and
    suppresses errors if the path doesn't exist.
    r2)ÚosÚpathÚexistsÚhasattrr2ÚnormpathÚnormcase)Úp1Úp2Z
both_existZ use_samefileZnorm_p1Znorm_p2r<r<r=r2SscCs|S©Nr<©Úsr<r<r=Ú    _to_bytesesrJcCs.zt |d¡WdStk
r(YdSXdS©NÚasciiTF)rÚ    text_typeÚ UnicodeErrorrHr<r<r=Úisasciihs
 rOcCs
| d¡S)NÚutf8)ÚencoderHr<r<r=rJpscCs,z| d¡WdStk
r&YdSXdSrK)rQrNrHr<r<r=rOss
 
cCst |¡ ¡ dd¡S)NÚ
z; )ÚtextwrapÚdedentÚstripÚreplace)Útextr<r<r=Ú
_one_liner{srXc@sˆeZdZdZdZdZdddddd    d
d d d ddddddddddddddejfgZddddd d!d"d#d$dg
Z    d%diZ
e Z d&d'„Z d(d)„Zd*d+„Zed,d-„ƒZd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„Zd•d8d9„Zd:d;„Zd<d=„Zd>d?„Ze d@¡ ¡Ze dA¡ ¡Ze dB¡ ¡Z dCdD„Z!dEdF„Z"dGdH„Z#dIdJ„Z$dKdL„Z%dMdN„Z&e'j(dOdP„ƒZ)d–dRdS„Z*d—dTdU„Z+dVdW„Z,d˜dXdY„Z-dZd[„Z.d\d]„Z/d^d_„Z0d™d`da„Z1edbdc„ƒZ2dšdfdg„Z3dhdi„Z4djdk„Z5dldm„Z6dndo„Z7dpdq„Z8drds„Z9e dt¡ ¡Z:e du¡Z;d›dwdx„Z<e dy¡ ¡Z=dzd{„Z>d|d}„Z?d~d„Z@d€d„ZAd‚dƒ„ZBd„d…„ZCd†d‡„ZDdˆd‰„ZEe dŠ¡ F¡ZGd‹dŒ„ZHeIeIddŽddZJeId‘d’dZKd“d”„ZLdS)œr3z'Manage a download/build/install processz Find/get/install Python packagesT)zprefix=Nzinstallation prefix)úzip-okÚzzinstall package as a zipfile)ú multi-versionÚmz%make apps have to require() a version)ÚupgradeÚUz1force upgrade (searches PyPI for latest versions))z install-dir=Údzinstall package to DIR)z script-dir=rIzinstall scripts to DIR)úexclude-scriptsÚxzDon't install scripts)ú always-copyÚaz'Copy all needed packages to install dir)z
index-url=Úiz base URL of Python Package Index)z find-links=Úfz(additional URL(s) to search for packages)zbuild-directory=Úbz/download/extract/build in DIR; keep the results)z    optimize=ÚOzlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])zrecord=Nz3filename in which to record list of installed files)ú always-unzipÚZz*don't install as a zipfile, no matter what)z
site-dirs=ÚSz)list of directories where .pth files work)ÚeditableÚez+Install specified packages in editable form)úno-depsÚNzdon't install dependencies)z allow-hosts=ÚHz$pattern(s) that hostnames must match)úlocal-snapshots-okÚlz(allow building eggs from local checkouts)ÚversionNz"print version information and exit)z no-find-linksNz9Don't load find-links defined in packages being installedÚuserNz!install in user site-package '%s'rYr[r`r]rbrkrmrprrrhcCs&d|_d|_|_d|_|_|_d|_d|_d|_d|_    d|_
|_ d|_ |_ |_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_tjrÌtj |_!tj"|_#n d|_!d|_#d|_$d|_%d|_&|_'d|_(i|_)d|_*|j+j,|_,|j+ -||j+ .d¡¡dS)Nrr3)/rsÚzip_okÚlocal_snapshots_okÚ install_dirÚ
script_dirÚexclude_scriptsÚ    index_urlÚ
find_linksÚbuild_directoryÚargsÚoptimizeÚrecordr]Ú always_copyÚ multi_versionrkÚno_depsÚ allow_hostsÚrootÚprefixÚ    no_reportrrÚinstall_purelibÚinstall_platlibÚinstall_headersÚ install_libÚinstall_scriptsÚ install_dataÚ install_baseÚinstall_platbaseÚsiteÚENABLE_USER_SITEÚ    USER_BASEÚinstall_userbaseÚ    USER_SITEÚinstall_usersiteÚ no_find_linksÚ package_indexÚpth_fileÚalways_copy_fromÚ    site_dirsÚinstalled_projectsÚ_dry_runÚ distributionÚverboseÚ_set_command_optionsÚget_option_dict©Úselfr<r<r=Úinitialize_options¬sH  
 
 
ÿzeasy_install.initialize_optionscCs"dd„|Dƒ}tt|j|ƒƒdS)Ncss*|]"}tj |¡stj |¡r|VqdSrG)r?r@rAÚislink)Ú.0Úfilenamer<r<r=Ú    <genexpr>Üs ÿz/easy_install.delete_blockers.<locals>.<genexpr>)ÚlistrÚ _delete_path)r ÚblockersZextant_blockersr<r<r=Údelete_blockersÛsÿzeasy_install.delete_blockerscCsJt d|¡|jrdStj |¡o.tj |¡ }|r8tntj}||ƒdS)Nz Deleting %s)    r ÚinfoÚdry_runr?r@Úisdirr¢ÚrmtreeÚunlink)r r@Zis_treeZremoverr<r<r=r§âs  zeasy_install._delete_pathcCs4djtjŽ}tdƒ}d}t|jftƒŽƒtƒ‚dS)zT
        Render the Setuptools version and installation details, then exit.
        ú{}.{}Ú
setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver})N)ÚformatÚsysÚ version_infor%ÚprintÚlocalsÚ
SystemExit)ÚverÚdistÚtmplr<r<r=Ú_render_versionës
 zeasy_install._render_versionc
CsŠ|jo | ¡tj ¡d}tddƒ\}}|j ¡|j ¡|j ¡||dd…|d|d||||t    tddƒdœ |_
t j r–|j |j
d    <|j|j
d
<n|jr¦t d ¡| ¡| ¡| ¡| d d dd¡|jdkrà|j|_|jdkrðd|_| dd¡| dd¡|jr(|jr(|j|_|j|_| dd¡tttjƒ}tƒ|_ |j!dk    r¾dd„|j! d¡Dƒ}|D]N}t"j #|¡sŽt d|¡n,t|ƒ|krªt$|dƒ‚n|j  %t|ƒ¡qn|j&sÎ| '¡|j(pØd|_(|j dd…|_)|jt|jƒfD] }||j)krü|j) *d|¡qü|j+dk    rBdd„|j+ d¡Dƒ}ndg}|j,dkrj|j-|j(|j)|d|_,t.|j)tjƒ|_/|j0dk    r¦t1|j0t2j3ƒr¬|j0 ¡|_0ng|_0|j4rÈ|j, 5|j)tj¡|jsÞ|j, 6|j0¡| dd ¡t1|j7t8ƒsXz0t8|j7ƒ|_7d|j7kr dks&nt9‚Wn.t9k
rV}    zt$d!ƒ|    ‚W5d}    ~    XYnX|j&rp|j:spt;d"ƒ‚|j<s€t;d#ƒ‚g|_=dS)$Nrr„Ú exec_prefixééÚabiflagsÚ) Ú    dist_nameÚ dist_versionÚ dist_fullnameÚ
py_versionÚpy_version_shortÚpy_version_nodotÚ
sys_prefixr„Úsys_exec_prefixr»r¾ÚuserbaseÚusersitez6WARNING: The user site-packages directory is disabled.rvrwr{r˜Fr‰)rvrvrŠ©rvrwÚinstall)r~r~cSsg|]}tj | ¡¡‘qSr<)r?r@Ú
expanduserrU©r£rIr<r<r=Ú
<listcomp>8sz1easy_install.finalize_options.<locals>.<listcomp>ú,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.org/simple/cSsg|] }| ¡‘qSr<)rUrÍr<r<r=rÎNsÚ*)Ú search_pathÚhosts)r}r}z--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))>rrrºr²Úsplitrr›Úget_nameÚ get_versionÚ get_fullnameÚgetattrÚ config_varsrŽrr‘r“rsr ÚwarnÚ_fix_install_dir_for_user_siteÚexpand_basedirsÚ expand_dirsÚ_expandrwrvr”Úset_undefined_optionsr†rŠrr"r@Ú get_site_dirsÚ all_site_dirsr˜r?r¬rÚappendrkÚcheck_site_dirryÚ shadow_pathÚinsertr‚r•Ú create_indexr'Ú local_indexrzÚ
isinstancerÚ string_typesruZscan_egg_linksÚadd_find_linksr}ÚintÚ
ValueErrorr{rr|Úoutputs)
r rÃr„r»rCr˜r_Ú    path_itemrÒrlr<r<r=Úfinalize_optionsösÒ
 
ô 
þ
 
ÿÿ   
þÿ   ÿ   ÿþÿÿzeasy_install.finalize_optionscCs\|jr tjsdS| ¡|jdkr.d}t|ƒ‚|j|_|_tj     
dd¡d}|  |¡dS)z;
        Fix the install_dir if "--user" was used.
        Nz$User base directory is not specifiedÚposixÚunixÚ_user) rsrŽrÚcreate_home_pathr‘r    rŒrr?ÚnamerVÚ select_scheme)r ÚmsgZ scheme_namer<r<r=rÚus 
z+easy_install._fix_install_dir_for_user_sitecCsX|D]N}t||ƒ}|dk    rtjdks.tjdkr:tj |¡}t||jƒ}t|||ƒqdS)NrïÚnt)r×r?rór@rÌrrØÚsetattr)r ÚattrsÚattrÚvalr<r<r=Ú _expand_attrs„s
  zeasy_install._expand_attrscCs| dddg¡dS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.rŒrrƒN©rûrŸr<r<r=rۍszeasy_install.expand_basedirscCsddddddg}| |¡dS)z+Calls `os.path.expanduser` on install dirs.r†r‡r‰rˆrŠr‹Nrü)r Údirsr<r<r=rܒsúzeasy_install.expand_dirsc    CsÔ|r| dtj¡|j|jjkr,t |j¡z’|jD]}| ||j ¡q4|j    r´|j
}|j rŒt |j ƒ}t t |ƒƒD]}|||d…||<qrddlm}| |j|j    |fd|j    ¡| ¡W5t |jj¡XdS)NzXWARNING: The easy_install command is deprecated and will be removed in a future version.r)Ú    file_utilz'writing list of installed files to '%s')Úannouncer ÚWARNrœr›Ú set_verbosityr|r3rr~rìrƒÚlenÚrangeÚ    distutilsrþÚexecuteÚ
write_fileÚwarn_deprecated_options)r Zshow_deprecationÚspecrìÚroot_lenÚcounterrþr<r<r=Úrunžs4ý 
 
 ÿþ zeasy_install.runcCsDz t ¡}Wn"tk
r.t dtj¡}YnXtj |j    d|¡S)zÈReturn a pseudo-tempname base in the install directory.
        This code is intentionally naive; if a malicious party can write to
        the target directory you're already in deep doodoo.
        rztest-easy-install-%s)
r?ÚgetpidÚ    ExceptionÚrandomÚrandintr²Úmaxsizer@Újoinrv)r Úpidr<r<r=Úpseudo_tempname»s
 zeasy_install.pseudo_tempnamecCsdSrGr<rŸr<r<r=rÆsz$easy_install.warn_deprecated_optionsc    CsRt|jƒ}tj |d¡}tj |¡sTzt |¡Wn ttfk
rR|     ¡YnX||j
k}|sr|j sr|  ¡}nd|  ¡d}tj |¡}z*|ršt |¡t|dƒ ¡t |¡Wn ttfk
rÔ|     ¡YnX|s|j stj dd¡}t |j|j|¡|r&|jdkr,t||j
ƒ|_nd|_|j rHtj |¡sHd|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if neededúeasy-install.pthz .write-testÚwÚ
PYTHONPATHr¿N)r"rvr?r@rrAÚmakedirsÚOSErrorÚIOErrorÚcant_write_to_targetràr€Úcheck_pth_processingrr®ÚopenÚcloseÚenvironÚgetr rÙÚ_easy_install__no_default_msgr–r4)r Úinstdirr–Z is_site_dirZtestfileZ test_existsÚ
pythonpathr<r<r=râÉs:
 
 
 
 
 zeasy_install.check_site_diraS
        can't create or remove files in install directory
 
        The following error occurred while trying to add or remove files in the
        installation directory:
 
            %s
 
        The installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:
 
            %s
        zÀ
        This directory does not currently exist.  Please create it and try again, or
        choose a different installation directory (using the -d or --install-dir
        option).
        a«
        Perhaps your account does not have write access to this directory?  If the
        installation directory is a system-owned directory, you may need to sign in
        as the administrator or "root" account.  If you do not have administrative
        access to this machine, you may wish to choose a different installation
        directory, preferably one that is listed in your PYTHONPATH environment
        variable.
 
        For information on other options, you may wish to consult the
        documentation at:
 
          https://setuptools.readthedocs.io/en/latest/easy_install.html
 
        Please make the appropriate changes for your system and try again.
        cCsP|jt ¡d|jf}tj |j¡s6|d|j7}n|d|j7}t    |ƒ‚dS)NérR)
Ú_easy_install__cant_write_msgr²Úexc_inforvr?r@rAÚ_easy_install__not_exists_idÚ_easy_install__access_msgr)r rõr<r<r=rs
z!easy_install.cant_write_to_targetc     Cs¦|j}t d|¡| ¡d}|d}tj |¡}tdƒd}z6|rNt |¡tj     |¡}tj
|ddt |dƒ}Wn t t fk
r”| ¡YnúXz¶| |jftƒŽ¡| ¡d    }tj}tjd
kr
tj |¡\}}    tj |d ¡}
|     ¡d koþtj |
¡} | r
|
}d dlm} | |dddgd ƒtj |¡rJt d|¡W¢dSW5|r\| ¡tj |¡rtt |¡tj |¡rŒt |¡X|js¢t d|¡dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %sú.pthz.okzz
            import os
            f = open({ok_file!r}, 'w')
            f.write('OK')
            f.close()
            rRT)Úexist_okrNröú pythonw.exeú
python.exer)Úspawnz-Ez-cÚpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesF)rvr rªrr?r@rArXr®ÚdirnamerrrrrrÚwriter±rµr²Ú
executablerórÓrÚlowerÚdistutils.spawnr,r€rÙ) r r!r–Zok_fileZ    ok_existsr¹r.rer0ÚbasenameZaltZuse_altr,r<r<r=r#s\   û
 
þ þ 
  z!easy_install.check_pth_processingc    CsV|jsH| d¡rH| d¡D],}| d|¡r.q| ||| d|¡¡q| |¡dS)z=Write all the scripts for `dist`, unless scripts are excludedÚscriptszscripts/N)rxÚmetadata_isdirÚmetadata_listdirÚinstall_scriptÚ get_metadataÚinstall_wrapper_scripts)r r¸Ú script_namer<r<r=Úinstall_egg_scripts^s þz easy_install.install_egg_scriptscCsTtj |¡rDt |¡D]*\}}}|D]}|j tj ||¡¡q$qn |j |¡dSrG)r?r@r¬Úwalkrìrár)r r@ÚbaserýÚfilesr¤r<r<r=Ú
add_outputls
 zeasy_install.add_outputcCs|jrtd|fƒ‚dS)NzjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).)rkr©r rr<r<r=Ú not_editablets þÿzeasy_install.not_editablecCs<|js
dStj tj |j|j¡¡r8td|j|jfƒ‚dS)Nz2%r already exists in %s; can't do a checkout there)rkr?r@rArr{Úkeyrr@r<r<r=Úcheck_editable|s
ÿÿzeasy_install.check_editablec    cs:tjdd}zt|ƒVW5tj |¡o2tt|ƒƒXdS)Nz easy_install-)r„)ÚtempfileÚmkdtempr?r@rAr­rÚstr)r Útmpdirr<r<r=Ú_tmpdir†s zeasy_install._tmpdirFc
Cs:| ¡&}t|tƒst|ƒrT| |¡|j ||¡}| d|||d¡W5QR£Stj     
|¡rˆ| |¡| d|||d¡W5QR£St |ƒ}|  |¡|j  |||j|j|j |j¡}|dkrâd|}|jrØ|d7}t|ƒ‚nJ|jtkr| |||d¡|W5QR£S| ||j||¡W5QR£SW5QRXdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)ÚUsing)rHrçr(rrAr•ÚdownloadÚ install_itemr?r@rArrCZfetch_distributionr]rkrrærÚ
precedencer/Úprocess_distributionÚlocation)r rÚdepsrGÚdlr¸rõr<r<r=r3s8 
 
 
 
þ
 zeasy_install.easy_installcCs
|p|j}|ptj |¡|k}|p,| d¡ }|pT|jdk    oTtj t|ƒ¡t|jƒk}|r‚|s‚|j|jD]}|j    |krjq‚qjd}t
  dtj  |¡¡|rÂ|  |||¡}|D]}| |||¡q¬n | |¡g}| ||d|d¡|dk    r|D]}||krð|SqðdS)Nú.eggTz Processing %srrI)rr?r@r.Úendswithr—r"ræÚ project_namerNr rªr3Ú install_eggsrMÚegg_distribution)r rrJrGrOZinstall_neededr¸Údistsr<r<r=rK°s2
 
ÿþ
 
zeasy_install.install_itemcCs<t|}tD]*}d|}t||ƒdkr t||||ƒq dS)z=Sets the install directories by applying the install schemes.Úinstall_N)r
r r×r÷)r róÚschemerBÚattrnamer<r<r=rôÔs
zeasy_install.select_schemec
Gs¸| |¡|j |¡||j|jkr2|j |¡|j |¡| |¡||j|j<t     |j
||f|žŽ¡|  d¡rŽ|j sŽ|j  | d¡¡|sœ|jsœdS|dk    rÀ|j|jkrÀt d|¡dS|dksÐ||krä| ¡}tt|ƒƒ}t     d|¡ztgƒ |g|j|j¡}Wnbtk
r>}ztt|ƒƒ|‚W5d}~XYn2tk
rn}zt| ¡ƒ|‚W5d}~XYnX|js€|jr¨|D]"}|j|jkr„| | ¡¡q„t     d|¡dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s)Ú
update_pthr•ÚaddrærBÚremover;r™r rªÚinstallation_reportÚ has_metadatar”réÚget_metadata_linesrrÙÚas_requirementr(rFr,Úresolver3r-rr.Úreportr—)r Ú requirementr¸rOrªZdistreqZdistrosrlr<r<r=rMÝsL
 
 
ÿÿ
   ÿ z!easy_install.process_distributioncCs2|jdk    r|j S| d¡r dS| d¡s.dSdS)Nz not-zip-safeTzzip-safeF)rtr^©r r¸r<r<r=Ú should_unzips
 
 
zeasy_install.should_unzipcCs¶tj |j|j¡}tj |¡r:d}t ||j|j|¡|Stj |¡rL|}nRtj     |¡|krft 
|¡t  |¡}t |ƒdkržtj ||d¡}tj |¡rž|}t |ƒt ||¡|S)Nz<%r already exists in %s; build directory %s will not be keptr#r)r?r@rr{rBrAr rÙr¬r.r®Úlistdirrr$ÚshutilÚmove)r rÚ dist_filenameÚ
setup_baseÚdstrõÚcontentsr<r<r=Ú
maybe_move s$ ÿ 
 
   zeasy_install.maybe_movecCs,|jr
dSt ¡ |¡D]}|j|ŽqdSrG)rxÚ ScriptWriterÚbestÚget_argsÚ write_script)r r¸r|r<r<r=r9$sz$easy_install.install_wrapper_scriptscCsNt| ¡ƒ}t||ƒ}|r8| |¡tƒ}t |¡|}| |t|ƒd¡dS)z/Generate a legacy script wrapper and install itrfN)    rFr`Úis_python_scriptÚ_load_templaterµrnÚ
get_headerrqrJ)r r¸r:Ú script_textÚdev_pathrZ    is_scriptÚbodyr<r<r=r7*s  
zeasy_install.install_scriptcCs(d}|r| dd¡}td|ƒ}| d¡S)z‰
        There are a couple of template scripts in the package. This
        function loads one of them and prepares it for use.
        z script.tmplz.tmplz  (dev).tmplr°úutf-8)rVr#Údecode)rvróZ    raw_bytesr<r<r=rs4s
 
zeasy_install._load_templateÚtr<c    s¦ˆ ‡fdd„|Dƒ¡t d|ˆj¡tj ˆj|¡}ˆ |¡ˆjrLdSt    ƒ}t
|ƒtj  |¡rpt  |¡t |d|ƒ}| |¡W5QRXt|d|ƒdS)z1Write an executable file to the scripts directorycsg|]}tj ˆj|¡‘qSr<)r?r@rrw©r£rarŸr<r=rÎFsz-easy_install.write_script.<locals>.<listcomp>zInstalling %s script to %sNriÿ)r©r rªrwr?r@rr?r«Ú current_umaskr$rAr®rr/Úchmod)r r:rlÚmoder¨ÚtargetÚmaskrer<rŸr=rqCsÿ
 
zeasy_install.write_scriptcCs^| ¡ d¡r| ||¡gS| ¡ d¡r8| ||¡gS| ¡ d¡rT| ||¡gS|}tj |¡r~| d¡s~t|||j    ƒntj 
|¡r–tj  |¡}|  |¡r¼|j r¼|dk    r¼| |||¡}tj |d¡}tj |¡s0ttj |dd¡ƒ}|stdtj  |¡ƒ‚t|ƒdkr(td    tj  |¡ƒ‚|d
}|jrNt | ||¡¡gS| ||¡SdS) NrQú.exez.whlú.pyzsetup.pyrÐz"Couldn't find a setup script in %sr#zMultiple setup scripts in %sr)r1rRÚ install_eggÚ install_exeÚ install_wheelr?r@ÚisfilerÚunpack_progressr¬ÚabspathÚ
startswithr{rmrrArrrrkr rªÚreport_editableÚbuild_and_install)r rrirGrjÚ setup_scriptZsetupsr<r<r=rTWsJ  
ÿÿ
ÿÿ
ÿÿzeasy_install.install_eggscCs>tj |¡r"t|tj |d¡ƒ}ntt |¡ƒ}tj    ||dS)NúEGG-INFO)Úmetadata)
r?r@r¬r*rr+Ú    zipimportÚ zipimporterr)Ú from_filename)r Úegg_pathrŽr<r<r=rUƒs   ÿzeasy_install.egg_distributionc    CsŽtj |jtj |¡¡}tj |¡}|js2t|ƒ| |¡}t    ||ƒsztj 
|¡rrtj  |¡srt j ||jdn"tj |¡r”| tj|fd|¡zÀd}tj 
|¡rÌ| |¡r¾tjd}}n tjd}}nL| |¡rî| |¡|jd}}n*d}| |¡r tjd}}n tjd}}| |||f|dtj |¡tj |¡f¡t||d    Wn$tk
rxt|dd    ‚YnX| |¡| |¡S)
N©r«ú    Removing FZMovingZCopyingZ
ExtractingTz     %s to %s©Úfix_zipimporter_caches)r?r@rrvr3rˆr«r$rUr2r¬r¢r Ú remove_treerArr®r‰rgrhÚcopytreereÚmkpathÚunpack_and_compileÚcopy2r.Úupdate_dist_cachesr r?)r r’rGÚ destinationr¸Znew_dist_is_zippedrer\r<r<r=rƒ‹s^
þ 
  ý 
 
 
 
 
þýþ
 
zeasy_install.install_eggc sPt|ƒ}|dkrtd|ƒ‚td| dd¡| dd¡tƒd}tj || ¡d¡}||_    |d}tj |d¡}tj |d    ¡}t
|ƒt ||ƒ|_ |  ||¡tj |¡st|d
ƒ}    |     d ¡| d¡D].\}
} |
d krÊ|     d |
 dd¡ ¡| f¡qÊ|     ¡tj |d¡‰| ‡fdd„t |¡Dƒ¡tj|||j|jd| ||¡S)Nz(%s is not a valid distutils Windows .exerŽrórr)rSrrÚplatformrQz.tmprúPKG-INFOrzMetadata-Version: 1.0
Útarget_versionz%s: %s
Ú_ú-r4csg|]}tj ˆ|d¡‘qS)r)r?r@r)r£r|©rwr<r=rÎãsÿz,easy_install.install_exe.<locals>.<listcomp>)rœr«)r5rr)rrr?r@rÚegg_namerNr$r*Ú    _providerÚ
exe_to_eggrArr/ÚitemsrVÚtitlerr©rnrprÚ make_zipfilerœr«rƒ) r rirGÚcfgr¸r’Úegg_tmpZ    _egg_infoZpkg_infreÚkÚvr<r£r=r„ÁsJÿ
 
ý  
 
 þÿzeasy_install.install_exec s6t|ƒ‰g‰g‰i‰‡‡‡‡‡fdd„}t|ˆ|ƒg}ˆD]l}| ¡ d¡r<| d¡}|d}t |d¡d|d<tjj    ˆf|žŽ}ˆ 
|¡| 
|¡t  ||¡q<|  ˆ¡t  tj     ˆd¡t ˆ|¡¡dD]Z}    tƒ|    rÖtj     ˆd|    d    ¡}
tj |
¡sÖt|
d
ƒ} |  d      tƒ|    ¡d ¡|  ¡qÖd S) z;Extract a bdist_wininst to the directories an egg would usecsø| ¡}ˆD]Ð\}}| |¡r ||t|ƒd…}| d¡}tjjˆf|žŽ}| ¡}| d¡sj| d¡r t     |d¡|d<dˆtj 
|d¡d<ˆ  |¡n4| d¡rÔ|dkrÔdˆtj 
|d¡d<ˆ  |¡|Sq | d    ¡sôt   d
|¡dS) Nú/ú.pydú.dlléÿÿÿÿr#rr‚úSCRIPTS/r(zWARNING: can't process %s)r1r‰rrÓr?r@rrRrÚ strip_moduleÚsplitextrár rÙ)ÚsrcrkrIÚoldÚnewÚpartsrP©r«Ú native_libsÚprefixesÚ
to_compileÚ    top_levelr<r=Úprocessös$ 
 
 
 
 
 z(easy_install.exe_to_egg.<locals>.processr¯r®r±r‚r)r½rºz.txtrrRN)r7rr1rRrÓrr³r?r@rráZ
write_stubÚ byte_compileZwrite_safety_flagZ analyze_eggrµrArr/r) r rir«r¾ZstubsÚresr¸ÚresourceZpyfileróÚtxtrer<r¹r=r¦îs8 
 
 
 
 
þ
 
zeasy_install.exe_to_eggc
Csàt|ƒ}| ¡st‚tj |j| ¡¡}tj |¡}|j    sBt
|ƒtj  |¡rltj  |¡slt j||j    dn"tj |¡rŽ| tj|fd|¡z.| |j|fdtj |¡tj |¡f¡W5t|ddX| |¡| |¡S)Nr“r”Fr•zInstalling %s to %s)r Ú is_compatibleÚAssertionErrorr?r@rrvr¤rˆr«r$r¬r¢r r—rArr®rœZinstall_as_eggr3r.r?rU)r Ú
wheel_pathrGÚwheelrr<r<r=r…#s4   ý
 
þý    
zeasy_install.install_wheela(
        Because this distribution was installed --multi-version, before you can
        import modules from this package in an application, you will need to
        'import pkg_resources' and then use a 'require()' call similar to one of
        these examples, in order to select the desired version:
 
            pkg_resources.require("%(name)s")  # latest installed version
            pkg_resources.require("%(name)s==%(version)s")  # this exact version
            pkg_resources.require("%(name)s>=%(version)s")  # this version or higher
        zõ
        Note also that the installation directory must be on sys.path at runtime for
        this to work.  (e.g. by being the application's script directory, by being on
        PYTHONPATH, or by being added to sys.path by your code.)
        Ú    Installedc    Cs^d}|jr>|js>|d|j7}|jtttjƒkr>|d|j7}|j    }|j
}|j }d}|t ƒS)z9Helpful installation message for display to package usersz
%(what)s %(eggloc)s%(extras)srRr¿) r€r…Ú_easy_install__mv_warningrvrr"r²r@Ú_easy_install__id_warningrNrSrrrµ)    r Úreqr¸ÚwhatrõZegglocrórrÚextrasr<r<r=r]Qs z easy_install.installation_reportaR
        Extracted editable version of %(spec)s to %(dirname)s
 
        If it uses setuptools in its setup script, you can activate it in
        "development" mode by going to that directory and running::
 
            %(python)s setup.py develop
 
        See the setuptools documentation for the "develop" command for more info.
        cCs"tj |¡}tj}d|jtƒS)NrR)r?r@r.r²r0Ú_easy_install__editable_msgrµ)r rrŒr.Úpythonr<r<r=rŠjs zeasy_install.report_editablec
Csætj dt¡tj dt¡t|ƒ}|jdkrNd|jd}| dd|¡n|jdkrd| dd¡|jrv| dd    ¡t     
d
|t |ƒdd…d   |¡¡zt ||ƒWn8tk
rà}ztd |jdfƒ|‚W5d}~XYnXdS) Nzdistutils.command.bdist_eggzdistutils.command.egg_infor½r­r#rr¢ú-qz-nz Running %s %sú zSetup script exited with %s)r²ÚmodulesÚ
setdefaultrrr¦rœrär«r rªrrrr¶rr|)r rŒrjr|r­r<r<r=ros.
 
  ÿÿþzeasy_install.run_setupc        Cs¼ddg}tjdtj |¡d}z‚|     tj |¡¡| 
|¡|  |||¡t |gƒ}g}|D]&}||D]}| 
|  |j|¡¡qhq\|sš|jsšt d|¡|W¢St|ƒt |j¡XdS)Nrz
--dist-dirz egg-dist-tmp-)r„Údirz+No eggs found in %s (setup script problem?))rDrEr?r@r.r­r rrœÚ_set_fetcher_optionsrárr'rƒrNr«rÙ)    r rŒrjr|Údist_dirZall_eggsÚeggsrBr¸r<r<r=r‹…s*
ÿ
 
 
ÿzeasy_install.build_and_installc    Csp|j d¡ ¡}d}i}| ¡D]&\}}||kr2q |d|| dd¡<q t|d}tj |d¡}t     
||¡dS)    a
        When easy_install is about to run bdist_egg on a source dist, that
        source dist might have 'setup_requires' directives, requiring
        additional fetching. Ensure the fetcher options given to easy_install
        are available to that command as well.
        r3)rzr˜ryr}r‚r#r¡r¢)r3z    setup.cfgN) r›ržÚcopyr§rVÚdictr?r@rrZ edit_config)    r r=Zei_optsZfetch_directivesZ fetch_optionsrBrúÚsettingsZ cfg_filenamer<r<r=rԝs    
z!easy_install._set_fetcher_optionscCs*|jdkrdS|j|jD]H}|js0|j|jkrt d|¡|j |¡|j|jkr|j |j¡q|js¸|j|jjkr†t d|¡n2t d|¡|j     |¡|j|jkr¸|j 
|j¡|j s&|j  ¡|jdkr&t j |jd¡}t j |¡rüt  |¡t|dƒ}| |j |j¡d¡| ¡dS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filer°úsetuptools.pthÚwtrR)r–rBr€rNr rªr\rãÚpathsr[rár«Úsaver?r@rrvr¢r®rr/Ú make_relativer)r r¸r_r¤rer<r<r=rZ´s6
   þ   
 
 
zeasy_install.update_pthcCst d||¡|S)NzUnpacking %s to %s)r Údebug)r rµrkr<r<r=r‡Ùszeasy_install.unpack_progresscsdg‰g‰‡‡‡fdd„}t|||ƒˆ ˆ¡ˆjs`ˆD]&}t |¡tjdBd@}t||ƒq8dS)NcsZ| d¡r | d¡s ˆ |¡n| d¡s4| d¡r>ˆ |¡ˆ ||¡ˆj rV|pXdS)Nr‚ú    EGG-INFO/r°z.so)rRr‰rár‡r«)rµrk©r Zto_chmodr¼r<r=Úpfâs  
 z+easy_install.unpack_and_compile.<locals>.pfimií)rr¿r«r?ÚstatÚST_MODEr})r r’rrârer~r<rár=ršÞs 
zeasy_install.unpack_and_compilec    Csjtjr
dSddlm}z@t |jd¡||dd|jd|jrT|||jd|jdW5t |j¡XdS)Nr)r¿r#)r}Úforcer«)    r²Údont_write_bytecodeÚdistutils.utilr¿r rrœr«r})r r¼r¿r<r<r=r¿ñs þ
zeasy_install.byte_compilea‰
        bad install directory or PYTHONPATH
 
        You are attempting to install a package to a directory that is not
        on PYTHONPATH and which Python does not read ".pth" files from.  The
        installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:
 
            %s
 
        and your PYTHONPATH environment variable currently contains:
 
            %r
 
        Here are some of your options for correcting the problem:
 
        * You can choose a different installation directory, i.e., one that is
          on PYTHONPATH or supports .pth files
 
        * You can add the installation directory to the PYTHONPATH environment
          variable.  (It must then also be on PYTHONPATH whenever you run
          Python and want to use the package(s) you are installing.)
 
        * You can set up the installation directory to support ".pth" files by
          using one of the approaches described here:
 
          https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
 
 
        Please make the appropriate changes for your system and try again.
        cCsd|js
dSttj d¡ƒ}t |j¡D]8\}}| |¡r&tj     |¡s&| 
d|¡t  |d¡q&dS)zCreate directories under ~.Nú~zos.makedirs('%s', 0o700)iÀ) rsrr?r@rÌrÚ    iteritemsrØr‰r¬Ú debug_printr)r Úhomerór@r<r<r=rò$szeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz    $base/binrÊ©rïz$base/Lib/site-packagesz $base/ScriptscGs¼| d¡j}|jrd| ¡}|j|d<|j tj|j¡}|     ¡D]$\}}t
||dƒdkr>t |||ƒq>ddl m }|D]B}t
||ƒ}|dk    rt|||ƒ}tjdkrªtj |¡}t |||ƒqtdS)NrËr=r)rrï)Úget_finalized_commandrØr„r×r
rr?róÚDEFAULT_SCHEMEr§r×r÷rçrr@rÌ)r rørØrXrùrúrr<r<r=rÝ:s  
 
 
 
 zeasy_install._expand)T)F)F)T)N)rzr<)rÇ)MÚ__name__Ú
__module__Ú __qualname__Ú__doc__Ú descriptionZcommand_consumes_argumentsrŽr’Ú user_optionsÚboolean_optionsÚ negative_optrrår¡r©r§Ú staticmethodrºrîrÚrûrÛrÜr rrrârSrTÚlstripr$r&r'rrr;r?rArCÚ
contextlibÚcontextmanagerrHr3rKrôrMrermr9r7rsrqrTrUrƒr„r¦r…rÈrÉr]rÍrŠrr‹rÔrZr‡ršr¿rUr ròrØr
rîrÝr<r<r<r=r3sÔäü/    
 
    
 -    ;
 
 
!
$    
'    
 
 
 
,6-5
 
 % 
þÿþcCs tj dd¡ tj¡}td|ƒS)Nrr¿)r?rrrÓÚpathsepÚfilter)r§r<r<r=Ú _pythonpathQsrýc    Cs~g}| tƒ¡tjg}tjtjkr0| tj¡|D]È}|r4tjdkr^| tj     |dd¡¡nVtj
dkrš| tj     |ddj tj Žd¡tj     |dd¡g¡n| |tj     |dd¡g¡tjdkr4d    |kr4tj  d
¡}|r4tj     |d d d j tj Žd¡}| |¡q4tdƒtdƒf}|D]}||kr| |¡qtjrB| tj¡z| t ¡¡Wntk
rjYnXttt|ƒƒ}|S)z&
    Return a list of 'site' dirs
    )Zos2emxZriscosÚLibz site-packagesr®Úlibz python{}.{}z site-pythonÚdarwinzPython.frameworkÚHOMEÚLibraryÚPythonr¯ÚpurelibÚplatlib)Úextendrýr²r„r»ráržr?r@rÚsepr±r³rrrrŽrr’ÚgetsitepackagesÚAttributeErrorr¦rr")Úsitedirsr»r„rëZhome_spZ    lib_pathsZsite_libr<r<r=rßVs^   
 
 
üù
þ
 
û 
 rßccsâi}|D]Ô}t|ƒ}||krqd||<tj |¡s4qt |¡}||fV|D]Ž}| d¡s\qL|dkrfqLttj ||¡ƒ}tt    |ƒƒ}| 
¡|D]H}|  d¡st|  ¡ƒ}||krd||<tj |¡sÈq|t |¡fVqqLqdS)zBYield sys.path directories that might contain "old-style" packagesr#r()rrÚÚimportN) r"r?r@r¬rfrRrrr¦r!rr‰Úrstrip)ÚinputsÚseenr.r>róreÚlinesÚliner<r<r=Ú expand_paths—s4 
 
 
 
  rc Cs@t|dƒ}z$t |¡}|dkr*W¢ dS|d|d|d}|dkrRW¢ädS| |d¡t d| d¡¡\}}}|dkrˆW¢®dS| |d|¡d    d    d
œ}t     |¡}z<| |¡}    |     
d d ¡d }
|
  t   ¡¡}
| t |
¡¡Wntjk
rYW¢.dSX| d¡r"| d¡s*W¢ dS|W¢S| ¡XdS)znExtract configuration data from a bdist_wininst .exe
 
    Returns a configparser.RawConfigParser, or None
    ÚrbNé    ééé z<iii)izV4i{V4r¿)rrr ór#rrŽÚSetup)rrÚzipfileÚ _EndRecDataÚseekr:ÚunpackÚreadrÚRawConfigParserrÓryr²ÚgetfilesystemencodingÚreadfprÚStringIOÚErrorÚ has_section) rireÚendrecZ    prependedÚtagZcfglenZbmlenÚinitrªÚpartÚconfigr<r<r=r5Às4
 
 
 
 
 
 c    Cs@dddddg}t |¡}zú| ¡D]ì}|j}| d¡}t|ƒdkr€|dd    kr€|d
 d ¡r€| d d     |d d…¡df¡qt|ƒdks"| d¡s˜q"| d¡r¤q"|d  
¡dkr"|  |¡}t j sÌ| ¡}t|ƒD]8}| ¡ dd¡}| d¡sÔ| d|d |fdf¡qÔq"W5| ¡Xdd„|Dƒ}| ¡| ¡|S)z4Get exe->egg path translations for a given .exe file)zPURELIB/r¿)zPLATLIB/pywin32_system32r¿)zPLATLIB/r¿)r²zEGG-INFO/scripts/)zDATA/lib/site-packagesr¿r®r¼r½rŸr#z    .egg-inforNràr(z
-nspkg.pth)ZPURELIBZPLATLIBú\r z%s/%s/r¿cSsg|]\}}| ¡|f‘qSr<)r1)r£raÚyr<r<r=rÎ
sz$get_exe_prefixes.<locals>.<listcomp>)rÚZipFilerÚinfolistr¤rÓrrRrärÚupperrrÚPY2ryr!rUrVr‰ráÚsortÚreverse)Z exe_filenamer»rZrªrór¸rlÚpthr<r<r=r7és@û
 
 
 
 
"
c@sReZdZdZdZddd„Zdd„Zdd    „Zed
d „ƒZ    d d „Z
dd„Z dd„Z dS)r4z)A .pth file with Distribution paths in itFr<cCsl||_ttt|ƒƒ|_ttj |j¡ƒ|_|     ¡t
  |gdd¡t |j ƒD]}tt|jt|dƒƒƒqLdS)NT)r¤r¦rr"r
r?r@r.ÚbasedirÚ_loadr'Ú__init__r!rÜr[r&)r r¤r
r@r<r<r=r4szPthDistributions.__init__cCsþg|_d}t |j¡}tj |j¡rÊt|jdƒ}|D]Œ}|     d¡rHd}q4| 
¡}|j  |¡|  ¡r4|  ¡     d¡rtq4t tj |j|¡ƒ}|jd<tj |¡r¦||kr¸|j ¡d|_q4d||<q4| ¡|jrÚ|sÚd|_|jrú|jd  ¡sú|j ¡qÚdS)NFÚrtr Tú#r±r#)rÜrØÚfromkeysr
r?r@r†r¤rr‰r rárUr"rr2rAÚpopÚdirtyr)r Z
saw_importrrerr@r<r<r=r3s4  
 ÿ
 
 
zPthDistributions._loadc    Cs¶|js
dStt|j|jƒƒ}|r„t d|j¡| |¡}d     |¡d}t
j   |j¡r`t
  |j¡t|jdƒ}| |¡W5QRXn(t
j  |j¡r¬t d|j¡t
  |j¡d|_dS)z$Write changed .pth file back to diskNz    Saving %srRrÛzDeleting empty %sF)r9r¦rrÞrÜr rßr¤Ú _wrap_linesrr?r@r¢r®rr/rA)r Z    rel_pathsrÚdatarer<r<r=rÝ=s
  zPthDistributions.savecCs|SrGr<)rr<r<r=r:SszPthDistributions._wrap_linescCsN|j|jko$|j|jkp$|jt ¡k}|r>|j |j¡d|_t ||¡dS)z"Add `dist` to the distribution mapTN)    rNrÜr
r?Úgetcwdrár9r'r[)r r¸Únew_pathr<r<r=r[Ws   üzPthDistributions.addcCs2|j|jkr"|j |j¡d|_qt ||¡dS)z'Remove `dist` from the distribution mapTN)rNrÜr\r9r'rdr<r<r=r\es zPthDistributions.removecCsŒtj t|ƒ¡\}}t|jƒ}|g}tjdkr2dp6tj}t|ƒ|krˆ||jkrl| tj    ¡| 
¡|  |¡Stj |¡\}}| |¡q8|S)Nr®) r?r@rÓr"rr2ÚaltseprráÚcurdirr0r)r r@ÚnpathÚlastZbaselenr¸rr<r<r=rÞls
 
 
 zPthDistributions.make_relativeN)r<) rïrðrñròr9r4r3rÝr÷r:r[r\rÞr<r<r<r=r4s
    
c@s(eZdZedd„ƒZedƒZedƒZdS)ÚRewritePthDistributionsccs$|jV|D]
}|Vq |jVdSrG)ÚpreludeÚpostlude)Úclsrrr<r<r=r:}sz#RewritePthDistributions._wrap_linesz?
        import sys
        sys.__plen = len(sys.path)
        zÐ
        import sys
        new = sys.path[sys.__plen:]
        del sys.path[sys.__plen:]
        p = getattr(sys, '__egginsert', 0)
        sys.path[p:p] = new
        sys.__egginsert = p + len(new)
        N)rïrðrñÚ classmethodr:rXrCrDr<r<r<r=rB|s
rBZSETUPTOOLS_SYS_PATH_TECHNIQUEÚrawZrewritecCs ttjtƒrtSt tj ¡¡S)z_
    Return a regular expression based on first_line_re suitable for matching
    strings.
    )rçrÚpatternrFÚreÚcompileryr<r<r<r=Ú_first_line_re–s rKcCsd|tjtjfkr.tjdkr.t|tjƒ||ƒSt ¡\}}}t     
||d|dd||ff¡dS)Nrörr#z %s %s) r?r®r\rór}rãÚS_IWRITEr²r%rÚreraise)ÚfuncÚargÚexcÚetZevr¡r<r<r=Ú
auto_chmod¢s
 rRcCs.t|ƒ}t|tjƒ|r"t|ƒnt|ƒdS)aa
 
    Fix any globally cached `dist_path` related data
 
    `dist_path` should be a path of a newly installed egg distribution (zipped
    or unzipped).
 
    sys.path_importer_cache contains finder objects that have been cached when
    importing data from the original distribution. Any such finders need to be
    cleared since the replacement distribution might be packaged differently,
    e.g. a zipped egg distribution might get replaced with an unzipped egg
    folder or vice versa. Having the old finders cached may then cause Python
    to attempt loading modules from the replacement distribution using an
    incorrect loader.
 
    zipimport.zipimporter objects are Python loaders charged with importing
    data packaged inside zip archives. If stale loaders referencing the
    original distribution, are left behind, they can fail to load modules from
    the replacement distribution. E.g. if an old zipimport.zipimporter instance
    is used to load data from a new zipped egg archive, it may cause the
    operation to attempt to locate the requested data in the wrong location -
    one indicated by the original distribution's zip archive directory
    information. Such an operation may then fail outright, e.g. report having
    read a 'bad local file header', or even worse, it may fail silently &
    return invalid data.
 
    zipimport._zip_directory_cache contains cached zip archive directory
    information for all existing zipimport.zipimporter instances and all such
    instances connected to the same archive share the same cached directory
    information.
 
    If asked, and the underlying Python implementation allows it, we can fix
    all existing zipimport.zipimporter instances instead of having to track
    them down and remove them one by one, by updating their shared cached zip
    archive directory information. This, of course, assumes that the
    replacement distribution is packaged as a zipped egg.
 
    If not asked to fix existing zipimport.zipimporter instances, we still do
    our best to clear any remaining zipimport.zipimporter related cached data
    that might somehow later get used when attempting to load data from the new
    distribution and thus cause such load operations to fail. Note that when
    tracking down such remaining stale data, we can not catch every conceivable
    usage from here, and we clear only those that we know of and have found to
    cause problems if left alive. Any remaining caches should be updated by
    whomever is in charge of maintaining them, i.e. they should be ready to
    handle us replacing their zip archives with new distributions at runtime.
 
    N)r"Ú_uncacher²Úpath_importer_cacheÚ!_replace_zip_directory_cache_dataÚ*_remove_and_clear_zip_directory_cache_data)Ú    dist_pathr–Únormalized_pathr<r<r=rœªs
< 
rœcCsPg}t|ƒ}|D]:}t|ƒ}| |¡r|||d…tjdfkr| |¡q|S)ap
    Return zipimporter cache entry keys related to a given normalized path.
 
    Alternative path spellings (e.g. those using different character case or
    those using alternative path separators) related to the same path are
    included. Any sub-path entries are included as well, i.e. those
    corresponding to zip archives embedded in other zip archives.
 
    r#r¿)rr"r‰r?rrá)rXÚcacheÚresultÚ
prefix_lenÚpÚnpr<r<r=Ú"_collect_zipimporter_cache_entriesüs
 
ÿ r^cCs@t||ƒD]0}||}||=|o(|||ƒ}|dk    r
|||<q
dS)a—
    Update zipimporter cache data for a given normalized path.
 
    Any sub-path entries are processed as well, i.e. those corresponding to zip
    archives embedded in other zip archives.
 
    Given updater is a callable taking a cache entry key and the original entry
    (after already removing the entry from the cache), and expected to update
    the entry and possibly return a new one to be inserted in its place.
    Returning None indicates that the entry should not be replaced with a new
    one. If no updater is given, the cache entries are simply removed without
    any additional processing, the same as if the updater simply returned None.
 
    N)r^)rXrYÚupdaterr\Ú    old_entryZ    new_entryr<r<r=Ú_update_zipimporter_caches 
racCst||ƒdSrG)ra)rXrYr<r<r=rS0srScCsdd„}t|tj|ddS)NcSs | ¡dSrG)Úclear©r@r`r<r<r=Ú2clear_and_remove_cached_zip_archive_directory_data5szf_remove_and_clear_zip_directory_cache_data.<locals>.clear_and_remove_cached_zip_archive_directory_data©r_©rarÚ_zip_directory_cache)rXrdr<r<r=rV4s þrVZ__pypy__cCsdd„}t|tj|ddS)NcSs&| ¡t |¡| tj|¡|SrG)rbrrÚupdatergrcr<r<r=Ú)replace_cached_zip_archive_directory_dataKs
zT_replace_zip_directory_cache_data.<locals>.replace_cached_zip_archive_directory_datarerf)rXrir<r<r=rUJs  þrUú<string>c    Cs4zt||dƒWnttfk
r*YdSXdSdS)z%Is this string a valid Python script?ÚexecFTN)rJÚ SyntaxErrorÚ    TypeError)rWr¤r<r<r=Ú    is_python]s
rnc    CsNz(tj|dd}| d¡}W5QRXWnttfk
rD|YSX|dkS)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1)Úencodingr½ú#!)Úiorrrr)r0ÚfpÚmagicr<r<r=Úis_shgs 
rtcCs t |g¡S)z@Quote a command line argument according to Windows parsing rules©Ú
subprocessÚ list2cmdline)rOr<r<r=Ú nt_quote_argqsrxcCsH| d¡s| d¡rdSt||ƒr&dS| d¡rDd| ¡d ¡kSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc.
    r‚ú.pywTrprÎrF)rRrnr‰Ú
splitlinesr1)rur¤r<r<r=rrvs
 
rr)r}cGsdSrGr<)r|r<r<r=Ú_chmodˆsr{c
CsRt d||¡zt||ƒWn0tjk
rL}zt d|¡W5d}~XYnXdS)Nzchanging mode of %s to %ozchmod failed: %s)r rßr{r?Úerror)r@r~rlr<r<r=r}Œs
r}c@sŠeZdZdZgZeƒZedd„ƒZedd„ƒZ    edd„ƒZ
edd    „ƒZ ed
d „ƒZ d d „Z edd„ƒZdd„Zedd„ƒZedd„ƒZdS)Ú CommandSpeczm
    A command spec for a #! header, specified as a list of arguments akin to
    those passed to Popen.
    cCs|S)zV
        Choose the best CommandSpec class based on environmental conditions.
        r<©rEr<r<r=roszCommandSpec.bestcCstj tj¡}tj d|¡S)NÚ__PYVENV_LAUNCHER__)r?r@rCr²r0rr)rEÚ_defaultr<r<r=Ú_sys_executable¤szCommandSpec._sys_executablecCs:t||ƒr|St|tƒr ||ƒS|dkr0| ¡S| |¡S)zg
        Construct a CommandSpec from a parameter to build_scripts, which may
        be None.
        N)rçr¦Úfrom_environmentÚ from_string)rEÚparamr<r<r=Ú
from_param©s
 
zCommandSpec.from_paramcCs|| ¡gƒSrG)rr~r<r<r=r‚¸szCommandSpec.from_environmentcCstj|f|jŽ}||ƒS)z}
        Construct a command spec from a simple string representing a command
        line parseable by shlex.split.
        )ÚshlexrÓÚ
split_args)rEÚstringr§r<r<r=rƒ¼szCommandSpec.from_stringcCs8t | |¡¡|_t |¡}t|ƒs4dg|jdd…<dS)Nz-xr)r†rÓÚ_extract_optionsÚoptionsrvrwrO)r ruÚcmdliner<r<r=Úinstall_optionsÅs
zCommandSpec.install_optionscCs:|d ¡d}tƒ |¡}|r.| d¡p0dnd}| ¡S)zH
        Extract any options from the first line of the script.
        rRrr#r¿)rzrKÚmatchÚgrouprU)Z orig_scriptÚfirstrrŠr<r<r=r‰Ës zCommandSpec._extract_optionscCs| |t|jƒ¡SrG)Ú_renderr¦rŠrŸr<r<r=Ú    as_headerÕszCommandSpec.as_headercCs6d}|D](}| |¡r| |¡r|dd…Sq|S)Nz"'r#r±)r‰rR)ÚitemZ_QUOTESÚqr<r<r=Ú _strip_quotesØs
zCommandSpec._strip_quotescCs t dd„|Dƒ¡}d|dS)Ncss|]}t | ¡¡VqdSrG)r}r”rU)r£r’r<r<r=r¥âsz&CommandSpec._render.<locals>.<genexpr>rprRru)r§r‹r<r<r=ràs
ÿzCommandSpec._renderN)rïrðrñròrŠrØr‡rFrorr…r‚rƒrŒr÷r‰r‘r”rr<r<r<r=r}”s*
 
 
 
 
 
    
r}c@seZdZeddZdS)ÚWindowsCommandSpecFrìN)rïrðrñrØr‡r<r<r<r=r•ësr•c@sŠeZdZdZe d¡ ¡ZeZ    e
ddd„ƒZ e
ddd„ƒZ e
dd    d
„ƒZ ed d „ƒZe
d d„ƒZe
dd„ƒZe
dd„ƒZe
ddd„ƒZdS)rnz`
    Encapsulates behavior around writing entry point scripts for console and
    gui apps.
    aJ
        # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
        import re
        import sys
 
        # for compatibility with easy_install; see #2198
        __requires__ = %(spec)r
 
        try:
            from importlib.metadata import distribution
        except ImportError:
            try:
                from importlib_metadata import distribution
            except ImportError:
                from pkg_resources import load_entry_point
 
 
        def importlib_load_entry_point(spec, group, name):
            dist_name, _, _ = spec.partition('==')
            matches = (
                entry_point
                for entry_point in distribution(dist_name).entry_points
                if entry_point.group == group and entry_point.name == name
            )
            return next(matches).load()
 
 
        globals().setdefault('load_entry_point', importlib_load_entry_point)
 
 
        if __name__ == '__main__':
            sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
            sys.exit(load_entry_point(%(spec)r, %(group)r, %(name)r)())
        NFcCs6t dt¡|rtnt ¡}| d||¡}| ||¡S)Nz Use get_argsr¿)ÚwarningsrÙÚEasyInstallDeprecationWarningÚWindowsScriptWriterrnroÚget_script_headerrp)rEr¸r0ÚwininstÚwriterÚheaderr<r<r=Úget_script_argss zScriptWriter.get_script_argscCs$tjdtdd|rd}| ||¡S)NzUse get_headerr½)Ú
stacklevelr+)r–rÙr—rt)rErur0ršr<r<r=r™"sÿzScriptWriter.get_script_headerc cs€|dkr| ¡}t| ¡ƒ}dD]Z}|d}| |¡ ¡D]>\}}| |¡|jtƒ}| ||||¡}    |    D]
}
|
Vqlq:q dS)z
        Yield write_script() argument tuples for a distribution's
        console_scripts and gui_scripts entry points.
        N©ÚconsoleÚguiZ_scripts)    rtrFr`Ú get_entry_mapr§Ú_ensure_safe_nameÚtemplaterµÚ_get_script_args) rEr¸rœrÚtype_rŽróÚeprur|rÀr<r<r=rp+s 
 zScriptWriter.get_argscCst d|¡}|rtdƒ‚dS)z?
        Prevent paths in *_scripts entry point names.
        z[\\/]z+Path separators not allowed in script namesN)rIÚsearchrë)róZ has_path_sepr<r<r=r£=s zScriptWriter._ensure_safe_namecCs t dt¡|rt ¡S| ¡S©NzUse best)r–rÙr—r˜ro)rEZ force_windowsr<r<r=Ú
get_writerFs zScriptWriter.get_writercCs.tjdkstjdkr&tjdkr&t ¡S|SdS)zD
        Select the best ScriptWriter for this environment.
        Úwin32ÚjavaröN)r²ržr?róÚ_namer˜ror~r<r<r=roLszScriptWriter.bestccs|||fVdSrGr<)rEr¦rórœrur<r<r=r¥VszScriptWriter._get_script_argsr¿cCs"|j ¡ |¡}| |¡| ¡S)z;Create a #! line, getting options (if any) from script_text)Úcommand_spec_classror…rŒr‘)rErur0Úcmdr<r<r=rt[s
zScriptWriter.get_header)NF)NF)N)r¿N)rïrðrñròrSrTrør¤r}r®rFrr™rpr÷r£rªror¥rtr<r<r<r=rnïs&#   
 
 
    
rnc@sLeZdZeZedd„ƒZedd„ƒZedd„ƒZedd„ƒZ    e
d    d
„ƒZ d S) r˜cCst dt¡| ¡Sr©)r–rÙr—ror~r<r<r=rªfs zWindowsScriptWriter.get_writercCs"tt|d}tj dd¡}||S)zC
        Select the best ScriptWriter suitable for Windows
        )r0ZnaturalZSETUPTOOLS_LAUNCHERr0)rØÚWindowsExecutableLauncherWriterr?rr)rEZ writer_lookupÚlauncherr<r<r=rols þzWindowsScriptWriter.bestc    #s–tddd|}|tjd ¡ d¡krBdjftƒŽ}t |t    ¡dddd    d
dd g}| 
|¡|  ||¡}‡fd d „|Dƒ}ˆ|||d|fVdS)z For Windows, add a .py extensionz.pyaryrŸÚPATHEXTú;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.r‚ú
-script.pyú.pycú.pyorcsg|] }ˆ|‘qSr<r<r{©rór<r=rΆsz8WindowsScriptWriter._get_script_args.<locals>.<listcomp>rzN) rØr?rr1rÓr±rµr–rÙÚ UserWarningr\Ú_adjust_header)    rEr¦rórœruÚextrõr¶r¨r<r·r=r¥ysÿý 
 z$WindowsScriptWriter._get_script_argscCsNd}d}|dkr||}}t t |¡tj¡}|j||d}| |¡rJ|S|S)zŠ
        Make sure 'pythonw' is used for gui and and 'python' is used for
        console (regardless of what sys.executable is).
        r*r+r¡)rˆÚrepl)rIrJÚescapeÚ
IGNORECASEÚsubÚ _use_header)rEr¦Z orig_headerrHr»Z
pattern_obÚ
new_headerr<r<r=r¹‰s
z"WindowsScriptWriter._adjust_headercCs$|dd… d¡}tjdkp"t|ƒS)zÝ
        Should _adjust_header use the replaced header?
 
        On non-windows systems, always use. On
        Windows systems, only use the replaced header if it resolves
        to an executable on the system.
        r½r±ú"r«)rUr²ržr)rÀZ clean_headerr<r<r=r¿—s    zWindowsScriptWriter._use_headerN) rïrðrñr•r®rFrªror¥r¹r÷r¿r<r<r<r=r˜cs
 
 
 
r˜c@seZdZedd„ƒZdS)r°c #s”|dkrd}d}dg}nd}d}dddg}| ||¡}‡fd    d
„|Dƒ}    ˆ|||d |    fVˆd t|ƒd fVtƒsˆd}
|
tˆƒd fVdS)zG
        For Windows, add a .py extension and an .exe launcher
        r¡z -script.pywryÚclir´r‚rµr¶csg|] }ˆ|‘qSr<r<r{r·r<r=rγszDWindowsExecutableLauncherWriter._get_script_args.<locals>.<listcomp>rzrrfz .exe.manifestN)r¹Úget_win_launcherr>Úload_launcher_manifest) rEr¦rórœruZ launcher_typerºr¶Úhdrr¨Zm_namer<r·r=r¥¥s"
 þz0WindowsExecutableLauncherWriter._get_script_argsN)rïrðrñrFr¥r<r<r<r=r°¤sr°cCs2d|}tƒr| dd¡}n | dd¡}td|ƒS)z«
    Load the Windows launcher (executable) suitable for launching a script.
 
    `type` should be either 'cli' or 'gui'
 
    Returns the executable as a byte string.
    z%s.exeÚ.z-64.z-32.r°)r>rVr#)ÚtypeZ launcher_fnr<r<r=rÃÈs
 rÃcCs0t td¡}tjr|tƒS| d¡tƒSdS)Nzlauncher manifest.xmlrx)Ú pkg_resourcesr#rïrr.Úvarsry)róÚmanifestr<r<r=rÄØs 
rÄFcCst |||¡SrG)rgr­)r@Ú ignore_errorsÚonerrorr<r<r=r­àsr­cCst d¡}t |¡|S)Né)r?Úumask)Útmpr<r<r=r|äs
 
r|cCs:ddl}tj |jd¡}|tjd<tj |¡tƒdS)Nr)    r°r?r@r.Ú__path__r²Úargvrár6)r°Zargv0r<r<r=Ú    bootstrapês
 
 rÒc     s‚ddlm}ddlm‰G‡fdd„dˆƒ}|dkrBtjdd…}tƒ0|fddd    g|tjdpfd|d
œ|—ŽW5QRXdS) Nr)Úsetup©r)cseZdZdZ‡fdd„ZdS)z-main.<locals>.DistributionWithoutHelpCommandsr¿c    s(tƒˆj|f|ž|ŽW5QRXdSrG)Ú _patch_usageÚ
_show_help)r r|ÚkwrÔr<r=rÖûsz8main.<locals>.DistributionWithoutHelpCommands._show_helpN)rïrðrñÚ common_usagerÖr<rÔr<r=ÚDistributionWithoutHelpCommandsøsrÙr#rÏr3z-v)Ú script_argsr:Ú    distclass)r°rÓZsetuptools.distr)r²rÑrÕ)rÑr×rÓrÙr<rÔr=r6ôs    ýüc#sLddl}t d¡ ¡‰‡fdd„}|jj}||j_z
dVW5||j_XdS)Nrze
        usage: %(script)s [options] requirement_or_url ...
           or: %(script)s --help
        csˆttj |¡dS)N)Úscript)rØr?r@r3)r:©ÚUSAGEr<r=Ú    gen_usage    s
ÿz_patch_usage.<locals>.gen_usage)Údistutils.corerSrTrøÚcorerß)rrßZsavedr<rÝr=rÕ     s 
rÕc@seZdZdZdS)r—zF
    Warning for EasyInstall deprecations, bypassing suppression.
    N)rïrðrñròr<r<r<r=r—     sr—)N)rj)N)‰ròrrçrrrÚdistutils.errorsrrrr    Údistutils.command.installr
r rr r Zdistutils.command.build_scriptsrr2rr²r?rrgrDrrIrãrrSr–rŽr:rùrvr†rqÚ    sysconfigrrr°rZsetuptools.externrZsetuptools.extern.six.movesrrrZsetuptools.sandboxrZsetuptools.py27compatrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelr rÈr!r"r#r$r%r&r'r(r)r*r+r,r-r.r/rÇÚ __metaclass__ÚfilterwarningsÚ PEP440WarningÚ__all__r>r2r.rJrOrXr3rýrßrr5r7r4rBrrrKrRrœr^rarSrVÚbuiltin_module_namesrUrnrtrxrrr}r{Ú ImportErrorr¦r}rZsys_executabler•rnr˜r°rr™rÃrÄr­r|rÒr6rúrÕr—r<r<r<r=Ú<module>sà            Dþ
[A))'l R
  ÿ
 
 
TtA