K i4BUdZddlmZddlZddlZddlZddlZddlZddlm Z m Z m Z ddl m Z ddlmZmZddlmZddlmZd d lmZmZdd lmZdd lmZmZerdd lmZedZde d<dZ!dZ"dZ#d%dZ$GddeZ%e&jOdjQZ)de d<dZ*dZ+d%dZ,dddZ-d Z.d!Z/d&d"Z0gd#Z1 d' d(d$Z2y))z6setuptools.command.bdist_egg Build .egg distributions) annotationsN)get_path get_platformget_python_version)CodeType) TYPE_CHECKINGLiteral)Command)Library)StrPathTensure_directory)log)mkpath remove_tree) TypeAlias)rwxar _ZipFileModectdS)Npurelib)rb/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/setuptools/command/bdist_egg.py _get_purelibrs I rc~d|vr"tjj|d}|jdr|dd}|S)N.rmodulei)ospathsplitextendswith)filenames r strip_moduler&#s@ h77##H-a0"CR= Orc#Ktj|D]-\}}}|j|j|||f/yw)zbDo os.walk in a reproducible way, independent of indeterministic filesystem readdir order N)r!walksort)dirbasedirsfiless r sorted_walkr.+sE WWS\ dE  D% sAA ctjdj}t|dd5}|j ||zdddy#1swYyxYw)Na def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, importlib.resources as irs, importlib.util with irs.as_file(irs.files(__name__).joinpath(%r)) as __file__: __loader__ = None; del __bootstrap__, __loader__ spec = importlib.util.spec_from_file_location(__name__,__file__) mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) __bootstrap__() rutf-8encoding)textwrapdedentlstripopenwrite)resourcepyfile_stub_templatefs r write_stubr<5sW__   fh fcG ,+ )*+++s AAcjeZdZdZgdZgdZdZddZddZdZ dZ d Z d Z d Z dd Zdd ZdZy) bdist_eggzcreate an "egg" distribution))z bdist-dir=bz1temporary directory for creating the distribution)z plat-name=pzZplatform name to embed in generated filenames (by default uses `sysconfig.get_platform()`))exclude-source-filesNz+remove all .py files from the generated egg) keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z dist-dir=dz-directory to put final built distributions in) skip-buildNz2skip rebuilding everything (for testing/debugging))rBrErAcfd|_d|_d|_d|_d|_d|_d|_y)NF) bdist_dir plat_name keep_tempdist_dir skip_build egg_outputexclude_source_filesselfs rinitialize_optionszbdist_egg.initialize_options_s4 $(!rcH|jdx}|_|j|_|j@|jdj}t j j|d|_|jt|_|jdd|jt|jt|jjxr |j}t j j|j |dz|_ yy)Negg_infobdistegg)rJrJ) py_versionplatformz.egg)get_finalized_commandei_cmdrRrG bdist_baser!r"joinrHrset_undefined_optionsrL_get_egg_basenamer distributionhas_ext_modulesrJ)rOrXrYbasenames rfinalize_optionszbdist_egg.finalize_optionshs#99*EE >> !33G<GGJWW\\*e> !)^DN ""7,DE ?? "//-/**::<O0H !ggll4==(V:KLDO #rc|j|jd_tjj tjj t}|jjgc}|j_ |D]}t|trt|dk(rtjj|dr~tjj |d}tjj |}||k(s"|j|tjzr|t|dzd|df}|jjj!| t#j$d|j|j'ddd||j_ y#||j_ wxYw) Ninstallr rzinstalling package data to %s install_dataF)forceroot)rGrW install_libr!r"normcaserealpathrr] data_files isinstancetuplelenisabs startswithsepappendrinfo call_command)rO site_packagesolditemri normalizeds rdo_install_datazbdist_egg.do_install_data~si<@NN""9-9(()9)9,.)IJ ,0,=,=,H,H")T   ) 6D$&3t9>77==a)!ww//Q8H!#!1!1(!;J!]2j6K6K%.7 (M(:Q(>(@A47J    ( ( / / 5 6 / HH4dnn E   nE  E+.D   (3D   (s 84F>>Gc|jgS)N)rLrNs r get_outputszbdist_egg.get_outputss  rc  tD]}|j||j |jd|j|jd|j|j |fi|}|j ||S)z8Invoke reinitialized command `cmdname` with keyword argsrKdry_run)INSTALL_DIRECTORY_ATTRS setdefaultrGrKr|reinitialize_command run_command)rOcmdnamekwdirnamecmds rrszbdist_egg.call_commandsq. 3G MM'4>> 2 3 lDOO4 i.'d''626 ! rc |jdtjd|j|j d}|j }d|_|j jr|js|jd|jdd}||_|j\}}g|_ g}t|D]\}}tjj|\} } tjj!|jt#| dz} |jj%| tjd ||j&s)t)tjj+|| |j%| |j-tj.d ||<|r|j1||j j2r|j5|j} tjj!| d } |j7| |j j8rJtjj!| d }tjd ||jd|d|j;| tjj!| d}|rvtjd||j&st=|t?|dd5}|jAdj!||jAddddnVtjjC|r7tjd||j&stjD|tGtjj!| d |jItjjKtjj!|jLdrtjNd|jPr|jStU|jV| |jX|j&|j[|j\s!t_|j|j&ta|j dgj%dtc|jVfy#1swY_xYw)NrRzinstalling library code to %srb build_clibrgF)warn_dir.pyzcreating stub loader for %s/EGG-INFOscriptszinstalling scripts to %sinstall_scriptsT) install_dirno_epznative_libs.txtz writing %swtr0r1 z removing %sz depends.txtzxWARNING: 'depends.txt' will not be used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.)verboser|moder| dist_filesr>)2rrrrrGrWrfr]has_c_librariesrKrsget_ext_outputsstubs enumerater!r"r#rZr&rqr|r<r_replacerp byte_compilerjrxrrcopy_metadata_torr6r7isfileunlinkwrite_safety_flagzip_safeexistsrRwarnrM zap_pyfiles make_zipfilerLr gen_headerrIrgetattrr)rOinstcmdold_rootr all_outputs ext_outputs to_compiler@ext_namer%_extr9 archive_rootrR script_dir native_libs libs_files rrunz bdist_egg.runs $ 0$..A,,Y7<<    , , .t   \ * > #'#7#7#9 [  $[1 ;KAxWW--h7NHdWW\\$..,x2H52PQF JJ  f % HH2H =<<277++H5v>   f %%--bffc:KN ;    Z (    ' '  "~~ 77<< j9 H    $ $h :J HH/ <   /Zt  T h'ggll8->?  HH\; /<< -+tg>*)OODIIk$:;OOD)**WW^^K ( HH]K 0<< +&"'',,|Z@$--/R 77>>"'',,t}}mD E HHP   $ $      OO LLLL"  ~~  = !!<4;;   OO=  ?**s 2S22S<c tjdt|jD]!\}}}|D]}tj j ||}|jdr+tjd|t j||jdsr|}d}tj||}tj j |tj|jddz} tjd|d | d  t j| t j || $y#t$rY(wxYw) Nz+Removing .py files from temporary directoryrz Deleting %s __pycache__z#(?P.+)\.(?P[^.]+)\.pycname.pyczRenaming file from [z] to [])rrrwalk_eggrGr!r"rZr$debugrrematchpardirgroupremoveOSErrorrename) rOr+r,r-rr"path_oldpatternmpath_news rrzbdist_egg.zap_pyfiless >?!)$..!9 2 D$ 2ww||D$/=='IImT2IIdO==/#HDG$/A!ww||D"))QWWV_v=UVHHH3H:VH:QOP (+IIh1% 2 2"#sE EEct|jdd}||Stjdt |j |j S)Nrz4zip_safe flag not set; analyzing archive contents...)rr]rr analyze_eggrGr)rOsafes rrzbdist_egg.zip_safesCt((*d;  K GH4>>4::66rcy)NrrrNs rrzbdist_egg.gen_headersrctjj|j}tjj |d}|j j jD]]}|j|stjj ||t|d}t||j||_y)z*Copy metadata (egg info) to the target_dirN) r!r"normpathrRrZrXfilelistr-rormr copy_file)rO target_dir norm_egg_infoprefixr"targets rrzbdist_egg.copy_metadata_tos((7 mR0KK((.. -Dv&j$s6{}2EF (tV,  -rc  g}g}|jdi t|jD]T\ }}|j fd|D|D].} |zdz tjj |<0V|j jr|jd}|jD]}t|tr|j|j}|j|}tjj|j!drotjj#tjj |j|s|j%|||fS)zAGet a list of relative paths to C extensions in the output distrorc3K|]B}tjj|djtvr |zDyw)rcN)r!r"r#lowerNATIVE_EXTENSIONS).0r%r+pathss r z,bdist_egg.get_ext_outputs..-sH77##H-a0668>8&LM#**84 5K''rNreturnNone)rz Literal['w'])__name__ __module__ __qualname__ description user_optionsboolean_optionsrPr`rxrzrsrrrrrrrrrr>r>GsP0KL&JO)M,/2!R h2.7 -(rr>z.dll .so .dylib .pydzdict[str, None]rc#Kt|}t|\}}}d|vr|jd|||f|Ed{y7w)z@Walk an unpacked egg's contents, skipping the metadata directoryrN)r.nextr)egg_dirwalkerr+r,r-s rrrFsJ  !FV D$T J e s>"'',,w B? @K : D%g.HdE HD}}U#t}}V'<v&$--*?"7D$>G4  HH KrctjD]\}}tjj ||}tjj |r'|t ||k7sVtj|l|ot ||k(s~t|dd5}|jddddy#1swYxYw)Nrr0r1r) rrr!r"rZrboolrr6r7)rrrrr;s rrrbs &&(b WW\\'2 & 77>>" |tDzT1 "  $t*"4b$1 Q       s !B>>C zzip-safez not-zip-safe)TFcxtjj||}|dd|vry|t|dzdj tj d}||xrdxsdztjj |dz}d}t|d }|j|tj|} |jd} tjt| } d D] } | | vstj d || d } "d | vr%dD] } | | vstj d|| d } "| S)z;Check whether module possibly uses unsafe-for-zipfile stuffNTrcrrrrb)__file____path__z%s: module references %sFinspect) getsource getabsfilegetfile getsourcefilegetsourcelines findsource getcomments getframeinfogetinnerframesgetouterframesstacktracez"%s: module MAY be using inspect.%s)r!r"rZrmrrpr#r6readmarshalloadclosedictfromkeys iter_symbolsrr) rr+rrr%pkgr skipr;codersymbolsbads rrrts3ww||D$'H} s7|a! " * *2663 7C CKC%2 &)9)9$)?)B BF D XtAFF4L <<?DGGI DmmL./G' '> HH/ =DG   Cg~=vsK! " Krc#K|jEd{|jD];}t|tr|t|ts)t |Ed{=y7O7 w)zBYield names and strings used by `code` and its nested code objectsN)co_names co_constsrkstrrr)rconsts rrrsX}}+ eS !K x (#E* * * + +s'A&A"8A& A&A$A&$A&ctjjdstjdk7rytjdtjdy)NjavacliTz1Unable to analyze compiled code on this platform.zfPlease ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.pyF)sysrVrorrrrrrrsF << " "6 *s||u/DHH @AHH D r)rgrrd install_basecddl}ttjj |t j d|fd}|r |jn |j}sD|j|||} tD]\} } } || | | | j|StD]\} } } |d| | |S)aqCreate a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. rNrz#creating '%s' and adding '%s' to itcD|D]}tjjtjj||}tjj |s`|t dzd}s|j ||tjd|y)Nrcz adding '%s') r!r"rrZrrmr7rr)zrnamesrr"r@base_dirr|s rvisitzmake_zipfile..visitsz ,D77##BGGLL$$?@Dww~~d#X*,-GGD!$ -+  ,r) compression) zipfilerr!r"rrrr ZIP_DEFLATED ZIP_STOREDZipFiler.r ) zip_filenamer#rr|compressrr&r$r%r!rr,r-s ` ` rrrs 277??< (':HH 2L(K,+3'&&8J8JK  OOL$KO H$/$9 % GT5 !We $ %   %0$9 ( GT5 $ ' ( rr)rr)FFTr) r*r rrr|rrrrr )3__doc__ __future__rr r!rrr3 sysconfigrrrtypesrtypingrr setuptoolsr setuptools.extensionr _pathr r distutilsrdistutils.dir_utilrrtyping_extensionsrr__annotations__rr&r.r<r>r rsplitrrrrrrrrr}rrrrr9s# @@)(.2+""45 i5 +$y(y(x&*]]3I3O3O3Q%R?R$    %P+ Y   %%% %  %%r