zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
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
U
G=®dZkã
@s:dZddlZddlZddlmZddlmZddlmZddl    m
Z
ddl m Z ddl mZdd    lmZmZmZdd
lmZdd l mZdd lmZdd lmZdZddddddœZddddddœddddddœeddddddœddddddœdœZer"dddd d!dœed"<ddd#d$d!dœed%<dZGd&d'„d'eƒZdS)(zFdistutils.command.install
 
Implements the Distutils 'install' command.éN)Úlog)ÚCommand)ÚDEBUG)Úget_config_vars)ÚDistutilsPlatformError)Ú
write_file)Ú convert_pathÚ
subst_varsÚ change_root)Ú get_platform)ÚDistutilsOptionError)Ú    USER_BASE)Ú    USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez $base/Scriptsz$base)ÚpurelibÚplatlibÚheadersÚscriptsÚdataz/$base/lib/python$py_version_short/site-packagesz;$platbase/$platlibdir/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez    $base/binz$base/lib/pythonz$base/$platlibdir/pythonz$base/include/python/$dist_namez$base/site-packagesz$base/include/$dist_name)Ú unix_prefixÚ    unix_homeÚntÚpypyÚpypy_ntz    $usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz    $userbaseÚnt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez $userbase/binÚ    unix_userc@s:eZdZdZdddddddd    d
d d d ddddddgZdddgZer`e dddef¡e d¡ddiZ    dd„Z
dd„Z dd „Z d!d"„Z d#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„Zd3d4„Zd5d6„Zd7d8„Zd9d:„Zd;d<„Zd=d>„Zd?d@„ZdAdB„ZdCdD„ZdEefdFefdGefdHefdIdJdK„fgZdS)LÚinstallz'install everything from build directory)zprefix=Nzinstallation prefix)z exec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz<install everything relative to this alternate root directory)zinstall-purelib=Nz;installation directory for pure Python module distributions)zinstall-platlib=Nz8installation directory for non-pure module distributions)z install-lib=Nzginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))zinstall-headers=Nz(installation directory for C/C++ headers)zinstall-scripts=Nz)installation directory for Python scripts)z install-data=Nz%installation directory for data files)ÚcompileÚczcompile .py to .pyc [default])ú
no-compileNzdon't compile .py files)z    optimize=ÚOzlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])ÚforceÚfz1force installation (overwrite any existing files))ú
skip-buildNz2skip rebuilding everything (for testing/debugging))zrecord=Nz3filename in which to record list of installed filesrr r"ÚuserNz!install in user site-package '%s'rcCsšd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_    d|_
d|_ d|_ t |_t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)zInitializes options.Nré)ÚprefixÚ exec_prefixÚhomer#Ú install_baseÚinstall_platbaseÚrootÚinstall_purelibÚinstall_platlibÚinstall_headersÚ install_libÚinstall_scriptsÚ install_datar Úinstall_userbaserÚinstall_usersiterÚoptimizeÚ
extra_pathÚinstall_path_filer Ú
skip_buildÚwarn_dirÚ
build_baseÚ    build_libÚrecord©Úself©r=ú\D:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/_distutils/command/install.pyÚinitialize_options s2 zinstall.initialize_optionscCs‚|js|js|jr&|js|jr&tdƒ‚|jr@|js8|jr@tdƒ‚|jrl|jsd|jsd|jsd|jsd|jrltdƒ‚tjdkrŒ|jrŒ|     d¡d|_| 
d¡tjdkrª|  ¡n|  ¡| 
d¡t j ¡d    }td
d ƒ\}}z
t j}Wntk
rúd }YnX|j ¡|j ¡|j ¡|d t jdd…dt jdd…|||||tt ddƒdœ |_trp|j|jd<|j|jd<| ¡| 
d¡|j|jd<|j|jd<tr¾d    dlm}t dƒ||jƒ| !¡| 
d¡|jrà| "¡|j#dkr|jj$r|j%|_#n|j&|_#| 'dddddddd¡| (¡|j#|_)tj* +|j#|j,¡|_#|j-dk    rf| .d dddddd¡| 
d!¡| /d"d#d$¡dS)%zFinalizes options.zWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)baseÚposixz+exec-prefix option ignored on this platformNzpre-finalize_{unix,other}zpost-finalize_{unix,other}()rr%r&Úz%d.%déz%d%dÚ
platlibdirÚlib) Ú    dist_nameÚ dist_versionÚ dist_fullnameÚ
py_versionÚpy_version_shortÚpy_version_nodotÚ
sys_prefixr%Úsys_exec_prefixr&ÚabiflagsrCÚuserbaseÚusersitezpost-expand_basedirs()ÚbaseÚplatbase)Úpprintz config vars:zpost-expand_dirs()rrrrrÚlibbasezafter prepending rootÚbuild)r8r8)r9r9)0r%r&r'r(r)r r#ÚosÚnameÚwarnÚ    dump_dirsÚ finalize_unixÚfinalize_otherÚsysÚversionÚsplitrrMÚAttributeErrorÚ distributionÚget_nameÚ get_versionÚ get_fullnameÚ version_infoÚgetattrÚ config_varsÚ HAS_USER_SITEr1r2Úexpand_basedirsrrRÚprintÚ expand_dirsÚcreate_home_pathr.Ú ext_modulesr,r+Ú convert_pathsÚhandle_extra_pathÚinstall_libbaseÚpathÚjoinÚ
extra_dirsr*Ú change_rootsÚset_undefined_options)r<rHr%r&rMrRr=r=r>Úfinalize_optionsîs¬ÿÿÿÿÿÿ
 
 
 
 
 
 
 
 
 
õ  
 
 
 
 
 
þ      ÿ
þzinstall.finalize_optionscCs tsdSddlm}t |d¡|jD]r}|d}|ddkrL|dd…}||jkrx|j|}| |¡}t||ƒ }n| |¡}t||ƒ}t d||¡q(dS)zDumps the list of user options.Nr)Ú longopt_xlateú:éÿÿÿÿú=z  %s: %s)    rÚdistutils.fancy_getoptrurÚdebugÚ user_optionsÚ negative_optÚ    translaterd)r<ÚmsgruÚoptÚopt_nameÚvalr=r=r>rX„s 
 
 
 
 
 
zinstall.dump_dirscCs"|jdk    s|jdk    r\|jdkr2|jdkr2|jdksP|jdksP|jdksP|jdkrXtdƒ‚dS|j    rŽ|j
dkrtt dƒ‚|j
|_|_|  d¡n|j dk    r²|j |_|_|  d¡nl|jdkrð|jdk    rÎtdƒ‚tj tj¡|_tj tj¡|_n|jdkr|j|_|j|_|j|_|  d¡dS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incompleteú$User base directory is not specifiedrrz*must not supply exec-prefix without prefixr)r(r)r.r+r,r-r/r0r r#r1rÚ select_schemer'r%r&rUroÚnormpathr[r;r=r=r>rY—sL
ÿþýüûÿ
ÿ 
 
 
ÿ zinstall.finalize_unixcCs¼|jr8|jdkrtdƒ‚|j|_|_| tjd¡n€|jdk    r\|j|_|_| d¡n\|j    dkrvtj
  t j    ¡|_    |j    |_|_z| tj¡Wn"t k
r¶tdtjƒ‚YnXdS)z)Finalizes options for non-posix platformsNr‚Ú_userrz)I don't know how to install stuff on '%s')r#r1rr(r)rƒrUrVr'r%ror„r[ÚKeyErrorr;r=r=r>rZ¿s&
ÿ
 
ÿzinstall.finalize_othercCsdttdƒr(| d¡s(tjdkr$d}nd}t|}tD]*}d|}t||ƒdkr4t||||ƒq4dS)z=Sets the install directories by applying the install schemes.Úpypy_version_info)r…Ú_homerrrÚinstall_N)    Úhasattrr[ÚendswithrUrVÚINSTALL_SCHEMESÚ SCHEME_KEYSrdÚsetattr)r<rVÚschemeÚkeyÚattrnamer=r=r>rƒÕs
ÿ
zinstall.select_schemecCsX|D]N}t||ƒ}|dk    rtjdks.tjdkr:tj |¡}t||jƒ}t|||ƒqdS)Nr@r)rdrUrVroÚ
expanduserr    rerŽ)r<ÚattrsÚattrrr=r=r>Ú _expand_attrsäs
  zinstall._expand_attrscCs| dddg¡dS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.r(r)r*N©r•r;r=r=r>rgíszinstall.expand_basedirscCs| ddddddg¡dS)z+Calls `os.path.expanduser` on install dirs.r+r,r.r-r/r0Nr–r;r=r=r>riòs þzinstall.expand_dirscGs,|D]"}d|}t||tt||ƒƒƒqdS)z!Call `convert_path` over `names`.r‰N)rŽrrd©r<ÚnamesrVr”r=r=r>rløszinstall.convert_pathscCs¤|jdkr|jj|_|jdk    rŒt d¡t|jtƒrB|j d¡|_t|jƒdkr`|jd}}n"t|jƒdkrz|j\}}ntdƒ‚t    |ƒ}nd}d}||_
||_ dS)    z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.ú,r$rrBzY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsrA) r4r_rrWÚ
isinstanceÚstrr]Úlenr rÚ    path_filerq)r<rrqr=r=r>rmþs(
 
 
ÿ  ÿ
zinstall.handle_extra_pathc    Gs0|D]&}d|}t||t|jt||ƒƒƒqdS)z:Change the install directories pointed by name using root.r‰N)rŽr
r*rdr—r=r=r>rr szinstall.change_rootscCsb|js
dSttj d¡ƒ}|j ¡D]8\}}| |¡r$tj |¡s$|     d|¡t 
|d¡q$dS)zCreate directories under ~.Nú~zos.makedirs('%s', 0o700)iÀ) r#rrUror’reÚitemsÚ
startswithÚisdirÚ debug_printÚmakedirs)r<r'rVror=r=r>rj&szinstall.create_home_pathcCs"|js6| d¡|j d¡j}|jr6|tƒkr6tdƒ‚| ¡D]}| |¡q>|j    r\| 
¡|j rº|  ¡}|j r t|j ƒ}tt|ƒƒD]}|||d…||<q†| t|j |fd|j ¡ttjjtjƒ}ttjj|ƒ}tj tj |j¡¡}|jr|j    r|js||krt d|j¡dS)zRuns the command.rTz"Can't install when cross-compilingNz'writing list of installed files to '%s'zƒmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r6Ú run_commandr_Úget_command_objÚ    plat_namer7r rÚget_sub_commandsrÚcreate_path_filer:Ú get_outputsr*rœÚrangeÚexecuterÚmaprUror„r[Únormcaser.r5rrz)r<Ú
build_platÚcmd_nameÚoutputsÚroot_lenÚcounterÚsys_pathr.r=r=r>Úrun2sD
 
ÿþÿÿþýz install.runcCsJtj |j|jd¡}|jr8| t||jgfd|¡n|     d|¡dS)zCreates the .pth fileú.pthz creating %szpath file '%s' not createdN)
rUrorprnrr5r«rrqrW)r<Úfilenamer=r=r>r¨^s
ÿ
þzinstall.create_path_filecCshg}| ¡D].}| |¡}| ¡D]}||kr"| |¡q"q |jrd|jrd| tj |j    |jd¡¡|S)z.Assembles the outputs of all the sub-commands.rµ)
r§Úget_finalized_commandr©Úappendrr5rUrorprn)r<r°r¯Úcmdr¶r=r=r>r©ls 
  ÿzinstall.get_outputscCs.g}| ¡D]}| |¡}| | ¡¡q |S)z*Returns the inputs of all the sub-commands)r§r·ÚextendÚ
get_inputs)r<Úinputsr¯r¹r=r=r>r»}s
 
zinstall.get_inputscCs|j ¡p|j ¡S)zSReturns true if the current distribution has any Python
        modules to install.)r_Úhas_pure_modulesÚhas_ext_modulesr;r=r=r>Úhas_lib‰s
ÿzinstall.has_libcCs
|j ¡S)zLReturns true if the current distribution has any headers to
        install.)r_Ú has_headersr;r=r=r>rÀszinstall.has_headerscCs
|j ¡S)zMReturns true if the current distribution has any scripts to.
        install.)r_Ú has_scriptsr;r=r=r>rÁ”szinstall.has_scriptscCs
|j ¡S)zJReturns true if the current distribution has any data to.
        install.)r_Úhas_data_filesr;r=r=r>Úhas_data™szinstall.has_datar.r-r/r0Úinstall_egg_infocCsdS)NTr=r;r=r=r>Ú<lambda>¤ózinstall.<lambda>) Ú__name__Ú
__module__Ú __qualname__Ú descriptionr{Úboolean_optionsrfr¸rr|r?rtrXrYrZrƒr•rgrirlrmrrrjr´r¨r©r»r¿rÀrÁrÃÚ sub_commandsr=r=r=r>rWsn    É;
ÿ
N(    " , 
ür)Ú__doc__r[rUÚ    distutilsrÚdistutils.corerÚdistutils.debugrÚdistutils.sysconfigrÚdistutils.errorsrÚdistutils.file_utilrÚdistutils.utilrr    r
r r Úsiter rrfÚWINDOWS_SCHEMErŒrrr=r=r=r>Ú<module>sz          û
ûûûûé!û
    ú