U Wzf_DGã@sFdZddlmZddlmZmZddlmZddlm Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlmZmZmZddlmZdd lmZdd lmZmZdd lmZmZd d „Zdd„Zdd„Zdd„Z Gdd„deƒZ!e" #d $¡¡Z%dd„Z&dd„Z'dd„Z(dddœZ)d d!„Z*d"d#„Z+d$d%„Z,d&d'd(d)gZ-d.d,d-„Z.dS)/z6setuptools.command.bdist_egg Build .egg distributionsé)ÚDistutilsSetupError)Ú remove_treeÚmkpath)Úlog)ÚCodeTypeN)Úget_build_platformÚ DistributionÚensure_directory)Ú EntryPoint)ÚLibrary)ÚCommandÚSetuptoolsDeprecationWarning)Úget_pathÚget_python_versioncCstdƒS)NÚpurelib)r©rrút/private/var/folders/n9/53xbvtmd7sjg1q1l55xmpg58n4mgng/T/pip-unpacked-wheel-slp6y8a5/setuptools/command/bdist_egg.pyÚ _get_purelibsrcCs2d|krtj |¡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$sr"c Cs6t d¡ ¡}t|dƒ}| ||¡W5QRXdS)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 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)r1r4r0cCs.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_optionsUszbdist_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)r8r8z.egg)Úget_finalized_commandÚei_cmdr?r5Ú bdist_baserrÚjoinr6rÚset_undefined_optionsr:rÚegg_nameZ egg_versionrÚ distributionÚhas_ext_modulesr8)r=rBrCÚ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¡|jddddW5||j_ XdS)NÚinstallérézinstalling package data to %sÚ install_data)ÚforceÚroot)r5rAÚ install_librrÚnormcaseÚrealpathrrGÚ data_filesÚ isinstanceÚtupleÚlenÚisabsÚ startswithÚsepÚappendrÚinfoÚ call_command)r=Ú site_packagesÚoldÚitemrSÚ normalizedrrrÚdo_install_datavs"  ÿzbdist_egg.do_install_datacCs|jgS)N)r:r<rrrÚ get_outputsszbdist_egg.get_outputscKsPtD]}| ||j¡q| d|j¡| d|j¡|j|f|Ž}| |¡|S)z8Invoke reinitialized command `cmdname` with keyword argsr9Údry_run)ÚINSTALL_DIRECTORY_ATTRSÚ setdefaultr5r9rdÚ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_eggr5rrrDrÚdebugrƒÚreÚmatchÚpardirÚgroupÚremoveÚOSErrorÚrename) r=rr 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...)r‹rGrr‡Ú analyze_eggr5r|)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 rxÚa)r Ú parse_maprGÚ entry_pointsÚgetÚwarningsr‡r ÚattrsÚextrasrÚformatÚsysÚ version_infoÚ module_namerDrrrIr:Úlocalsrdrrjr'r(r) r=ZepmÚepÚpyverÚpkgÚfullrrIÚ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Únormpathr?rDrBÚfilelistr!rYrWr Ú 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 ¡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 rMroÚ build_extzdl-)r5r"rrrÚlowerÚNATIVE_EXTENSIONSr[rDrGrHrAÚ extensionsrUr Zget_ext_fullnamer‘Zget_ext_filenamerIrYr†) r=rŒrÚpathsrr r!rZ build_cmdrŽÚfullnamerrrr{Gs0 ÿÿ       zbdist_egg.get_ext_outputsN)Ú__name__Ú __module__Ú __qualname__Ú descriptionrÚ user_optionsÚboolean_optionsr>rJrbrcr]rrˆr…rŠr€r{rrrrr->s2ÿôÿ  Q- r-z.dll .so .dylib .pydccsHt|ƒ}t|ƒ\}}}d|kr(| d¡|||fV|D] }|Vq8dS)z@Walk an unpacked egg's contents, skipping the metadata directoryrpN)r"Únextr™)Úegg_dirÚwalkerrr r!Zbdfrrrr“gs  r“c Cs t ¡D](\}}tj tj |d|¡¡r|Sqtƒst|ƒ|krzt |¡q|dk rt|ƒ|krt|dƒ}|  d¡|  ¡qdS)Nrtru) rÇrÈrrrDr†Ú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}tjdkrpd }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éÿÿÿÿTrMrr 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)rrrDrWr~rZrr©rªr'ÚreadÚmarshalÚloadrÚdictÚfromkeysÚ iter_symbolsrr‡) rÅrr‘r|rr¯rÚskipr+ÚcoderŸÚsymbolsÚbadrrrrÊ—s0     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_constsrUÚ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©ÚplatformrYrr‡rrrrrÉÅs rÉrQrsrNÚ 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. rNrxz#creating '%s' and adding '%s' to itcs`|D]V}tj tj ||¡¡}tj |¡r|tˆƒdd…}ˆsN| ||¡t d|¡qdS)NrMz adding '%s') rrr²rDr‚rWr(rr”)ÚzrjÚnamesr‘rr/©Úbase_dirrdrrÚvisitãs  zmake_zipfile..visit)Ú compression) Úzipfilerrrrjrr\Ú ZIP_DEFLATEDÚ ZIP_STOREDÚZipFiler"r) Ú zip_filenamerörvrdÚcompressrwrùr÷rørórjr r!rrõrr‰Ös  r‰)rrTr#)/Ú__doc__Údistutils.errorsrÚdistutils.dir_utilrrÚ distutilsrÚtypesrr©rr•r$râr¥Ú pkg_resourcesrrr r Zsetuptools.extensionr Ú setuptoolsr r Ú sysconfigrrrrr"r,r-räråÚsplitrºr“ržr„rÇrÊrærÉrer‰rrrrÚsP      ( þ"  ÿÿ