U Ù üe÷bã@sÎdZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZmZmZmZm Z m!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„Z0dd„Z1d d!„Z2d"d#„Z3d$d%„Z4d&d'„Z5d(d)„Z6d3d+d,„Z7d-d.„Z8d/d0„Z9Gd1d2„d2e*ƒZ:dS)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úI/opt/hc_python/lib/python3.8/site-packages/setuptools/command/egg_info.pyÚtranslate_pattern#sV           r6c@s@eZdZdZdZedd„ƒZdd„Zdd„Zdd „Z ee ƒZ dS) Ú InfoCommonNcCst|j ¡ƒS©N)r Ú distributionÚget_name©Úselfr4r4r5ÚnamezszInfoCommon.namecCst| |j ¡¡ƒSr8)rÚ _maybe_tagr9Ú get_versionr;r4r4r5Útagged_version~szInfoCommon.tagged_versioncCs |jr| |j¡r|S||jS)z egg_info may be called more than once for a distribution, in which case the version string already contains all tags. )ÚvtagsÚendswith©r<Úversionr4r4r5r>sþzInfoCommon._maybe_tagcCs,d}|jr||j7}|jr(|t d¡7}|S)Nrz-%Y%m%d)Ú tag_buildÚtag_dateÚtimeÚstrftimerCr4r4r5Útags‹s  zInfoCommon.tags) Ú__name__Ú __module__Ú __qualname__rErFÚpropertyr=r@r>rIrAr4r4r4r5r7vs  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]rPrScCs"d|_d|_d|_d|_d|_dS)NF)Úegg_baseÚegg_namerNÚ egg_versionÚbroken_egg_infor;r4r4r5Úinitialize_options¥s zegg_info.initialize_optionscCsdSr8r4r;r4r4r5Útag_svn_revision¯szegg_info.tag_svn_revisioncCsdSr8r4)r<Úvaluer4r4r5rZ³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. rErrF)rNN)Ú collectionsÚ OrderedDictrIr Údict)r<ÚfilenamerNr4r4r5Ú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-%srrUú .egg-infoú-)!r=rVr@rWr Ú isinstancerrDÚVersionÚlistr Ú ValueErrorÚ distutilsÚerrorsÚDistutilsOptionErrorrUr9Ú package_dirÚgetr!ÚcurdirÚensure_dirnamerrNr"ÚjoinÚcheck_broken_egg_infoÚmetadataZ _patched_distÚkeyÚlowerÚ_versionÚ_parsed_version)r<Úparsed_versionZ is_versionÚspecrOÚ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Úfr4r4r5rz s    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)ÚmkpathrNr!Úutimer9Zfetch_build_eggrÚrequireÚresolver=r"rnr{r}Ú 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"rnrNÚmanifest_makerr9Úmanifestr•Úfilelist)r<Zmanifest_filenameÚmmr4r4r5r‘-s  zegg_info.find_sourcescCsT|jd}|jtjkr&tj |j|¡}tj |¡rPt d||j ¡|j |_ ||_ dS)NraaB------------------------------------------------------------------------------ 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. ------------------------------------------------------------------------------) rVrUr!rlr"rnr{rr|rNrX)r<Zbeir4r4r5ro5s   ûzegg_info.check_broken_egg_infoN)F)rJrKrLÚ descriptionÚ user_optionsÚboolean_optionsÚ negative_optrYrMrZÚsetterr`ryrrzr}r•r‘ror4r4r4r5rN•s.ûÿ    1  rNc@s|eZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)rc Cs | |¡\}}}}|j|j|j|jt |j|¡t |j|¡|j |j dœ}dddddddd dœ}z ||}Wn$t k rŽt d j |d ƒ‚YnX| d ¡} |d kr¨|g}| r²|fnd} ||} | d |g| rÔ|gng|¡¡|D]} || ƒsætj| | f| žŽqædS)N)ÚincludeÚexcludezglobal-includezglobal-excludezrecursive-includezrecursive-excludeÚgraftÚprunez%warning: no files found matching '%s'z9warning: no previously-included files found matching '%s'z>warning: no files found matching '%s' anywhere in distributionzRwarning: no previously-included files matching '%s' found anywhere in distributionz:warning: no files found matching '%s' under directory '%s'zNwarning: no previously-included files matching '%s' found under directory '%s'z+warning: no directories found matching '%s'z6no previously-included directories found matching '%s'z/this cannot happen: invalid action '{action!s}')Úactionz recursive->r¡r¢r4ú )Z_parse_template_linerŸr Úglobal_includeÚglobal_excludeÚ functoolsÚpartialÚrecursive_includeÚrecursive_excluder¡r¢ÚKeyErrorrÚformatÚ startswithÚ debug_printrnrr|) r<Úliner£ÚpatternsÚdirZ dir_patternZ action_mapZlog_mapZprocess_actionZaction_is_recursiveZextra_log_argsZlog_tmplÚpatternr4r4r5Úprocess_template_lineHsdÿÿôé ÿÿ  ÿþÿÿ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"rnrrÀ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"rnr¹rÃ)r<r±r²rÃr4r4r5rª·szFileList.recursive_excludecCs$dd„t|ƒDƒ}| |¡t|ƒS)zInclude all files from 'dir/'.cSs"g|]}tj |¡D]}|‘qqSr4)rgr˜Ú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"rnrÀ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´)rBrÚ _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)rerÎ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 -- skippingFr‚T) Ú unicode_utilsÚfilesys_decoderr|Z try_encoder!r"r{ÚUnicodeEncodeErrorÚsysÚgetfilesystemencoding)r<r"Zenc_warnZu_pathZ utf8_pathr4r4r5rÌõs   zFileList._safe_pathN)rJrKrLr³r¹rŸr r©rªr¡r¢r¥r¦rÍrÀrÐrÌr4r4r4r5rEsM     rc@sdeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z e dd„ƒZ dd„Z dd„Z dd„ZdS)r–z MANIFEST.incCsd|_d|_d|_d|_dS)Nr)Z use_defaultsr¢Z manifest_onlyZforce_manifestr;r4r4r5rYsz!manifest_maker.initialize_optionscCsdSr8r4r;r4r4r5ryszmanifest_maker.finalize_optionscCsltƒ|_tj |j¡s| ¡| ¡tj |j¡r<|  ¡|  ¡|  ¡|j  ¡|j  ¡| ¡dSr8)rr˜r!r"r{r—Úwrite_manifestÚ add_defaultsÚtemplateZ read_templateÚadd_license_filesÚprune_file_listÚsortZremove_duplicatesr;r4r4r5r•s  zmanifest_maker.runcCst |¡}| tjd¡S)Nú/)rÑrÒÚreplacer!r#)r<r"r4r4r5Ú_manifest_normalize&s 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¾2sz1manifest_maker.write_manifest..zwriting manifest file '%s'N)r˜rÐr¶r—Úexecuterz)r<r¶Úmsgr4r;r5rÖ*s  zmanifest_maker.write_manifestcCs| |¡st ||¡dSr8)Ú_should_suppress_warningrr|)r<ràr4r4r5r|6s 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ƒƒ}|rB|j |¡nt j   |j¡rX|  ¡t j   d¡rp|j d¡|  d¡}|j |j¡dS)Nzsetup.pyrN)rr×r˜rÍrØr—rerrÀr!r"r{Z read_manifestÚget_finalized_commandr¡rN)r<ZrcfilesZei_cmdr4r4r5r×As     zmanifest_maker.add_defaultscCs4|jjjp g}|D]}t d|¡q|j |¡dS)Nzadding license file '%s')r9rpÚ license_filesrr„r˜rÀ)r<rãÚlfr4r4r5rÙSs  z manifest_maker.add_license_filescCsZ| 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ÚZs    ÿzmanifest_maker.prune_file_listN)rJrKrLrØrYryr•rÞrÖr|Ú staticmethodrár×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. Ú r‚rƒN)rnr…r‡rˆ)r_ÚcontentsrŠr4r4r5rzds   rzc Cs|t d|¡|jsx|jj}|j|j|_}|j|j|_}z|  |j ¡W5|||_|_Xt |jddƒ}t   |j |¡dS)Nz writing %sZzip_safe)rr„r†r9rprWrDrVr=Úwrite_pkg_inforNÚgetattrr Zwrite_safety_flag)ÚcmdÚbasenamer_rpZoldverZoldnameÚsafer4r4r5rìqs 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"r{rr|©rîrïr_r4r4r5Úwarn_depends_obsolete„s ÿròcCs,t|pdƒ}dd„}t||ƒ}| |¡dS)Nr4cSs|dS)Nrêr4)r¯r4r4r5Ú append_crsz&_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ˆr¬ÚvarsrÚgetvalue)rîrïr_ÚdistrrýÚextrar4r4r5Úwrite_requirements•s   rcCs,t ¡}t||jjƒ| d|| ¡¡dS)Nzsetup-requirements)rûrürùr9Zsetup_requiresrr)rîrïr_rr4r4r5Úwrite_setup_requirements srcCs: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_namesrzrnrþ)rîrïr_Úpkgsr4r4r5Úwrite_toplevel_names¦s þÿr cCst|||dƒdS)NT)Ú write_argrñr4r4r5Ú overwrite_arg°sr FcCsHtj |¡d}t|j|dƒ}|dk r4d |¡d}| ||||¡dS)Nrrê)r!r"Úsplitextrír9rnr)rîrïr_r€Úargnamer[r4r4r5r ´s r cCs |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) r9Z entry_pointsrcÚstrrþÚitemsrÚ parse_grouprnrôÚvaluesrÍr)rîrïr_r’rÚsectionrër4r4r5Ú write_entries¼s   rc 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"r{rû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)rJrKrLÚ__doc__r4r4r4r5rÝsr)F);rÚdistutils.filelistrZ _FileListÚdistutils.errorsrÚdistutils.utilrrgrr§r!r$rÔrûrrGr\Ú setuptoolsrZsetuptools.command.sdistrrZsetuptools.command.setoptr Zsetuptools.commandr Ú pkg_resourcesr r r rrrrrZsetuptools.unicode_utilsrÑZsetuptools.globrZsetuptools.externrrr6r7rNr–rzrìròrùrrr r r rrrr4r4r4r5ÚsV         (    S1IW