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
U
G=®d¶ã@sžddlmZddlmZddlmZmZddlZddlZddl    Z    ddl
m Z ddl Z ddl mZddlmZddlZeZGdd    „d    ejeƒZGd
d „d ƒZdS) é)Ú convert_path)Úlog)ÚDistutilsErrorÚDistutilsOptionErrorN)Úsix)Ú easy_install)Ú
namespacesc@sveZdZdZdZejddgZejdgZdZdd„Z    d    d
„Z
d d „Z e d d„ƒZ dd„Zdd„Zdd„Zdd„ZdS)ÚdevelopzSet up package for developmentz%install package in 'development mode')Ú    uninstallÚuzUninstall this source package)z    egg-path=Nz-Set the path to be used in the .egg-link filer
FcCs2|jrd|_| ¡| ¡n| ¡| ¡dS)NT)r
Z multi_versionÚuninstall_linkZuninstall_namespacesÚinstall_for_developmentZwarn_deprecated_options©Úself©rúQD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/command/develop.pyÚrun s 
z develop.runcCs&d|_d|_t |¡d|_d|_dS)NÚ.)r
Úegg_pathrÚinitialize_optionsÚ
setup_pathZalways_copy_fromrrrrr)s
 
zdevelop.initialize_optionscCs| d¡}|jr,d}|j|jf}t||ƒ‚|jg|_t |¡| ¡|     ¡|j
  t   d¡¡|jd}t j |j|¡|_|j|_|jdkr t j |j¡|_t |j¡}t t j |j|j¡¡}||krØtd|ƒ‚tj|t |t j |j¡¡|jd|_| |j|j|j¡|_dS)NÚegg_infoz-Please rename %r to %r before using 'develop'z*.eggz    .egg-linkzA--egg-path must be a relative path from the install directory to ©Ú project_name)Úget_finalized_commandZbroken_egg_inforrÚegg_nameÚargsrÚfinalize_optionsÚexpand_basedirsÚ expand_dirsZ package_indexÚscanÚglobÚosÚpathÚjoinÚ install_dirÚegg_linkÚegg_baserÚabspathÚ pkg_resourcesÚnormalize_pathrÚ DistributionÚ PathMetadataÚdistÚ_resolve_setup_pathr)rÚeiÚtemplaterZ egg_link_fnÚtargetrrrrr0sF
 
 
 
 
 ÿÿÿýýzdevelop.finalize_optionscCsn| tjd¡ d¡}|tjkr0d| d¡d}t tj     |||¡¡}|t tj¡krjt
d|t tj¡ƒ‚|S)zµ
        Generate a path from egg_base back to '.' where the
        setup script resides and ensure that path points to the
        setup path from $install_dir/$egg_path.
        ú/z../ézGCan't get a consistent path to setup script from installation directory) Úreplacer"ÚsepÚrstripÚcurdirÚcountr)r*r#r$r)r'r%rZ path_to_setupZresolvedrrrr.Zs
ÿ
ýzdevelop._resolve_setup_pathc    Cs@tjsžt|jddƒrž|jddd| d¡| d¡}t |j    ¡}|jd|d| d¡|jddd| d¡| d¡}||_
||j _ t  ||j¡|j _n"| d¡|jdd    d| d¡tjrØ| tj¡dt_| ¡t d
|j|j¡|js(t|jd ƒ}| |j
d |j¡W5QRX| d|j |j ¡dS) NZuse_2to3FÚbuild_pyr)Zinplacer)r'Ú    build_extr3zCreating %s (link to %s)ÚwÚ
)rÚPY2ÚgetattrÚ distributionÚreinitialize_commandÚ run_commandrr)r*Ú    build_librr-Úlocationr,rÚ    _providerÚ
setuptoolsZbootstrap_install_fromrZinstall_namespacesrÚinfor&r'Údry_runÚopenÚwriterZprocess_distributionÚno_deps)rZbpy_cmdZ
build_pathZei_cmdÚfrrrr ns8
 
 
 
 
ÿ
 
 
  zdevelop.install_for_developmentcCs¢tj |j¡rzt d|j|j¡t|jƒ}dd„|Dƒ}| ¡||j    g|j    |j
gfkrht  d|¡dS|j szt  |j¡|j sŒ| |j¡|jjržt  d¡dS)NzRemoving %s (link to %s)cSsg|] }| ¡‘qSr)r6)Ú.0ÚlinerrrÚ
<listcomp>¡sz*develop.uninstall_link.<locals>.<listcomp>z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r"r#Úexistsr&rrFr'rHÚcloserrÚwarnrGÚunlinkZ
update_pthr-r?Úscripts)rZ egg_link_fileÚcontentsrrrr s 
 
ÿ   zdevelop.uninstall_linkc
Cs€||jk    rt ||¡S| |¡|jjp*gD]N}tj t    |ƒ¡}tj 
|¡}t   |¡}|  ¡}W5QRX| ||||¡q,dS©N)r-rÚinstall_egg_scriptsÚinstall_wrapper_scriptsr?rSr"r#r(rÚbasenameÚiorHÚreadZinstall_script)rr-Ú script_nameZ script_pathÚstrmÚ script_textrrrrV¯s
 
  zdevelop.install_egg_scriptscCst|ƒ}t ||¡SrU)ÚVersionlessRequirementrrW©rr-rrrrWÁszdevelop.install_wrapper_scriptsN)Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú descriptionrÚ user_optionsÚboolean_optionsZcommand_consumes_argumentsrrrÚ staticmethodr.r r rVrWrrrrr    s"þ     *
/r    c@s(eZdZdZdd„Zdd„Zdd„ZdS)    r^a©
    Adapt a pkg_resources.Distribution to simply return the project
    name as the 'requirement' so that scripts will work across
    multiple versions.
 
    >>> from pkg_resources import Distribution
    >>> dist = Distribution(project_name='foo', version='1.0')
    >>> str(dist.as_requirement())
    'foo==1.0'
    >>> adapted_dist = VersionlessRequirement(dist)
    >>> str(adapted_dist.as_requirement())
    'foo'
    cCs
||_dSrU)Ú_VersionlessRequirement__distr_rrrÚ__init__ÕszVersionlessRequirement.__init__cCs t|j|ƒSrU)r>rh)rÚnamerrrÚ __getattr__Øsz"VersionlessRequirement.__getattr__cCs|jSrUrrrrrÚas_requirementÛsz%VersionlessRequirement.as_requirementN)r`rarbrcrirkrlrrrrr^Æsr^)Údistutils.utilrÚ    distutilsrÚdistutils.errorsrrr"r!rYZsetuptools.externrr)Zsetuptools.command.easy_installrrErÚtypeÚ __metaclass__ZDevelopInstallerr    r^rrrrÚ<module>s     5