U lÏ aæGã@s„dZddlmZddlmZmZddlmZddlm Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlmZddlmZmZmZdd lmZdd lmZdd lmZmZzdd lmZmZd d„ZWn,e k røddl!m"Z"mZdd„ZYnXdd„Z#dd„Z$dd„Z%Gdd„deƒZ&e' (d )¡¡Z*dd„Z+dd„Z,dd„Z-d d!d"œZ.d#d$„Z/d%d&„Z0d'd(„Z1d)d*d+d,gZ2d1d/d0„Z3dS)2z6setuptools.command.bdist_egg Build .egg distributionsé)ÚDistutilsSetupError)Ú remove_treeÚmkpath)Úlog)ÚCodeTypeN)Úsix)Úget_build_platformÚ DistributionÚensure_directory)Ú EntryPoint)ÚLibrary)ÚCommandÚSetuptoolsDeprecationWarning)Úget_pathÚget_python_versioncCstdƒS)NÚpurelib)r©rrú]C:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-wx4infiz\setuptools\command\bdist_egg.pyÚ _get_purelibsr)Úget_python_librcCstdƒS)NF)rrrrrr scCs2d|krtj |¡d}| d¡r.|dd…}|S)NÚ.rÚmoduleiúÿÿÿ)ÚosÚpathÚsplitextÚendswith)ÚfilenamerrrÚ strip_module$s   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,sr$c Cs6t d¡ ¡}t|dƒ}| ||¡W5QRXdS)NaR def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, %r) __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__() Úw)ÚtextwrapÚdedentÚlstripÚopenÚwrite)ÚresourceÚpyfileZ_stub_templateÚfrrrÚ write_stub6s r.c@sŽeZdZdZddddeƒfdddd gZd d d gZd d„Zdd„Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd „Zd!d"„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)r3r6r2cCs.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_options[szbdist_egg.initialize_optionscCs¨| d¡}|_|j|_|jdkr>| d¡j}tj |d¡|_|jdkrPt ƒ|_|  dd¡|j dkr¤t dd|j |jtƒ|j ¡o†|jƒ  ¡}tj |j|d¡|_ dS)NÚegg_infoÚbdistZegg)r:r:z.egg)Úget_finalized_commandÚei_cmdrAr7Ú bdist_baserrÚjoinr8rÚset_undefined_optionsr<r Úegg_nameZ egg_versionrÚ distributionÚhas_ext_modulesr:)r?rDrEÚbasenamerrrÚfinalize_optionsds$     ý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¡|jddddW5||j_ XdS)NÚinstallérézinstalling package data to %sÚ install_data)ÚforceÚroot)r7rCÚ install_librrÚnormcaseÚrealpathrrIÚ data_filesÚ isinstanceÚtupleÚlenÚisabsÚ startswithÚsepÚappendrÚinfoÚ call_command)r?Ú site_packagesÚoldÚitemrUÚ normalizedrrrÚdo_install_data|s"  ÿzbdist_egg.do_install_datacCs|jgS)N)r<r>rrrÚ get_outputs•szbdist_egg.get_outputscKsPtD]}| ||j¡q| d|j¡| d|j¡|j|f|Ž}| |¡|S)z8Invoke reinitialized command `cmdname` with keyword argsr;Údry_run)ÚINSTALL_DIRECTORY_ATTRSÚ setdefaultr7r;rfÚ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])rr^Úwalk_eggr7rrrFrÚdebugr…ÚreÚmatchÚpardirÚgroupÚremoveÚOSErrorÚrename) r?r!r"r#r“rZpath_oldÚpatternÚmZpath_newrrrrŠós4       ÿÿÿzbdist_egg.zap_pyfilescCs2t|jddƒ}|dk r|St d¡t|j|jƒS)Nr‡z4zip_safe flag not set; analyzing archive contents...)rrIrr‰Ú analyze_eggr7r~)r?Úsaferrrr‡ s  zbdist_egg.zip_safec CsÖt |jjpd¡}| di¡ d¡}|dkr0dSt dt¡|jrH|j rVt d|fƒ‚dj t j Ž}|j}d |j¡}|jd }tj |j¡}d tƒ}|jsÒttj |j¡|jd t|jdƒ} |  |¡|  ¡d S) NÚzsetuptools.installationZ eggsecutabler%zEEggsecutables are deprecated and will be removed in a future version.zGeggsecutable entry point (%r) cannot have 'extras' or refer to a modulez{}.{}rraH#!/bin/sh if [ `basename $0` = "%(basename)s" ] then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@" else echo $0 is not the correct name for this egg file. echo Please rename it back to %(basename)s and try again. exec false fi rzÚa)r Ú parse_maprIÚ entry_pointsÚgetÚwarningsr‰rÚattrsÚextrasrÚformatÚsysÚ version_infoÚ module_namerFrrrKr<Úlocalsrfrrlr)r*rƒ) r?ZepmÚepÚpyverÚpkgÚfullr!rKÚheaderr-rrrrŒs8ý ÿÿ    ô  zbdist_egg.gen_headercCshtj |j¡}tj |d¡}|jjjD]<}| |¡r&tj ||t |ƒd…¡}t |ƒ|  ||¡q&dS)z*Copy metadata (egg info) to the target_dirr¢N) rrÚnormpathrArFrDÚfilelistr#r[rYr Ú copy_file)r?Ú target_dirZ norm_egg_infoÚprefixrÚtargetrrrr‚As zbdist_egg.copy_metadata_toc Csg}g}|jdi}t|jƒD]f\}}}|D].}tj |¡d ¡tkr*| |||¡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¢rOrqÚ build_extzdl-)r7r$rrrÚlowerÚNATIVE_EXTENSIONSr]rFrIrJrCÚ extensionsrWr Zget_ext_fullnamer“Zget_ext_filenamerKr[rˆ) r?rŽrÚpathsr!r"r#rZ build_cmdrÚfullnamerrrr}Ms0 ÿÿ       zbdist_egg.get_ext_outputsN)Ú__name__Ú __module__Ú __qualname__Ú descriptionrÚ user_optionsÚboolean_optionsr@rLrdrer_r‘rŠr‡rŒr‚r}rrrrr/Ds2ÿôÿ  Q- r/z.dll .so .dylib .pydccsHt|ƒ}t|ƒ\}}}d|kr(| d¡|||fV|D] }|Vq8dS)z@Walk an unpacked egg's contents, skipping the metadata directoryrrN)r$Únextr›)Úegg_dirÚwalkerr!r"r#Zbdfrrrr•ms  r•c Cs t ¡D](\}}tj tj |d|¡¡r|Sqtƒst|ƒ|krzt |¡q|dk rt|ƒ|krt|dƒ}|  d¡|  ¡qdS)Nrvrw) rÉrÊrrrFrˆÚboolr…r)r*rƒ)rÇr¡rÍrÎr-rrrr†Šs    r†zzip-safez not-zip-safe)TFc Cstj ||¡}|dd…|kr"dS|t|ƒdd… tjd¡}||rJdpLdtj |¡d}tjrld}nt j d kr|d }nd }t |d ƒ}|  |¡t  |¡} | ¡d} t t| ƒ¡} d D]} | | kr¼t d|| ¡d} q¼d| kr dD]} | | krêt d|| ¡d} qê| S)z;Check whether module possibly uses unsafe-for-zipfile stuffNéÿÿÿÿTrOrr¢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)rrrFrYr€r\rrÚPY2r«r¬r)ÚreadÚmarshalÚloadrƒÚdictÚfromkeysÚ iter_symbolsrr‰) rÇr!r“r~rr±rÚskipr-Úcoder¡ÚsymbolsÚbadrrrrÌs4      rÌccsT|jD] }|Vq|jD]6}t|tjƒr0|Vqt|tƒrt|ƒD] }|VqBqdS)zBYield names and strings used by `code` and its nested code objectsN)Úco_namesÚ co_constsrWrÚ string_typesrrê)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«Úplatformr[rr‰rrrrrËÍs rËrSrurPÚ 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. rNrzz#creating '%s' and adding '%s' to itcs`|D]V}tj tj ||¡¡}tj |¡r|tˆƒdd…}ˆsN| ||¡t d|¡qdS)NrOz adding '%s') rrr´rFr„rYr*rr–)ÚzrlÚnamesr“rr1©Úbase_dirrfrrÚvisitës  zmake_zipfile..visit)Ú compression) Úzipfilerrrrlrr^Ú ZIP_DEFLATEDÚ ZIP_STOREDÚZipFiler$rƒ) Ú zip_filenamerúrxrfÚcompressryrýrûrür÷rlr"r#rrùrr‹Þs  r‹)rrTr%)4Ú__doc__Údistutils.errorsrÚdistutils.dir_utilrrÚ distutilsrÚtypesrr«rr—r&rær§Zsetuptools.externrÚ pkg_resourcesrr r r Zsetuptools.extensionr Ú setuptoolsr rÚ sysconfigrrrÚ ImportErrorÚdistutils.sysconfigrrr$r.r/rèréÚsplitr¼r•r r†rÉrÌrêrËrgr‹rrrrÚsZ        ( þ$  ÿÿ