U Wzf_Rcã@sÆdZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZmZmZmZmZm Z m!Z!m"Z"ddl#m$Z$dd l%m&Z&ddl'm(Z(ddlm)Z)dd„Z*Gdd„dƒZ+Gdd„de+eƒZ,Gdd„deƒZGdd„deƒZ-dd„Z.dd„Z/dd„Z0d d!„Z1d"d#„Z2d$d%„Z3d&d'„Z4d(d)„Z5d3d+d,„Z6d-d.„Z7d/d0„Z8Gd1d2„d2e)ƒZ9dS)4zUsetuptools.command.egg_info Create a distribution's .egg-info directory and contentsé)ÚFileList)ÚDistutilsInternalError)Ú convert_path)ÚlogN)ÚCommand)Úsdist)Ú walk_revctrl)Ú edit_config)Ú bdist_egg)Úparse_requirementsÚ safe_nameÚ parse_versionÚ safe_versionÚ yield_linesÚ EntryPointÚiter_entry_pointsÚ to_filename)Úglob)Ú packaging)ÚSetuptoolsDeprecationWarningcCsÞd}| tjj¡}t tj¡}d|f}t|ƒD]Œ\}}|t|ƒdk}|dkrr|r`|d7}q0|d||f7}q0d}t|ƒ} || kr²||} | dkr¨||d7}n| d krº||7}nî| d krš|d} | | krè|| d krè| d} | | kr|| d kr| d} | | kr,|| d kr,| d} q| | krF|t | ¡7}nR||d| …} d} | dd krxd } | dd…} | t | ¡7} |d| f7}| }n|t | ¡7}|d7}q~|s0||7}q0|d7}tj|tj tj BdS)zö Translate a file path glob like '*.txt' in to a regular expression. This differs from fnmatch.translate which allows wildcards to match directory separators. It also knows about '**/' which matches any number of directories. Úz[^%s]éú**z.*z (?:%s+%s)*rÚ*ú?ú[ú!ú]ú^Nz[%s]z\Z)Úflags) ÚsplitÚosÚpathÚsepÚreÚescapeÚ enumerateÚlenÚcompileÚ MULTILINEÚDOTALL)rÚpatÚchunksr#Z valid_charÚcÚchunkÚ last_chunkÚiZ chunk_lenÚcharZinner_iÚinnerÚ char_class©r4ús/private/var/folders/n9/53xbvtmd7sjg1q1l55xmpg58n4mgng/T/pip-unpacked-wheel-slp6y8a5/setuptools/command/egg_info.pyÚtranslate_pattern"sV           r6c@s8eZdZdZdZedd„ƒZdd„Zdd„ZeeƒZ dS)Ú InfoCommonNcCst|j ¡ƒS©N)r Ú distributionÚget_name©Úselfr4r4r5ÚnameyszInfoCommon.namecCs2|j ¡}|jr$| |j¡r$t|ƒSt||jƒSr8)r9Ú get_versionÚvtagsÚendswithr©r<Úversionr4r4r5Útagged_version}s zInfoCommon.tagged_versioncCs,d}|jr||j7}|jr(|t d¡7}|S)Nrz-%Y%m%d)Ú tag_buildÚtag_dateÚtimeÚstrftimerAr4r4r5Útags…s  zInfoCommon.tags) Ú__name__Ú __module__Ú __qualname__rDrEÚpropertyr=rCrHr?r4r4r4r5r7us r7c@sŽeZdZdZddddgZdgZddiZdd „Zed d „ƒZ e j d d „ƒZ d d„Z dd„Z ddd„Z dd„Zdd„Zdd„Zdd„Zdd„ZdS) Úegg_infoz+create a distribution's .egg-info directory)z egg-base=ÚezLdirectory containing .egg-info directories (default: top of the source tree))útag-dateÚdz0Add date stamp (e.g. 20050528) to version number)z tag-build=Úbz-Specify explicit tag to add to version number)úno-dateÚDz"Don't include date stamp [default]rOrRcCs"d|_d|_d|_d|_d|_dS)NF)Úegg_baseÚegg_namerMÚ egg_versionÚbroken_egg_infor;r4r4r5Úinitialize_optionsŸs zegg_info.initialize_optionscCsdSr8r4r;r4r4r5Útag_svn_revision©szegg_info.tag_svn_revisioncCsdSr8r4)r<Úvaluer4r4r5rY­scCs0t ¡}| ¡|d<d|d<t|t|dƒdS)z³ Materialize the value of date into the build tag. Install build keys in a deterministic order to avoid arbitrary reordering on subsequent builds. rDrrE)rMN)Ú collectionsÚ OrderedDictrHr Údict)r<ÚfilenamerMr4r4r5Úsave_version_info²s zegg_info.save_version_infoc CsT|j|_| ¡|_t|jƒ}z6t|tjjƒ}|r4dnd}t t ||j|jfƒƒWn<t k rŽ}zt j  d|j|jf¡|‚W5d}~XYnX|jdkr¶|jj}|p¨i dtj¡|_| d¡t|jƒd|_|jtjkrðtj |j|j¡|_d|jkr| ¡|j|jj_|jj}|dk rP|j|j ¡krP|j|_t|jƒ|_ d|j_dS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrTú .egg-infoú-)!r=rUrCrVr Ú isinstancerrBÚVersionÚlistr Ú ValueErrorÚ distutilsÚerrorsÚDistutilsOptionErrorrTr9Ú package_dirÚgetr!ÚcurdirÚensure_dirnamerrMr"ÚjoinÚcheck_broken_egg_infoÚmetadataZ _patched_distÚkeyÚlowerÚ_versionÚ_parsed_version)r<Úparsed_versionZ is_versionÚspecrNÚdirsÚpdr4r4r5Úfinalize_options¿sB   ÿÿ ÿÿý      zegg_info.finalize_optionsFcCsL|r| |||¡n4tj |¡rH|dkr>|s>t d||¡dS| |¡dS)a¹Write `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). Nz$%s not set in setup(), but %s exists)Ú write_filer!r"ÚexistsrÚwarnÚ delete_file)r<Úwhatr^ÚdataÚforcer4r4r5Úwrite_or_delete_fileðs   ÿzegg_info.write_or_delete_filecCs>t d||¡| d¡}|js:t|dƒ}| |¡| ¡dS)zªWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. zwriting %s to %súutf-8ÚwbN)rÚinfoÚencodeÚdry_runÚopenÚwriteÚclose)r<r}r^r~Úfr4r4r5rys    zegg_info.write_filecCs t d|¡|jst |¡dS)z8Delete `filename` (if not a dry run) after announcing itz deleting %sN)rrƒr…r!Úunlink)r<r^r4r4r5r|s zegg_info.delete_filecCs’| |j¡t |jd¡|jj}tdƒD]4}|j|d| ¡}|||j tj   |j|j ¡ƒq*tj   |jd¡}tj   |¡r†|  |¡| ¡dS)Nzegg_info.writers)Ú installerznative_libs.txt)ÚmkpathrMr!Úutimer9Zfetch_build_eggrÚrequireÚresolver=r"rmrzr|Ú find_sources)r<r‹ÚepÚwriterÚnlr4r4r5Úruns     z egg_info.runcCs4tj |jd¡}t|jƒ}||_| ¡|j|_dS)z"Generate SOURCES.txt manifest filez SOURCES.txtN) r!r"rmrMÚmanifest_makerr9Úmanifestr”Úfilelist)r<Zmanifest_filenameÚmmr4r4r5r's  zegg_info.find_sourcescCsT|jd}|jtjkr&tj |j|¡}tj |¡rPt d||j ¡|j |_ ||_ dS)Nr`aB------------------------------------------------------------------------------ Note: Your current .egg-info directory has a '-' in its name; this will not work correctly with "setup.py develop". Please rename %s to %s to correct this problem. ------------------------------------------------------------------------------) rUrTr!rkr"rmrzrr{rMrW)r<Zbeir4r4r5rn/s   ûzegg_info.check_broken_egg_infoN)F)rIrJrKÚ descriptionÚ user_optionsÚboolean_optionsÚ negative_optrXrLrYÚsetterr_rxr€ryr|r”rrnr4r4r4r5rMs.ûÿ    1  rMc@s|eZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)rcCs | |¡\}}}}|dkrR| dd |¡¡|D]}| |¡s2t d|¡q2nÊ|dkr’| dd |¡¡|D]}| |¡srt d|¡qrnŠ|dkrÒ| d d |¡¡|D]}| |¡s²t d |¡q²nJ|d kr| d d |¡¡|D]}| |¡sôt d |¡qôn|dkr`| d|d |¡f¡|D]"}|  ||¡s:t d||¡q:n¼|dkr¬| d|d |¡f¡|D]"}|  ||¡s†t d||¡q†np|dkrÞ| d|¡|  |¡st d|¡n>|dkr| d|¡|  |¡st d|¡n t d|ƒ‚dS)NÚincludezinclude ú z%warning: no files found matching '%s'Úexcludezexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include z>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %sz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'Úgraftzgraft z+warning: no directories found matching '%s'Úprunezprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')Z_parse_template_lineÚ debug_printrmržrr{r Úglobal_includeÚglobal_excludeÚrecursive_includeÚrecursive_excluder¡r¢r)r<ÚlineÚactionÚpatternsÚdirZ dir_patternÚpatternr4r4r5Úprocess_template_lineBs|  ÿ  ÿ   þ   ÿþ   ÿþ   ÿ  ÿÿzFileList.process_template_linecCsRd}tt|jƒdddƒD]2}||j|ƒr| d|j|¡|j|=d}q|S)z† Remove all files from the file list that match the predicate. Return True if any matching files were removed Fréÿÿÿÿz removing T)Úranger'Úfilesr£)r<Ú predicateÚfoundr0r4r4r5Ú _remove_files‹szFileList._remove_filescCs$dd„t|ƒDƒ}| |¡t|ƒS)z#Include files that match 'pattern'.cSsg|]}tj |¡s|‘qSr4©r!r"Úisdir©Ú.0r‰r4r4r5Ú šs z$FileList.include..©rÚextendÚbool©r<r¬r²r4r4r5rž˜s zFileList.includecCst|ƒ}| |j¡S)z#Exclude files that match 'pattern'.)r6r³Úmatch©r<r¬r½r4r4r5r žszFileList.excludecCs8tj |d|¡}dd„t|ddDƒ}| |¡t|ƒS)zN Include all files anywhere in 'dir/' that match the pattern. rcSsg|]}tj |¡s|‘qSr4r´r¶r4r4r5r¸¨s ÿz.FileList.recursive_include..T)Ú recursive)r!r"rmrrºr»)r<r«r¬Z full_patternr²r4r4r5r¦£s zFileList.recursive_includecCs ttj |d|¡ƒ}| |j¡S)zM Exclude any file anywhere in 'dir/' that match the pattern. r©r6r!r"rmr³r½)r<r«r¬r½r4r4r5r§­szFileList.recursive_excludecCs$dd„t|ƒDƒ}| |¡t|ƒS)zInclude all files from 'dir/'.cSs"g|]}tj |¡D]}|‘qqSr4)rfr—Úfindall)r·Z match_dirÚitemr4r4r5r¸¶sþz"FileList.graft..r¹)r<r«r²r4r4r5r¡´s þ zFileList.graftcCsttj |d¡ƒ}| |j¡S)zFilter out files from 'dir/'.rrÀ)r<r«r½r4r4r5r¢¾szFileList.prunecsJ|jdkr| ¡ttj d|¡ƒ‰‡fdd„|jDƒ}| |¡t|ƒS)z“ Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. Nrcsg|]}ˆ |¡r|‘qSr4©r½r¶rÃr4r5r¸Ës z+FileList.global_include..)ÚallfilesrÁr6r!r"rmrºr»r¼r4rÃr5r¤Ãs   zFileList.global_includecCsttj d|¡ƒ}| |j¡S)zD Exclude all files anywhere that match the pattern. rrÀr¾r4r4r5r¥ÏszFileList.global_excludecCs8| d¡r|dd…}t|ƒ}| |¡r4|j |¡dS)Nú r®)r@rÚ _safe_pathr°Úappend)r<rÂr"r4r4r5rÇÖs    zFileList.appendcCs|j t|j|ƒ¡dSr8)r°rºÚfilterrÆ)r<Úpathsr4r4r5rºÞszFileList.extendcCstt|j|jƒƒ|_dS)zÜ Replace self.files with only safe paths Because some owners of FileList manipulate the underlying ``files`` attribute directly, this method must be called to repair those paths. N)rdrÈrÆr°r;r4r4r5Ú_repairászFileList._repairc Csœd}t |¡}|dkr(t d|¡dSt |d¡}|dkrNt ||d¡dSz"tj |¡shtj |¡rnWdSWn&tk r–t ||t   ¡¡YnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFrT) Ú unicode_utilsÚfilesys_decoderr{Z try_encoder!r"rzÚUnicodeEncodeErrorÚsysÚgetfilesystemencoding)r<r"Zenc_warnZu_pathZ utf8_pathr4r4r5rÆës   zFileList._safe_pathN)rIrJrKr­r³ržr r¦r§r¡r¢r¤r¥rÇrºrÊrÆr4r4r4r5r?sI     rc@s\eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z e dd„ƒZ dd„Z dd„Z dS)r•z MANIFEST.incCsd|_d|_d|_d|_dS)Nr)Z use_defaultsr¢Z manifest_onlyZforce_manifestr;r4r4r5rXsz!manifest_maker.initialize_optionscCsdSr8r4r;r4r4r5rx szmanifest_maker.finalize_optionscCsdtƒ|_tj |j¡s| ¡| ¡tj |j¡r<|  ¡|  ¡|j  ¡|j  ¡| ¡dSr8) rr—r!r"rzr–Úwrite_manifestÚ add_defaultsÚtemplateZ read_templateÚprune_file_listÚsortZremove_duplicatesr;r4r4r5r”s  zmanifest_maker.runcCst |¡}| tjd¡S)Nú/)rËrÌÚreplacer!r#)r<r"r4r4r5Ú_manifest_normalizes z"manifest_maker._manifest_normalizecsBˆj ¡‡fdd„ˆjjDƒ}dˆj}ˆ tˆj|f|¡dS)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. csg|]}ˆ |¡‘qSr4)r×r¶r;r4r5r¸'sz1manifest_maker.write_manifest..zwriting manifest file '%s'N)r—rÊr°r–Úexecutery)r<r°Úmsgr4r;r5rÐs  zmanifest_maker.write_manifestcCs| |¡st ||¡dSr8)Ú_should_suppress_warningrr{)r<rÙr4r4r5r{+s zmanifest_maker.warncCs t d|¡S)z; suppress missing-file warnings from sdist zstandard file .*not found)r$r½)rÙr4r4r5rÚ/sz'manifest_maker._should_suppress_warningcCs”t |¡| ¡|j |j¡|j |j¡ttƒƒ}|rJ|j  |¡nt j   |j¡r`|  ¡t j   d¡rx|j d¡| d¡}|j |j¡dS)Nzsetup.pyrM)rrÑZ check_licenser—rÇrÒr–rdrrºr!r"rzZ read_manifestÚget_finalized_commandr¡rM)r<ZrcfilesZei_cmdr4r4r5rÑ6s     zmanifest_maker.add_defaultscCsZ| d¡}|j ¡}|j |j¡|j |¡t tj ¡}|jj d|d|dddS)NÚbuildz(^|z)(RCS|CVS|\.svn)r)Zis_regex) rÛr9Ú get_fullnamer—r¢Ú build_baser$r%r!r#Zexclude_pattern)r<rÜÚbase_dirr#r4r4r5rÓIs    ÿzmanifest_maker.prune_file_listN)rIrJrKrÒrXrxr”r×rÐr{Ú staticmethodrÚrÑrÓr4r4r4r5r•s   r•c Cs8d |¡}| d¡}t|dƒ}| |¡W5QRXdS)z{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. Ú rr‚N)rmr„r†r‡)r^Úcontentsr‰r4r4r5rySs   ryc Cs|t d|¡|jsx|jj}|j|j|_}|j|j|_}z|  |j ¡W5|||_|_Xt |jddƒ}t   |j |¡dS)Nz writing %sZzip_safe)rrƒr…r9rorVrBrUr=Úwrite_pkg_inforMÚgetattrr Zwrite_safety_flag)ÚcmdÚbasenamer^roZoldverZoldnameÚsafer4r4r5rã`s rãcCstj |¡rt d¡dS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.)r!r"rzrr{©rårær^r4r4r5Úwarn_depends_obsoletess ÿrécCs,t|pdƒ}dd„}t||ƒ}| |¡dS)Nr4cSs|dS)Nrár4)r¨r4r4r5Ú append_cr~sz&_write_requirements..append_cr)rÚmapÚ writelines)ÚstreamÚreqsÚlinesrêr4r4r5Ú_write_requirements{s  rðcCsj|j}t ¡}t||jƒ|jp"i}t|ƒD]&}| djft ƒŽ¡t|||ƒq,|  d||  ¡¡dS)Nz [{extra}] Ú requirements) r9ÚioÚStringIOrðZinstall_requiresÚextras_requireÚsortedr‡ÚformatÚvarsr€Úgetvalue)rårær^Údistr~rôÚextrar4r4r5Úwrite_requirements„s   rûcCs,t ¡}t||jjƒ| d|| ¡¡dS)Nzsetup-requirements)ròrórðr9Zsetup_requiresr€rø)rårær^r~r4r4r5Úwrite_setup_requirementssrücCs:t dd„|j ¡Dƒ¡}| d|d t|ƒ¡d¡dS)NcSsg|]}| dd¡d‘qS)Ú.rr)r )r·Úkr4r4r5r¸—sÿz(write_toplevel_names..ztop-level namesrá)r]Úfromkeysr9Ziter_distribution_namesryrmrõ)rårær^Úpkgsr4r4r5Úwrite_toplevel_names•s þÿrcCst|||dƒdS)NT)Ú write_argrèr4r4r5Ú overwrite_argŸsrFcCsHtj |¡d}t|j|dƒ}|dk r4d |¡d}| ||||¡dS)Nrrá)r!r"Úsplitexträr9rmr€)rårær^rÚargnamerZr4r4r5r£s rcCs |jj}t|tƒs|dkr |}nl|dk rŒg}t| ¡ƒD]H\}}t|tƒsnt ||¡}d tt t|  ¡ƒƒ¡}|  d||f¡q8d |¡}|  d||d¡dS)Nráz [%s] %s rz entry pointsT) r9Ú entry_pointsrbÚstrrõÚitemsrÚ parse_grouprmrëÚvaluesrÇr€)rårær^r‘r~Úsectionrâr4r4r5Ú write_entries«s   r c Csjt dt¡tj d¡rft d¡>}|D]2}t  d|¡}|r(t |  d¡ƒW5QR£Sq(W5QRXdS)zd Get a -r### off of PKG-INFO Version in case this is an sdist of a subversion revision. z$get_pkg_info_revision is deprecated.zPKG-INFOzVersion:.*-r(\d+)\s*$rr) Úwarningsr{ÚEggInfoDeprecationWarningr!r"rzròr†r$r½ÚintÚgroup)r‰r¨r½r4r4r5Úget_pkg_info_revision¼sÿ   *rc@seZdZdZdS)rz?Deprecated behavior warning for EggInfo, bypassing suppression.N)rIrJrKÚ__doc__r4r4r4r5rÌsr)F):rÚdistutils.filelistrZ _FileListÚdistutils.errorsrÚdistutils.utilrrfrr!r$rÎròr rFr[Ú setuptoolsrZsetuptools.command.sdistrrZsetuptools.command.setoptr Zsetuptools.commandr Ú pkg_resourcesr r r rrrrrZsetuptools.unicode_utilsrËZsetuptools.globrZsetuptools.externrrr6r7rMr•ryrãrérðrûrürrrr rrr4r4r4r5ÚsT         (    S1EP