Re*a@sddZddlmZddlmZddlmZddlm 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,ddZ-GdddeZ.GdddeZGdddeZ/ddZ0ddZ1ddZ2dd Z3d!d"Z4d#d$Z5d%d&Z6d'd(Z7d)d*d+Z8d,d-Z9d.d/Z:dS)0zUsetuptools.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 EntryPointiter_entry_points to_filename)glob) packagingcCszd}|jtjj}tjtj}d|f}xt|D]\}}|t|dk}|dkr|r|d7}qG|d||f7}qGd}t|} x|| kr>||} | dkr||d7}nJ| d kr||7}n1| d kr|d} | | kr<|| d kr<| d} | | krb|| d krb| d} x*| | kr|| d kr| d} qeW| | kr|tj| 7}q1||d| } d} | dd krd } | dd} | tj| 7} |d| f7}| }n|tj| 7}|d7}qW|sG||7}qGW|d7}tj|dtj tj BS)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\Zflags) splitospathsepreescape enumeratelencompile MULTILINEDOTALL)rpatchunksr#Z valid_charcchunk last_chunkiZ chunk_lencharZinner_iinner char_classr4/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/egg_info.pytranslate_pattern$sV               r6c@seZdZdZd)d*d+d,gZdgZd diZddZeddZ e j ddZ ddZ ddZ dddZ ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(S)-egg_infoz+create a distribution's .egg-info directory egg-base=eLdirectory containing .egg-info directories (default: top of the source tree)tag-dated0Add date stamp (e.g. 20050528) to version number tag-build=b-Specify explicit tag to add to version numberno-dateD"Don't include date stamp [default]cCsLd|_d|_d|_d|_d|_d|_d|_d|_dS)NrF)egg_name egg_versionegg_baser7 tag_buildtag_datebroken_egg_infovtags)selfr4r4r5initialize_optionss       zegg_info.initialize_optionscCsdS)Nr4)rKr4r4r5tag_svn_revisionszegg_info.tag_svn_revisioncCsdS)Nr4)rKvaluer4r4r5rMscCsOttdt}|}|j|dr?r@)rArBrC)__name__ __module__ __qualname__ description user_optionsboolean_options negative_optrLpropertyrMsetterrUrqryrrrurYrrSrrgr4r4r4r5r7ws(       /      r7c@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)rcCs|j|\}}}}|dkrt|jddj|x|D]%}|j|sHtjd|qHWnc|dkr|jddj|x:|D]%}|j|stjd|qWn |dkr&|jd dj|x|D]%}|j|stjd |qWn|d kr|jd dj|x|D]%}|j|sStjd |qSWnX|dkr|jd|dj|fx)|D]+}|j ||stjd||qWn|dkrI|jd|dj|fx|D]+}|j ||stjd||qWn|dkr|jd||j |stjd|nO|dkr|jd||j |stjd|nt d|dS)Nincludezinclude  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_printrfrrrtrglobal_includeglobal_excluderecursive_includerecursive_excluderrr)rKlineactionpatternsdirZ dir_patternpatternr4r4r5process_template_line=sd                         zFileList.process_template_linecCsod}xbtt|jdddD]A}||j|r&|jd|j||j|=d}q&W|S)z Remove all files from the file list that match the predicate. Return True if any matching files were removed Frz removing Tr)ranger'filesr)rK predicatefoundr0r4r4r5 _remove_filess&  zFileList._remove_filescCs0ddt|D}|j|t|S)z#Include files that match 'pattern'.cSs(g|]}tjj|s|qSr4)r!r"isdir).0rr4r4r5 s z$FileList.include..)rextendbool)rKrrr4r4r5rs zFileList.includecCst|}|j|jS)z#Exclude files that match 'pattern'.)r6rmatch)rKrrr4r4r5rs zFileList.excludecCsNtjj|d|}ddt|ddD}|j|t|S)zN Include all files anywhere in 'dir/' that match the pattern. z**cSs(g|]}tjj|s|qSr4)r!r"r)rrr4r4r5rs z.FileList.recursive_include.. recursiveT)r!r"rfrrr)rKrrZ full_patternrr4r4r5rs zFileList.recursive_includecCs.ttjj|d|}|j|jS)zM Exclude any file anywhere in 'dir/' that match the pattern. z**)r6r!r"rfrr)rKrrrr4r4r5rszFileList.recursive_excludecCs0ddt|D}|j|t|S)zInclude all files from 'dir/'.cSs/g|]%}tjj|D] }|qqSr4)r_rfindall)rZ match_diritemr4r4r5rs z"FileList.graft..)rrr)rKrrr4r4r5rs  zFileList.graftcCs+ttjj|d}|j|jS)zFilter out files from 'dir/'.z**)r6r!r"rfrr)rKrrr4r4r5rszFileList.prunecsg|jdkr|jttjjd|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**cs%g|]}j|r|qSr4)r)rr)rr4r5rs z+FileList.global_include..)allfilesrr6r!r"rfrr)rKrrr4)rr5rs   zFileList.global_includecCs+ttjjd|}|j|jS)zD Exclude all files anywhere that match the pattern. z**)r6r!r"rfrr)rKrrr4r4r5rszFileList.global_excludecCsN|jdr|dd}t|}|j|rJ|jj|dS)N rr)rr _safe_pathrappend)rKrr"r4r4r5rs  zFileList.appendcCs |jjt|j|dS)N)rrfilterr)rKpathsr4r4r5rszFileList.extendcCs"tt|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]rrr)rKr4r4r5_repairszFileList._repairc Csd}tj|}|dkr6tjd|dStj|d}|dkrktj||ddSy,tjj|stjj|rdSWn+tk rtj||t j YnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFzutf-8T) unicode_utilsfilesys_decoderrtZ try_encoder!r"rsUnicodeEncodeErrorsysgetfilesystemencoding)rKr"Zenc_warnZu_pathZ utf8_pathr4r4r5rs  $ zFileList._safe_pathN)rrrrrrrrrrrrrrrrrr4r4r4r5r:s  I        rc@seZdZdZddZddZddZdd Zd d Zd d Z e ddZ ddZ ddZ dS)rz MANIFEST.incCs(d|_d|_d|_d|_dS)Nr)Z use_defaultsrZ manifest_onlyZforce_manifest)rKr4r4r5rLs   z!manifest_maker.initialize_optionscCsdS)Nr4)rKr4r4r5rqszmanifest_maker.finalize_optionscCst|_tjj|js+|j|jtjj|jrT|j |j |jj |jj |jdS)N) rrr!r"rsrwrite_manifest add_defaultstemplateZ read_templateprune_file_listsortZremove_duplicates)rKr4r4r5r s       zmanifest_maker.runcCs"tj|}|jtjdS)N/)rrreplacer!r#)rKr"r4r4r5_manifest_normalizesz"manifest_maker._manifest_normalizecsYjjfddjjD}dj}jtj|f|dS)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. csg|]}j|qSr4)r)rr)rKr4r5r"s z1manifest_maker.write_manifest..zwriting manifest file '%s'N)rrrrexecuterr)rKrmsgr4)rKr5rs  zmanifest_maker.write_manifestcCs#|j|stj||dS)N)_should_suppress_warningr rt)rKrr4r4r5rt&szmanifest_maker.warncCstjd|S)z; suppress missing-file warnings from sdist zstandard file .*not found)r$r)rr4r4r5r*sz'manifest_maker._should_suppress_warningcCstj||jj|j|jj|jtt}|r[|jj|nt j j |jrz|j |j d}|jj|jdS)Nr7)r rrrrrr]r rr!r"rsZ read_manifestget_finalized_commandrr7)rKZrcfilesZei_cmdr4r4r5r1s  zmanifest_maker.add_defaultscCsy|jd}|jj}|jj|j|jj|tjtj }|jj d|d|dddS)Nbuildz(^|z)(RCS|CVS|\.svn)Zis_regexr) rrW get_fullnamerr build_baser$r%r!r#Zexclude_pattern)rKrbase_dirr#r4r4r5r=szmanifest_maker.prune_file_listN)rrrrrLrqrrrrt staticmethodrrrr4r4r4r5rs      rc CsHdj|}|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-8rzN)rfr}rr)rTcontentsrr4r4r5rrGsrrc Cstjd||js|jj}|j|j|_}|j|j|_}z|j |j Wd|||_|_Xt |jdd}t j |j |dS)Nz writing %sZzip_safe)rr{r~rWrhrEr[rDrwrite_pkg_infor7rPr Zwrite_safety_flag)cmdbasenamerTrhZoldverZoldnamesafer4r4r5rTs  rcCs#tjj|rtjddS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.)r!r"rsrrt)rrrTr4r4r5warn_depends_obsoletefsrcCs>t|p f}dd}t||}|j|dS)NcSs|dS)Nrr4)rr4r4r5psz%_write_requirements..)rr writelines)streamreqslinesZ append_crr4r4r5_write_requirementsns rcCs|j}tj}t||j|jp1i}x>t|D]0}|jdjt t|||qAW|j d||j dS)Nz [{extra}] requirements) rWrStringIOrZinstall_requiresextras_requiresortedrformatvarsrygetvalue)rrrTdistrwrextrar4r4r5write_requirementsus  rcCs9t}t||jj|jd||jdS)Nzsetup-requirements)rrrWZsetup_requiresryr)rrrTrwr4r4r5write_setup_requirementss rcCsOtjdd|jjD}|jd|djt|ddS)NcSs&g|]}|jdddqS).rr)r )rkr4r4r5rs z(write_toplevel_names..ztop-level namesr)rRfromkeysrWZiter_distribution_namesrrrfr)rrrTpkgsr4r4r5write_toplevel_namess rcCst|||ddS)NT) write_arg)rrrTr4r4r5 overwrite_argsrFcCsdtjj|d}t|j|d}|dk rJdj|d}|j||||dS)Nrr)r!r"splitextrPrWrfry)rrrTrxZargnamerNr4r4r5rs  rcCs|jj}t|tjs*|dkr3|}n|dk rg}xt|jD]k\}}t|tjstj||}dj tt t |j }|j d||fqXWdj |}|jd||ddS)Nrz [%s] %s rz entry pointsT)rWZ entry_pointsrZr string_typesritemsr parse_grouprfrstrvaluesrry)rrrTrrwsectionrr4r4r5 write_entriess   $rc Cs{tjdttjjdrwtjdC}x9|D]1}tj d|}|r;t |j dSq;WWdQRXdS)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*$rNr) warningsrtDeprecationWarningr!r"rsiorr$rintgroup)rrrr4r4r5get_pkg_info_revisions r);__doc__distutils.filelistrZ _FileListdistutils.errorsrdistutils.utilrr_rr!r$rrrrrQZsetuptools.externrZsetuptools.extern.six.movesr setuptoolsrZsetuptools.command.sdistr r Zsetuptools.command.setoptr Zsetuptools.commandr pkg_resourcesr rrrrrrrZsetuptools.unicode_utilsrZsetuptools.globrZpkg_resources.externrr6r7rrrrrrrrrrrrrr4r4r4r5sN         : SI