K ixu dZddlmZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z m Z ddlmZddlmZdd lmZdd lmZmZdd lmZdd lmZdd lmZmZmZmZddlm Z!dZ"ddddddZ#dddddddddddde#dddddddddddddZ$e"rd d d!d"d#de$d$<d d d%d&d#de$d'<e$jKe!jLdZ'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0Gd1d2eZ1y)3zFdistutils.command.install Implements the Distutils 'install' command.) annotationsN)log) USER_BASE USER_SITE)ClassVar)Command)DEBUG)DistutilsOptionErrorDistutilsPlatformError) write_file)get_config_vars) change_root convert_path get_platform subst_vars)_framework_compatTz{base}/Lib/site-packagesz{base}/Include/{dist_name}z{base}/Scriptsz{base})purelibplatlibheadersscriptsdatazA{base}/lib/{implementation_lower}{py_version_short}/site-packageszN{platbase}/{platlibdir}/{implementation_lower}{py_version_short}/site-packageszM{base}/include/{implementation_lower}{py_version_short}{abiflags}/{dist_name}z {base}/binz!{base}/lib/{implementation_lower}z*{base}/{platlibdir}/{implementation_lower}z1{base}/include/{implementation_lower}/{dist_name}z{base}/site-packagesz{base}/include/{dist_name}) posix_prefix posix_homentpypypypy_ntz {usersite}zF{userbase}/{implementation}{py_version_nodot_plat}/Include/{dist_name}z:{userbase}/{implementation}{py_version_nodot_plat}/Scriptsz {userbase}nt_userzQ{userbase}/include/{implementation_lower}{py_version_short}{abiflags}/{dist_name}z{userbase}/bin posix_userc tjt5tjDcic]}|tj |dc}cdddScc}w#1swYyxYw)NF)expand) contextlibsuppressAttributeError sysconfigget_scheme_names get_paths)schemes k/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/setuptools/_distutils/command/install.py_load_sysconfig_schemesr+csb   ^ , $446  I''u= =      sA!AA!A!!A*c txsi}ttjt|Dcic]-}|itj |i|j |i/c}Scc}w)z= Extend default schemes with schemes from sysconfig. )r+set itertoolschainINSTALL_SCHEMESget)sysconfig_schemesr)s r* _load_schemesr3ks{ 017R)///;LMN     !!&"- ##FB/    s2A)c&ttdryy)Npypy_version_infoPyPyPython)hasattrsysr*_get_implementationr<{ss'(r;ct|tt|}t|j t |t |yN)_inject_headers _load_scheme_resolve_schemevarsupdate _remove_set _scheme_attrs)obnamer)s r*_select_schemerHs4 T<0E#F GFHOOKM&$9:;r;cp|jDcic]\}}t||||c}}Scc}}w)z1 Include only attrs that are None in ob. )itemsgetattr)rFattrskeyvalues r*rDrDs2*/ S:3'"c:J:RCJ SS Ss22c|jd\}}} tj|}|S#t$rt j |}Y|SwxYw)N_) partitionr&get_preferred_scheme Exceptionfwr))rGos_nameseprMresolveds r*rArAsVs+GS##11#6 O #99T? O#s.AAct|Sr>)r3)rGs r*r@r@s ?4  r;cFt|}|jd|d|S)z Given a scheme name and the resolved scheme, if the scheme does not include headers, resolve the fallback scheme for the name and use headers from it. pypa/distutils#88 r)r@ setdefault)rGr)fallbacks r*r?r?s(D!H i)!45 Mr;cBtDcic] }d||| c}Scc}w)zr|j@|d<|jB|d<tEjF|tIj |tKjL|_'|jQ|jd|j|d<|j|d<tRr,d dl*m*}tWd|t;|jN|jY|jd|j r|j[|j\=|j&j_r|j`|_.n|jb|_.|jedddddddd|jg|j\|_4tjjjm|j\|jn|_.|jp|jsd dddddd|jd!|jud"d#d$y#t$$rd }Y>wxYw)%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)baseposixz+exec-prefix option ignored on this platformNzpre-finalize_{unix,other}zpost-finalize_{unix,other}()rrmrn. platlibdirlib) dist_name dist_version dist_fullname py_versionpy_version_shortpy_version_nodot sys_prefixrmsys_exec_prefixrnabiflagsrimplementation_lowerimplementationwinver)py_version_nodot_platuserbaseusersitezpost-expand_basedirs()baseplatbase)pprintz config vars:zpost-expand_dirs()rrrrrlibbasezafter prepending rootbuild)rr)rr);rmrnrorprqr riosrGwarn dump_dirs finalize_unixfinalize_otherr9versionsplitrrr% distributionget_name get_version get_fullname version_infomajorminorrKr<lowerdictreplace HAS_USER_SITEryrz collectionsChainMapr&rTrB config_varsexpand_basedirsr rprint expand_dirscreate_home_pathrvhas_ext_modulesrtrs convert_pathshandle_extra_pathinstall_libbasepathjoin extra_dirsrr change_rootsset_undefined_options)rrrmrnr local_vars compat_varsrs r*finalize_optionszinstall.finalize_optionsDs KK4++tyy   !6!6&i  99$++)9)9&K  99 KKyy  $$&:  77g  GH#'  23 77g        ! 56[[&&(+ /- H ||H **335 --99;!..;;=$##3#9#9":!C4,,,,,X6#--m<!$11#--m<dH- IIj(C 0 1r;c|j |jl|jduxr|jduxr|jduxs.|j duxs|j duxs|jdu}|r tdy|jrA|j td|jx|_|_|jdy|j*|jx|_|_|jdy|j|j tdt!t"dd}t$j&j)t*j|z|_t$j&j)t*j|z|_n|j|j|_|j|_|j|_|jd y) z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete$User base directory is not specifiedr rz*must not supply exec-prefix without prefix_prefix_additionrr)rprqrvrsrtrurwrxr riryr select_schemerormrnrKr&rrnormpathr9)rincomplete_schemers r*rzinstall.finalize_unixs    (D,A,A,M$$,5,,45,,4- ''4/ - ''4/ -$$, !*8  99$$,,-STT8<8M8M MD  5   | , YY "8< AD  5   | ,{{"##/.D $+96H"#M  gg..szz:=MM #%77#3#3COO#DGW#W ##+'+{{D$ $ D $($4$4D !   ~ .r;cl|jrR|j td|jx|_|_|j t jdzy|j*|jx|_|_|j dy|j2t jjtj|_ |jx|_|_ |j t jy#t$rtdt jdwxYw)z)Finalizes options for non-posix platformsNr_userrz&I don't know how to install stuff on 'rj)riryr rprqrrrGrormrrr9KeyErrorrs r*rzinstall.finalize_other@s 99$$,,-STT8<8M8M MD  5   rww0 1 YY "8< AD  5   | ,{{" gg..szz: 8< CD  5 ""277+ ,)rH)rrGs r*rzinstall.select_schemeVs tT"r;c|D]e}t||}|tjdvrtjj |}t ||j }t|||gy)N)rr)rKrrGr expanduserrrsetattr)rrLattrrs r* _expand_attrszinstall._expand_attrsYs` )D$%C77o-'',,S1C d&6&67dC(  )r;c*|jgdy)zNCalls `os.path.expanduser` on install_base, install_platbase and root.)rprqrrNrrs r*rzinstall.expand_basedirsbs GHr;c*|jgdy)z+Calls `os.path.expanduser` on install dirs.)rsrtrvrurwrxNrrs r*rzinstall.expand_dirsgs   r;c \|D]'}d|z}t||tt||)y)z!Call `convert_path` over `names`.r]N)rrrKrnamesrGrs r*rzinstall.convert_pathsrs5 CD$D D$ WT4-@ A B Cr;c|j|jj|_|jtjdt |jt r |jj d|_t|jdk(r|jdx}}n3t|jdk(r|j\}}n tdt|}nd}d}||_ ||_ y) z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.,rrrzY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr) r|rrwarning isinstancestrrlenr r path_filer)rrrs r*rzinstall.handle_extra_pathxs ?? ""//::DO ?? & KK. $//3/"&//"7"7"<4??#q()-);; JT__%*(,% :*B&j1JIJ#$r;c r|D]2}d|z}t||t|jt||4y)z:Change the install directories pointed by name using root.r]N)rrrrrKrs r*rzinstall.change_rootss; MD$D D$ DIIwtT7J K L Mr;cx|jsyttjj d}|j j D]h}t|j|stjj|r>|jd|dtj|djy)zCreate directories under ~.N~z os.makedirs('z ', 0o700)i) rirrrrrvaluesr startswithisdir debug_printmakedirs)rrors r*rzinstall.create_home_pathsyy BGG..s34$$++- )D4y##D)"''--2E  =i!@A D%( )r;cF|jsZ|jd|jjdj}|j r|t k7r td|jD]}|j||jr|j|jr|j}|jr9t|j}tt|D] }|||d||<|j!t"|j|fd|jdt%t&j(j*t,j(}t%t&j(j.|}t&j(j/t&j(j+|j0}|j r?|jr |j2s&||vr!t5j6d|j0yyyy)zRuns the command.rz"Can't install when cross-compilingNz$writing list of installed files to 'rjzmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r~ run_commandrget_command_obj plat_namerrr get_sub_commandsrcreate_path_filer get_outputsrrrrangeexecuter maprrrr9normcaservr}rr)r build_platcmd_nameoutputsroot_lencountersys_pathrvs r*runz install.runs   W %**::7CMMJ}}|~!=,-QRR--/ 'H   X & ' >>  ! ! # ;;&&(Gyytyy>$S\2CG'.w'7 'BGG$C LLg&6t{{m1E  rww''2rww''2gg&&rww'7'78H8H'IJ MM^^(>(>8+ IIE   ,)? r;ctjj|j|jdz}|j r(|j t||jgfd|y|jd|dy)zCreates the .pth file.pthz creating z path file 'z ' not createdN) rrrrrr}rr rr)rfilenames r*rzinstall.create_path_filesk77<< 4 4dnnv6MN  ! ! LLX'89Yxj;Q  II H:]; }|j|}|jD]}||vs|j|@|jrR|j rF|jt jj|j|jdz|S)z.Assembles the outputs of all the sub-commands.r ) rget_finalized_commandrappendrr}rrrr)rrrcmdr s r*rzinstall.get_outputss--/ -H,,X6C OO- -7*NN8, -  - >>d44 NN277<<(<(UV Wr;cg}|jD]2}|j|}|j|j4|S)z*Returns the inputs of all the sub-commands)rr extend get_inputs)rinputsrrs r*rzinstall.get_inputssK--/ ,H,,X6C MM#..* + , r;cn|jjxs|jjS)zSReturns true if the current distribution has any Python modules to install.)rhas_pure_modulesrrs r*has_libzinstall.has_libs/    . . 0 WD4E4E4U4U4W r;c6|jjS)zLReturns true if the current distribution has any headers to install.)r has_headersrs r*rzinstall.has_headers  ,,..r;c6|jjS)zMReturns true if the current distribution has any scripts to. install.)r has_scriptsrs r*rzinstall.has_scriptsrr;c6|jjS)zJReturns true if the current distribution has any data to. install.)rhas_data_filesrs r*has_datazinstall.has_datas  //11r;rvrurwrxinstall_egg_infocy)NTr:rs r*zinstall.$sr;)returnNone)!__name__ __module__ __qualname__ descriptionrrh__annotations__rr rrkrrrrrrrrrrrrrrrrrrrrr sub_commandsr:r;r*r`r`s ;K8Lt,NO(M  ,YKq 9  v&.:I-FL*FEZr n1(//b,#)I  C !%FM )0d=  / / 2  K( K( " ./ Lr;r`)2__doc__ __future__rrr#r.rr9r&distutils._logrsiterrtypingrcorer rr errorsr r file_utilr rutilrrrrrrrTrWINDOWS_SCHEMEr0rCschemesr^r+r3r<rHrDrAr@r?rEr`r:r;r*r4sa/# %A"'FF% *)+  W+37?F  ))/  *)/# 3 FO "OI 3# %OL!rzz" C    < T! B w gw r;