3 K”Reã`ã@s°dZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'j(Z(ddl)m*Z*ddl+m,Z,dd„Z-Gdd„deƒZ.Gdd„deƒZGdd„deƒZ/dd„Z0dd„Z1dd„Z2dd „Z3d!d"„Z4d#d$„Z5d%d&„Z6d'd(„Z7d0d*d+„Z8d,d-„Z9d.d/„Z:dS)1zUsetuptools.command.egg_info Create a distribution's .egg-info directory and contentsé)ÚFileList)ÚDistutilsInternalError)Ú convert_path)ÚlogN)Úsix)Úmap)Ú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)Ú packagingcCsîd}|jtjjƒ}tjtjƒ}d|f}�x¤t|ƒD�]–\}}|t|ƒdk}|dkrv|rd|d7}q4|d||f7}q4d}t|ƒ} �x:|| k�r¾||} | dkr°||d7}�n| d krÂ||7}nò| d k�r¦|d} | | krð|| d krð| d} | | k�r|| d k�r| d} x&| | k�r6|| d k�r6| d} �qW| | k�rR|tj| ƒ7}nR||d| …} d} | dd k�r„d } | dd…} | tj| ƒ7} |d| f7}| }n|tj| ƒ7}|d7}q†W|s4||7}q4W|d7}tj|tj tj Bd�S)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.*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ú‘/builddir/build/BUILDROOT/alt-python36-setuptools-38.5.2-7.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/setuptools/command/egg_info.pyÚtranslate_pattern$sV         r6c@sžeZdZdZd)d*d+d,gZdgZd diZdd„Zedd„ƒZ e j dd„ƒZ dd„Z dd„Z d-dd„Z dd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(S).Úegg_infoz+create a distribution's .egg-info directoryú egg-base=ÚeúLdirectory containing .egg-info directories (default: top of the source tree)útag-dateÚdú0Add date stamp (e.g. 20050528) to version numberú tag-build=Úbú-Specify explicit tag to add to version numberúno-dateÚDú"Don't include date stamp [default]cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrF)Úegg_nameÚ egg_versionÚegg_baser7Ú tag_buildÚtag_dateÚbroken_egg_infoÚvtags)Úselfr4r4r5Úinitialize_options‡szegg_info.initialize_optionscCsdS)Nr4)rKr4r4r5Útag_svn_revision”szegg_info.tag_svn_revisioncCsdS)Nr4)rKÚvaluer4r4r5rM˜scCs0tjƒ}|jƒ|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. rGrrH)r7N)Ú collectionsÚ OrderedDictÚtagsr Údict)rKÚfilenamer7r4r4r5Úsave_version_info�s zegg_info.save_version_infoc CsVt|jjƒƒ|_|jƒ|_|jƒ|_t|jƒ}y6t |t j j ƒ}|rFdnd}t t||j|jfƒƒWn,tk r�tjjd|j|jfƒ‚YnX|jdkr¸|jj}|pªijdtjƒ|_|jdƒt|jƒd|_|jtjkròtjj|j|jƒ|_d|jk�r|jƒ|j|jj_ |jj}|dk �rR|j |jj!ƒk�rR|j|_"t|jƒ|_#d|j_dS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrFz .egg-infoú-)$rÚ distributionÚget_namerDrQrJÚtagged_versionrErÚ isinstancerÚversionÚVersionÚlistr Ú ValueErrorÚ distutilsÚerrorsÚDistutilsOptionErrorrFÚ package_dirÚgetr!ÚcurdirÚensure_dirnamerr7r"ÚjoinÚcheck_broken_egg_infoÚmetadataZ _patched_distÚkeyÚlowerÚ_versionÚ_parsed_version)rKÚparsed_versionZ is_versionÚspecÚdirsÚpdr4r4r5Úfinalize_optionsªs8          zegg_info.finalize_optionsFcCsN|r|j|||ƒn6tjj|ƒrJ|dkr@| r@tjd||ƒdS|j|ƒ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)rKÚwhatrSÚdataÚforcer4r4r5Úwrite_or_delete_fileÙs   zegg_info.write_or_delete_filecCsDtjd||ƒtjr|jdƒ}|js@t|dƒ}|j|ƒ|jƒ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 %szutf-8ÚwbN) rÚinforÚPY3ÚencodeÚdry_runÚopenÚwriteÚclose)rKrurSrvÚfr4r4r5rqís   zegg_info.write_filecCs tjd|ƒ|jstj|ƒdS)z8Delete `filename` (if not a dry run) after announcing itz deleting %sN)rrzr}r!Úunlink)rKrSr4r4r5rtûs zegg_info.delete_filecCs2|jjƒ}|jr$|j|jƒr$t|ƒSt||jƒS)N)rVÚ get_versionrJÚendswithr)rKrZr4r4r5rXs zegg_info.tagged_versioncCsˆ|j|jƒ|jj}x@tdƒD]4}|j|d�|jƒ}|||jtj j |j|jƒƒqWtj j |jdƒ}tj j |ƒr||j |ƒ|j ƒdS)Nzegg_info.writers)Ú installerznative_libs.txt)Úmkpathr7rVZfetch_build_eggrÚrequireÚresolveÚnamer!r"rerrrtÚ find_sources)rKr…ÚepÚwriterÚnlr4r4r5Úrun s     z egg_info.runcCs,d}|jr||j7}|jr(|tjdƒ7}|S)Nrz-%Y%m%d)rGrHÚtimeÚstrftime)rKrZr4r4r5rQs  z egg_info.tagscCs4tjj|jdƒ}t|jƒ}||_|jƒ|j|_dS)z"Generate SOURCES.txt manifest filez SOURCES.txtN) r!r"rer7Úmanifest_makerrVÚmanifestrŽÚfilelist)rKZmanifest_filenameÚmmr4r4r5rŠ s  zegg_info.find_sourcescCsd|jd}|jtjkr&tjj|j|ƒ}tjj|ƒr`tjddddd||j ƒ|j |_ ||_ dS)Nz .egg-inforUéNz¦ 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. ) rDrFr!rcr"rerrrrsr7rI)rKZbeir4r4r5rf(s    zegg_info.check_broken_egg_infoN)r8r9r:)r;r<r=)r>r?r@)rArBrC)F)Ú__name__Ú __module__Ú __qualname__Ú descriptionÚ user_optionsÚboolean_optionsÚ negative_optrLÚpropertyrMÚsetterrTrprxrqrtrXrŽrQrŠrfr4r4r4r5r7ws(  / r7c@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<|j|ƒ\}}}}|dkrV|jddj|ƒƒx"|D]}|j|ƒs4tjd|ƒq4W�nâ|dkrš|jddj|ƒƒx"|D]}|j|ƒsxtjd|ƒqxW�nž|dkrÞ|jd dj|ƒƒx"|D]}|j|ƒs¼tjd |ƒq¼W�nZ|d k�r(|jd dj|ƒƒx&|D]}|j|ƒ�stjd |ƒ�qW�n|dk�rx|jd|dj|ƒfƒxì|D]"}|j ||ƒ�sPtjd||ƒ�qPWnÀ|dk�rÈ|jd|dj|ƒfƒxœ|D]"}|j ||ƒ�s tjd||ƒ�q Wnp|dk�rú|jd|ƒ|j |ƒ�s8tjd|ƒn>|dk�r,|jd|ƒ|j |ƒ�s8tjd|ƒ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_printrerŸrrsr¡Úglobal_includeÚglobal_excludeÚrecursive_includeÚrecursive_excluder¢r£r)rKÚlineÚactionÚpatternsÚdirZ dir_patternÚpatternr4r4r5Úprocess_template_line;sd                 zFileList.process_template_linecCsVd}xLtt|jƒdddƒD]2}||j|ƒr|jd|j|ƒ|j|=d}qW|S)z† Remove all files from the file list that match the predicate. Return True if any matching files were removed Frz removing Téÿÿÿÿr¯)Úranger'Úfilesr¤)rKÚ predicateÚfoundr0r4r4r5Ú _remove_files„szFileList._remove_filescCs$dd„t|ƒDƒ}|j|ƒt|ƒS)z#Include files that match 'pattern'.cSsg|]}tjj|ƒs|‘qSr4)r!r"Úisdir)Ú.0r�r4r4r5ú “sz$FileList.include..)rÚextendÚbool)rKr­r³r4r4r5rŸ‘s zFileList.includecCst|ƒ}|j|jƒS)z#Exclude files that match 'pattern'.)r6r´Úmatch)rKr­rºr4r4r5r¡—szFileList.excludecCs8tjj|d|ƒ}dd„t|dd�Dƒ}|j|ƒt|ƒS)zN Include all files anywhere in 'dir/' that match the pattern. z**cSsg|]}tjj|ƒs|‘qSr4)r!r"rµ)r¶r�r4r4r5r·¡sz.FileList.recursive_include..T)Ú recursive)r!r"rerr¸r¹)rKr¬r­Z full_patternr³r4r4r5r§œs zFileList.recursive_includecCs ttjj|d|ƒƒ}|j|jƒS)zM Exclude any file anywhere in 'dir/' that match the pattern. z**)r6r!r"rer´rº)rKr¬r­rºr4r4r5r¨¦szFileList.recursive_excludecCs$dd„t|ƒDƒ}|j|ƒt|ƒS)zInclude all files from 'dir/'.cSs"g|]}tjj|ƒD]}|‘qqSr4)r^r“Úfindall)r¶Z match_dirÚitemr4r4r5r·°sz"FileList.graft..)rr¸r¹)rKr¬r³r4r4r5r¢­s  zFileList.graftcCsttjj|dƒƒ}|j|jƒS)zFilter out files from 'dir/'.z**)r6r!r"rer´rº)rKr¬rºr4r4r5r£·szFileList.prunecsJ|jdkr|jƒttjjd|ƒƒ‰‡fdd„|jDƒ}|j|ƒt|ƒS)z“ Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. Nz**csg|]}ˆj|ƒr|‘qSr4)rº)r¶r�)rºr4r5r·Äsz+FileList.global_include..)Úallfilesr¼r6r!r"rer¸r¹)rKr­r³r4)rºr5r¥¼s   zFileList.global_includecCsttjjd|ƒƒ}|j|jƒS)zD Exclude all files anywhere that match the pattern. z**)r6r!r"rer´rº)rKr­rºr4r4r5r¦ÈszFileList.global_excludecCs8|jdƒr|dd…}t|ƒ}|j|ƒr4|jj|ƒdS)Nú rr¯)r„rÚ _safe_pathr±Úappend)rKr½r"r4r4r5rÁÏs    zFileList.appendcCs|jjt|j|ƒƒdS)N)r±r¸ÚfilterrÀ)rKÚ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)r\rÂrÀr±)rKr4r4r5Ú_repairÚszFileList._repairc Csšd}tj|ƒ}|dkr(tjd|ƒdStj|dƒ}|dkrNtj||dƒdSy tjj|ƒshtjj|ƒrldSWn&tk r”tj||t j ƒƒYnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFzutf-8T) Ú unicode_utilsÚfilesys_decoderrsZ try_encoder!r"rrÚUnicodeEncodeErrorÚsysÚgetfilesystemencoding)rKr"Zenc_warnZu_pathZ utf8_pathr4r4r5rÀäs  zFileList._safe_pathN)r–r—r˜r®r´rŸr¡r§r¨r¢r£r¥r¦rÁr¸rÄrÀr4r4r4r5r8sI     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_manifest)rKr4r4r5rLÿsz!manifest_maker.initialize_optionscCsdS)Nr4)rKr4r4r5rpszmanifest_maker.finalize_optionscCsdtƒ|_tjj|jƒs|jƒ|jƒtjj|jƒr<|j ƒ|j ƒ|jj ƒ|jj ƒ|jƒdS)N) rr“r!r"rrr’Úwrite_manifestÚ add_defaultsÚtemplateZ read_templateÚprune_file_listÚsortZremove_duplicates)rKr4r4r5rŽs  zmanifest_maker.runcCstj|ƒ}|jtjdƒS)Nú/)rÅrÆÚreplacer!r#)rKr"r4r4r5Ú_manifest_normalizes z"manifest_maker._manifest_normalizecsBˆjjƒ‡fdd„ˆjjDƒ}dˆj}ˆjtˆj|f|ƒdS)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. csg|]}ˆj|ƒ‘qSr4)rÑ)r¶r�)rKr4r5r· sz1manifest_maker.write_manifest..zwriting manifest file '%s'N)r“rÄr±r’Úexecuterq)rKr±Úmsgr4)rKr5rÊs  zmanifest_maker.write_manifestcCs|j|ƒstj||ƒdS)N)Ú_should_suppress_warningr rs)rKrÓr4r4r5rs$s zmanifest_maker.warncCs tjd|ƒS)z; suppress missing-file warnings from sdist zstandard file .*not found)r$rº)rÓr4r4r5rÔ(sz'manifest_maker._should_suppress_warningcCsttj|ƒ|jj|jƒ|jj|jƒttƒƒ}|rB|jj|ƒnt j j |jƒrX|j ƒ|j dƒ}|jj|jƒdS)Nr7)r rËr“rÁrÌr’r\r r¸r!r"rrZ read_manifestÚget_finalized_commandr¢r7)rKZrcfilesZei_cmdr4r4r5rË/s   zmanifest_maker.add_defaultscCsZ|jdƒ}|jjƒ}|jj|jƒ|jj|ƒtjtj ƒ}|jj d|d|dd�dS)NÚbuildz(^|z)(RCS|CVS|\.svn)r)Zis_regex) rÕrVÚ get_fullnamer“r£Ú build_baser$r%r!r#Zexclude_pattern)rKrÖÚbase_dirr#r4r4r5rÍ;s    zmanifest_maker.prune_file_listN)r–r—r˜rÌrLrprŽrÑrÊrsÚ staticmethodrÔrËrÍr4r4r4r5r‘üs    r‘c Cs8dj|ƒ}|jdƒ}t|dƒ�}|j|ƒWdQRXdS)z{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. Ú zutf-8ryN)rer|r~r)rSÚcontentsr�r4r4r5rqEs   rqc Cs|tjd|ƒ|jsx|jj}|j|j|_}|j|j|_}z|j |j ƒWd|||_|_Xt |jddƒ}t j |j |ƒdS)Nz writing %sZzip_safe)rrzr}rVrgrErZrDr‰Úwrite_pkg_infor7Úgetattrr Zwrite_safety_flag)ÚcmdÚbasenamerSrgZoldverZoldnameÚsafer4r4r5rÝRs rÝcCstjj|ƒrtjdƒdS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.)r!r"rrrrs)rßràrSr4r4r5Úwarn_depends_obsoletees râcCs,t|pfƒ}dd„}t||ƒ}|j|ƒdS)NcSs|dS)NrÛr4)r©r4r4r5Úosz%_write_requirements..)rrÚ writelines)ÚstreamÚreqsÚlinesZ append_crr4r4r5Ú_write_requirementsms  rècCsn|j}tjƒ}t||jƒ|jp"i}x2t|ƒD]&}|jdjft ƒŽƒt|||ƒq.W|j d||j ƒƒdS)Nz [{extra}] Ú requirements) rVrÚStringIOrèZinstall_requiresÚextras_requireÚsortedrÚformatÚvarsrxÚgetvalue)rßràrSÚdistrvrëÚextrar4r4r5Úwrite_requirementsts  ròcCs,tjƒ}t||jjƒ|jd||jƒƒdS)Nzsetup-requirements)ÚiorêrèrVZsetup_requiresrxrï)rßràrSrvr4r4r5Úwrite_setup_requirementssrôcCs:tjdd„|jjƒDƒƒ}|jd|djt|ƒƒdƒdS)NcSsg|]}|jddƒd‘qS)Ú.rr)r )r¶Úkr4r4r5r·ˆsz(write_toplevel_names..ztop-level namesrÛ)rRÚfromkeysrVZiter_distribution_namesrqrerì)rßràrSÚpkgsr4r4r5Úwrite_toplevel_names…srùcCst|||dƒdS)NT)Ú write_arg)rßràrSr4r4r5Ú overwrite_arg�srûFcCsHtjj|ƒd}t|j|dƒ}|dk r4dj|ƒd}|j||||ƒdS)NrrÛ)r!r"ÚsplitextrÞrVrerx)rßràrSrwZargnamerNr4r4r5rú“s rúcCs¨|jj}t|tjƒs|dkr"|}nr|dk r”g}xZt|jƒƒD]J\}}t|tjƒsttj||ƒ}dj tt t |j ƒƒƒƒ}|j d||fƒqsR           (   SBEI