Jd@bdZddlmZmZddlmZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl mZmZddlmZddlmZd d lmZdd lmZmZd Zd ZdZdZGddeZed Z!dZ"dZ#dZ$dddZ%dZ&dZ'dZ(gdZ) d dZ*dS)!z6setuptools.command.bdist_egg Build .egg distributions) remove_treemkpath)log)CodeTypeN)get_build_platform Distribution)Library)Command)ensure_directory)get_pathget_python_versionc tdS)Npurelib)r O/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/bdist_egg.py _get_purelibrs I  rcd|vr%tj|d}|dr |dd}|S)N.rmodulei)ospathsplitextendswith)filenames r strip_modulersM h7##H--a0""!CRC= Orc#Ktj|D]5\}}}|||||fV6dS)zbDo os.walk in a reproducible way, independent of indeterministic filesystem readdir order N)rwalksort)dirbasedirsfiless r sorted_walkr%"s` WS\\  dE  D%  rctjd}t|d5}|||zddddS#1swxYwYdS)Na def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, importlib.util __file__ = pkg_resources.resource_filename(__name__, %r) __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__() w)textwrapdedentlstripopenwrite)resourcepyfile_stub_templatefs r write_stubr1,s_ &   VXX fc  +a )***++++++++++++++++++sAA!$A!ceZdZdZddddezfdddd gZgd Zd Zd Zd Z dZ dZ dZ dZ dZdZdZdZdS) bdist_eggzcreate an "egg" distribution)z bdist-dir=bz1temporary directory for creating the distributionz plat-name=pz;platform name to embed in generated filenames (default: %s))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))r7r:r6chd|_d|_d|_d|_d|_d|_d|_dS)Nr) bdist_dir plat_name keep_tempdist_dir skip_build egg_outputexclude_source_filesselfs rinitialize_optionszbdist_egg.initialize_optionsSs: $(!!!rc b|dx}|_|j|_|j?|dj}t j|d|_|jt|_| dd|j tdd|j |jt|jo|j }t j|j|dz|_ dSdS)Negg_infobdistegg)r?r?z.egg)get_finalized_commandei_cmdrGr< bdist_baserrjoinr=rset_undefined_optionsrAregg_name egg_versionr distributionhas_ext_modulesr?)rDrKrLbasenames rfinalize_optionszbdist_egg.finalize_options\s #99*EEE > !33G<<GJW\\*e< !/11DN ""7,DEEE ? "$dFOV-?"$$!1133Fhjj  !gll4=(V:KLLDOOO # "rc|j|d_tjtjt}|jj gc}|j_ |D]}t|trt|dkrtj |drtj|d}tj|}||ks"||tjzr"|t|dzd|df}|jj | t#jd|j|ddd||j_ dS#||j_ wxYw)Ninstallr rzinstalling package data to %s install_data)forceroot)r<rJ install_librrnormcaserealpathrrQ data_files isinstancetuplelenisabs startswithsepappendrinfo call_command)rD site_packagesolditemr] normalizeds rdo_install_datazbdist_egg.do_install_datats<@N""9--9(()9)9,..)I)IJJ ,0,=,H")T  ) 6 6D$&& J3t99>>7==a))J!w//Q88H!#!1!1(!;!;J!]22j6K6K%.772 (M(:(:Q(>(?(?@$q'I   ( / / 5 5 5 5 / H4dn E E E   nAD  A A A+.D  ( ( (3D  ( . . . .s 2GGc|jgS)N)rArCs r get_outputszbdist_egg.get_outputss   rc tD]}|||j|d|j|d|j|j|fi|}|||S)z8Invoke reinitialized command `cmdname` with keyword argsr@dry_run)INSTALL_DIRECTORY_ATTRS setdefaultr<r@rpreinitialize_command run_command)rDcmdnamekwdirnamecmds rrgzbdist_egg.call_commands. 3 3G MM'4> 2 2 2 2 lDO444 i...'d'66266 !!! rc |dtjd|j|d}|j}d|_|jr|js|d| dd}||_| \}}g|_ g}t|D]\}}tj|\} } tj|jt#| dz} |j | tjd ||js-t)tj|| || |tjd ||<|r|||jjr||j} tj| d } || |jjrMtj| d }tjd || d|d|| tj| d}|rtjd||jspt=|t?|d}| d|| d|!nOtj"|r0tjd||jstj#|tItj| d |%tj&tj|j'drtj(d|j)r|*tW|j,| |j-|j|.|j/sta|j|jtc|jdgdte|j,fdS)NrGzinstalling library code to %srV build_clibr[r)warn_dir.pyzcreating stub loader for %s/EGG-INFOscriptszinstalling scripts to %sinstall_scriptsrW) install_dirno_epznative_libs.txtz writing %swt z removing %sz depends.txtzxWARNING: 'depends.txt' will not be used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.)verboserpmoderp dist_filesr3)3rtrrfr<rJrZrQhas_c_librariesr@rgget_ext_outputsstubs enumeraterrrrMrrerpr1rSreplacerd byte_compiler^rlrrcopy_metadata_tor r+r,closeisfileunlinkwrite_safety_flagzip_safeexistsrGwarnrB zap_pyfiles make_zipfilerAr gen_headerr>rgetattrr)rDinstcmdold_rootrx all_outputs ext_outputs to_compiler5ext_namerextr. archive_rootrG script_dir native_libs libs_files rrunz bdist_egg.runs $$$ 0$.AAA,,Y77<   , , . . +t +   \ * * * :: #'#7#7#9#9 [  &{33 ; ;MQG,,X66MHcW\\$.,x2H2H"'3())F J  f % % % H2H = = =< ?27++H55v>>>   f % % %%--bfc::KNN  )   Z ( ( (   ' #  " " "~ 7<< j99 H   $ 'h ::J H/ < < <   /Z$%  ' ' ' h'''gll8->??  ' H\; / / /< " --- d33  + 6 6777%%%!!! W^^K ( ( ' H]K 0 0 0< ' +&&& GLLz 2 2DMMOO    7>>"',,t}mDD E E  HP     $        T_lDL!\0A0A C C C C~ >  = = = = !<44;; ,.. @ B B B B Brc tjdt|jD]1\}}}|D]&}tj||}|dr)tjd|t j ||dr|}d}tj ||}tj|tj | ddz} tjd|d | d  t j| n#t$rYnwxYwt j|| (3dS) Nz+Removing .py files from temporary directoryr|z Deleting %s __pycache__z#(?P.+)\.(?P[^.]+)\.pycname.pyczRenaming file from [z] to [])rrfwalk_eggr<rrrMrdebugrrematchpardirgroupremoveOSErrorrename) rDr"r#r$rrpath_oldpatternmpath_news rrzbdist_egg.zap_pyfilessj >???!)$.!9!9 2 2 D$ 2 2w||D$//==''$ImT222IdOOO==//2#HDG$//A!w||bi6)A C CHHH#88XXX/000 (++++"Ih111+ 2 2 2sD33 E?Ect|jdd}||Stjdt |j|jS)Nrz4zip_safe flag not set; analyzing archive contents...)rrQrr analyze_eggr<r)rDsafes rrzbdist_egg.zip_safesFt(*d;;  K GHHH4>4:666rcdS)Nr'rrCs rrzbdist_egg.gen_header ssrctj|j}tj|d}|jjjD]q}||rZtj||t|d}t|| ||rdS)z*Copy metadata (egg info) to the target_dirN) rrnormpathrGrMrKfilelistr$rcrar copy_file)rD target_dir norm_egg_infoprefixrtargets rrzbdist_egg.copy_metadata_tos((77 mR00K(. - -Dv&& -j$s6{{||2DEE (((tV,,,  - -rcg}g}|jdi}t|jD]\}}}|D]^}tj|dt vr||||z_|D]1}|||zdz|tj||<2|j r| d}|j D]} t| tr|| j} || }tj|dsWtjtj|j|r||||fS)zAGet a list of relative paths to C extensions in the output distrorrWr} build_extzdl-)r<r%rrrlowerNATIVE_EXTENSIONSrerMrQrRrJ extensionsr_r get_ext_fullnamerget_ext_filenamerSrcr) rDrrpathsr"r#r$r build_cmdrfullnames rrzbdist_egg.get_ext_outputss  $!,T^!>>  G G78&L&LMM5#**8444K''rN)__name__ __module__ __qualname__ descriptionr user_optionsboolean_optionsrErTrlrnrgrrrrrrrrrr3r3<s2K > s,.@.@.B.BC D 8 . : ?L O)))MMM0///2!!!OBOBOBb2224777 - - -(((((rr3z.dll .so .dylib .pydc#Kt|}t|\}}}d|vr|d|||fV|D]}|VdS)z@Walk an unpacked egg's contents, skipping the metadata directoryr~N)r%nextr)egg_dirwalkerr"r#r$bdfs rrr;sy  ! !FV D$T J e  rctD]G\}}tjtj|d|r|cSHt sdSd}t|D]t\}}}|D]k}|ds|dr-|ds|drt||||o|}lu|S)Nr~FTr|z.pywrz.pyo) safety_flagsitemsrrrrMcan_scanrr scan_module) rrflagfnrr"r#r$rs rrrFs &&((b 7>>"',,w B?? @ @ KKK  ::u D%g..HHdE H HD}}U## Ht}}V'<'< Hv&& H$--*?*? H"7D$>>G4  H KrctD]\}}tj||}tj|r*|t ||krtj|n|Lt ||kr9t|d}| d| dS)Nrr) rrrrrMrboolrr+r,r)rrrrr0s rrrXs &&((b W\\'2 & & 7>>"   |tDzzT11 "  $t**"4"4RA GGDMMM GGIIIrzzip-safez not-zip-safe)TFctj||}|dd|vrdS|t|dzdtjd}||rdpdztj|dz}tjdkrd }nd }t|d }| |tj |} | d} tt!| } d D]} | | vrt#jd || d} d| vr!dD]} | | vrt#jd|| d} | S)z;Check whether module possibly uses unsafe-for-zipfile stuffNTrWrrr) rb)__file____path__z%s: module references %sFinspect) getsource getabsfile getsourcefilegetfilegetsourcelines findsource getcomments getframeinfogetinnerframesgetouterframesstacktracez"%s: module MAY be using inspect.%s)rrrMrarrdrsys version_infor+readmarshalloadrdictfromkeys iter_symbolsrr) rr"rrrpkgrskipr0codersymbolsbads rrrksuw||D$''H}t s7||a  ! ) )"&# 6 6C CKC%2 &)9)9$)?)?)B BF &   XtAFF4LLL <??DGGIII DmmL..//G' '>> H/ = = =DG   C g~~=vsKKK Krc#K|jD]}|V|jD]G}t|tr|Vt|trt |D]}|VHdS)zBYield names and strings used by `code` and its nested code objectsN)co_names co_constsr_strrr)rrconsts rrrs   eS ! ! KKKK x ( ( $U++   rctjdstjdkrdStjdtjddS)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.py)rplatformrcrrrrrrrse < " "6 * *s|u/D/DtH @AAAHIJJJJJr)r[rrX install_baseTr'cddl}ttj|t jd|fd}|r|jn|j}sP| |||} tD]\} } } || | | | n#tD]\} } } |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 itcX|D]}tjtj||}tj|rG|t dzd}s|||tjd|dS)NrWz adding '%s') rrrrMrrar,rr)zrwnamesrrr5base_dirrps rvisitzmake_zipfile..visits , ,D7##BGLL$$?$?@@Dw~~d## ,X*++,%GGD!$$$ -+++  , ,r) compression) zipfilerrrrwrrf ZIP_DEFLATED ZIP_STOREDZipFiler%r) zip_filenamerrrpcompressrrrrrrwr#r$s ` ` rrrsNNN 27??< ( ('::::H 2L(KKK,,,,,,+3J'&&8JK ( OOL$KO H H$/$9$9 % % GT5 E!We $ $ $ $  $/$9$9 ( ( GT5 E$ ' ' ' ' r)rrTr')+__doc__distutils.dir_utilrr distutilsrtypesrrrrr(r pkg_resourcesrrsetuptools.extensionr setuptoolsr _pathr sysconfigr rrrr%r1r3rrsplitrrrrrrrrrqrrrrr's32222222 ::::::::(((((($$$$$$22222222    + + + y(y(y(y(y(y(y(y(xMM"8">">"@"@AA$      D   JJJ IMr