a (šReÜ@ã@sdZddlmZmZddlmZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl mZmZmZddlmZddlmZdd lmZmZd d „Zd d „Zdd„Zdd„ZGdd„deƒZe d ¡¡Z dd„Z!dd„Z"dd„Z#dddœZ$dd„Z%d d!„Z&d"d#„Z'gd$¢Z(d)d'd(„Z)dS)*z6setuptools.command.bdist_egg Build .egg distributionsé)Ú remove_treeÚmkpath)Úlog)ÚCodeTypeN)Úget_build_platformÚ DistributionÚensure_directory)ÚLibrary)ÚCommand)Úget_pathÚget_python_versioncCstdƒS)NÚpurelib)r ©rrú’/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/bdist_egg.pyÚ _get_purelibsrcCs2d|vrtj |¡d}| d¡r.|dd…}|S)NÚ.rÚmoduleiúÿÿÿ)ÚosÚpathÚsplitextÚendswith)ÚfilenamerrrÚ strip_modules   rccs6t |¡D]&\}}}| ¡| ¡|||fVq dS)zbDo os.walk in a reproducible way, independent of indeterministic filesystem readdir order N)rÚwalkÚsort)ÚdirÚbaseÚdirsÚfilesrrrÚ sorted_walk!srcCsJt d¡ ¡}t|dƒ}| ||¡Wdƒn1s<0YdS)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)ÚtextwrapÚdedentÚlstripÚopenÚwrite)ÚresourceÚpyfileZ_stub_templateÚfrrrÚ write_stub+s r)c@sŒeZdZdZddddeƒfdddd gZgd ¢Zd d „Zd d„Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd „Zd!S)"Ú 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-tempÚkzPkeep 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))r.r1r-cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)Ú bdist_dirÚ plat_nameÚ keep_tempÚdist_dirÚ skip_buildÚ egg_outputÚexclude_source_files©ÚselfrrrÚinitialize_optionsRszbdist_egg.initialize_optionscCs¨| d¡}|_|j|_|jdur>| d¡j}tj |d¡|_|jdurPt ƒ|_|  dd¡|j dur¤t dd|j |jtƒ|j ¡o†|jƒ  ¡}tj |j|d¡|_ dS)NÚegg_infoÚbdistÚegg)r5r5z.egg)Úget_finalized_commandÚei_cmdr<r2Ú bdist_baserrÚjoinr3rÚset_undefined_optionsr7rÚegg_nameZ egg_versionr Ú distributionÚhas_ext_modulesr5)r:r@rAÚbasenamerrrÚfinalize_options[s      ýzbdist_egg.finalize_optionscCsþ|j| d¡_tj tj tƒ¡¡}|jj g}|j_ |D]ˆ}t |t ƒr´t |ƒdkr´tj  |d¡r´tj |d¡}tj |¡}||ks˜| |tj¡r´|t |ƒdd…|df}|jj  |¡q:z*t d|j¡|jddddW||j_ n ||j_ 0dS)NÚinstallérézinstalling package data to %sÚ install_data)ÚforceÚroot)r2r?Ú install_librrÚnormcaseÚrealpathrrEÚ data_filesÚ isinstanceÚtupleÚlenÚisabsÚ startswithÚsepÚappendrÚinfoÚ call_command)r:Ú site_packagesÚoldÚitemrQÚ normalizedrrrÚdo_install_datass"  ÿzbdist_egg.do_install_datacCs|jgS)N)r7r9rrrÚ get_outputsŒszbdist_egg.get_outputscKsTtD]}| ||j¡q| d|j¡| d|j¡|j|fi|¤Ž}| |¡|S)z8Invoke reinitialized command `cmdname` with keyword argsr6Údry_run)ÚINSTALL_DIRECTORY_ATTRSÚ setdefaultr2r6rbÚreinitialize_commandÚ run_command)r:ZcmdnameÚkwÚdirnameÚcmdrrrr[s zbdist_egg.call_commandcCs¢| d¡t d|j¡| d¡}|j}d|_|j ¡rH|jsH| d¡|j ddd}||_|  ¡\}}g|_ g}t |ƒD]|\}}t j |¡\} } t j |jt| ƒd¡} |j  | ¡t d |¡|jsÚtt j |¡| ƒ| | ¡| t jd ¡||<qz|r| |¡|jjr| ¡|j} t j | d ¡} | | ¡|jjrlt j | d ¡}t d |¡|j d|dd| | ¡t j | d¡}|rÔt d|¡|jst|ƒt|dƒ}|  d |¡¡|  d¡| !¡n,t j "|¡rt d|¡|jst  #|¡t$t j | d ¡| %¡ƒt j &t j |j'd¡¡r.+)\.(?P[^.]+)\.pycÚnameú.pyczRenaming file from [%s] to [%s])rrZÚwalk_eggr2rrrBrÚdebugrÚreÚmatchÚpardirÚgroupÚremoveÚOSErrorÚrename) r:rrrrrZpath_oldÚpatternÚmZpath_newrrrr†ês0      ÿÿÿ zbdist_egg.zap_pyfilescCs2t|jddƒ}|dur|St d¡t|j|jƒS)Nrƒz4zip_safe flag not set; analyzing archive contents...)r‰rErr…Ú analyze_eggr2rz)r:Úsaferrrrƒs  zbdist_egg.zip_safecCsdS)Nr rr9rrrrˆ szbdist_egg.gen_headercCshtj |j¡}tj |d¡}|jjjD]<}| |¡r&tj ||t |ƒd…¡}t |ƒ|  ||¡q&dS)z*Copy metadata (egg info) to the target_dirÚN) rrÚnormpathr<rBr@ÚfilelistrrWrUrÚ copy_file)r:Ú target_dirZ norm_egg_infoÚprefixrÚtargetrrrr~s zbdist_egg.copy_metadata_toc Csg}g}|jdi}t|jƒD]f\}}}|D].}tj |¡d ¡tvr*| |||¡q*|D]"}|||d|tj ||¡<q^q|j   ¡rú|  d¡}|j D]Z} t | tƒr®qž| | j¡} | | ¡}tj |¡ d¡sžtj tj |j|¡¡rž| |¡qž||fS)zAGet a list of relative paths to C extensions in the output distroržrKrmÚ build_extzdl-)r2rrrrÚlowerÚNATIVE_EXTENSIONSrYrBrErFr?Ú extensionsrSr Zget_ext_fullnamerZget_ext_filenamerGrWr„) r:rŠr‹ÚpathsrrrrZ build_cmdrŒÚfullnamerrrrys0 ÿÿ       zbdist_egg.get_ext_outputsN)Ú__name__Ú __module__Ú __qualname__Ú descriptionrÚ user_optionsÚboolean_optionsr;rHr`rar[rr†rƒrˆr~ryrrrrr*;s,ÿô  Q r*z.dll .so .dylib .pydccsHt|ƒ}t|ƒ\}}}d|vr(| d¡|||fV|D] }|Vq8dS)z@Walk an unpacked egg's contents, skipping the metadata directoryrnN)rÚnextr—)Úegg_dirÚwalkerrrrZbdfrrrr‘:s  r‘c Cs t ¡D](\}}tj tj |d|¡¡r|Sqtƒst|ƒ|krzt |¡q|durt|ƒ|krt|dƒ}|  d¡|  ¡qdS)Nrrrs) r´rµrrrBr„Úboolrr$r%r)r²rr¸r¹r(rrrr‚Ws    r‚zzip-safez not-zip-safe)TFc Cstj ||¡}|dd…|vr"dS|t|ƒdd… tjd¡}||rJdpLdtj |¡d}tjdkrpd }nd }t |d ƒ}|  |¡t   |¡} |  ¡d} t t| ƒ¡} d D]} | | vr°t d || ¡d} q°d| vrüdD]} | | vrÜt d|| ¡d} qÜ| S)z;Check whether module possibly uses unsafe-for-zipfile stuffNéÿÿÿÿTrKrržr)ééé éÚrb)Ú__file__Ú__path__z%s: module references %sFÚinspect) Ú getsourceÚ getabsfileÚ getsourcefileZgetfilegetsourcelinesÚ findsourceÚ getcommentsÚ getframeinfoÚgetinnerframesÚgetouterframesÚstackÚtracez"%s: module MAY be using inspect.%s)rrrBrUr|rXrÚsysÚ version_infor$ÚreadÚmarshalÚloadrÚdictÚfromkeysÚ iter_symbolsrr…) r²rrrzrÚpkgrÚskipr(ÚcoderÚsymbolsÚbadrrrr·js0     r·ccsR|jD] }|Vq|jD]4}t|tƒr.|Vqt|tƒrt|ƒD] }|Vq@qdS)zBYield names and strings used by `code` and its nested code objectsN)Úco_namesÚ co_constsrSÚstrrrÕ)rØrÚconstrrrrÕŒs     rÕcCs2tj d¡stjdkrdSt d¡t d¡dS)NÚjavaÚcliTz1Unable 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)rÎÚplatformrWrr…rrrrr¶˜s r¶)rOrqrLÚ install_baseTr c sªddl}ttj |¡ˆdt d|ˆ¡‡‡fdd„}|rB|jn|j}ˆs†|j |||d} t ˆƒD]\} } } || | | ƒqd|   ¡n t ˆƒD]\} } } |d| | ƒqŽ|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. rNrvz#creating '%s' and adding '%s' to itcs`|D]V}tj tj ||¡¡}tj |¡r|tˆƒdd…}ˆsN| ||¡t d|¡qdS)NrKz adding '%s') rrrŸrBr€rUr%rr’)ÚzrhÚnamesrrr,©Úbase_dirrbrrÚvisit¶s  zmake_zipfile..visit)Ú compression) ÚzipfilerrrrhrrZÚ ZIP_DEFLATEDÚ ZIP_STOREDÚZipFilerr) Ú zip_filenamerærtrbÚcompressrurérçrèrãrhrrrrårr‡©s  r‡)rrTr )*Ú__doc__Údistutils.dir_utilrrÚ distutilsrÚtypesrrÎrr“r!rÑÚ pkg_resourcesrrrZsetuptools.extensionr Ú setuptoolsr Ú sysconfigr r rrrr)r*rÓrÔÚsplitr§r‘rœr‚r´r·rÕr¶rcr‡rrrrÚs@     } þ"  ÿ