efgdZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlmZdd lmZmZd d lmZdd lmZdd lmZddlmZddlmZddlmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&dj'e j(Z)dZ*GddZ+Gdde+eZ,GddeZGddeZ-dZ.dZ/d Z0ej1Z1ej2Z2d!Z3d"Z4d)d$Z5d%Z6d*d&Z7Gd'd(e&Z8dS)+zUsetuptools.command.egg_info Create a distribution's .egg-info directory and contents)FileList)DistutilsInternalError) convert_path)logN)metadata) _entry_points_normalization) _requirestxt)Command)sdist) walk_revctrl) edit_config) bdist_egg)glob) packaging)SetuptoolsDeprecationWarningz{}.{}cd}|jtjj}t jtj}d|d}t |D]f\}}|t|dz k}|dkr|r|dz }n |d|d|d z }7d }t|} || kr||} | d kr ||d zz }n| d kr||z }n| d kr|dz} | | kr|| dkr| dz} | | kr|| dkr| dz} | | kr#|| dkr| dz} | | kr || dk| | kr|t j| z }na||dz| } d} | d dkr d} | dd} | t j| z } |d | dz }| }n|t j| z }|dz }|| k|s||z }h|dz }t j|tj tj zS)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[^]r **z.*z(?:+z)*r*?[!^Nz\Z)flags) splitospathsepreescape enumeratelencompile MULTILINEDOTALL)rpatchunksr# valid_charcchunk last_chunki chunk_lencharinner_iinner char_classs {/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/command/egg_info.pytranslate_patternr8%s CTZ $ $F )BF  CCCC!Jf%%>>5#f++/)  D== 8t zzz33377  JJ )mm8Ds{{zC''z!a%Y&&5>S+@+@%kGY&&5>S+@+@%kG ))eGn.C.C%kG ))eGn.C.Ci''29T??*CC"!a%'/2E!#JQx3%( %abb ")E"2"22JCZZZ11C AAry& FAU)mmZ  3JC5LC :c !9 : : ::cveZdZdZdZedZdZdZde de fdZ de fdZ de fd Z ee ZdS) InfoCommonNcXtj|jSN)r safe_name distributionget_nameselfs r7namezInfoCommon.name|s"'(9(B(B(D(DEEEr9c||j}tj|Sr=) _maybe_tagr? get_versionr safe_version)rBtaggeds r7tagged_versionzInfoCommon.tagged_versions3!2!>!>!@!@AA*6222r9cR|jr||r|n ||jzS)z egg_info may be called more than once for a distribution, in which case the version string already contains all tags. )vtags_already_taggedrBversions r7rEzInfoCommon._maybe_tags7z &"227;; &GG4:% r9rNreturnc||jp&||Sr=)endswithrK _safe_tagsrMs r7rLzInfoCommon._already_taggeds7 ++Rw/?/?@Q@Q/R/RRr9c tjd|jddS#tjj$r0tj|jddcYSwxYw)N0r  .)r rGrKrrNInvalidVersionr>replacerAs r7rRzInfoCommon._safe_tagss{ J!./?4:/?/?@@D D / J J J!+DJ,>,>sC,H,HII I I I Js#&AA*)A*chd}|jr ||jz }|jr|tjdz }|S)Nrz%Y%m%d) tag_buildtag_datetimestrftimerMs r7tagszInfoCommon.tagss@ > & t~ %G = / t}X.. .Gr9)__name__ __module__ __qualname__rZr[propertyrCrIrEstrboolrLrRr^rKr9r7r;r;xsIH FFXF333    SsStSSSS JCJJJJc HTNNEEEr9r;ceZdZdZgdZdgZddiZdZedZ e j dZ dZ d Z e d fd Zdd ZdZdZdZdZd S)egg_infoz+create a distribution's .egg-info directory))z egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree))tag-datedz0Add date stamp (e.g. 20050528) to version number)z tag-build=bz-Specify explicit tag to add to version number)no-dateDz"Don't include date stamp [default]rirlcLd|_d|_d|_d|_d|_dS)NF)egg_baseegg_namerg egg_versionignore_egg_info_in_manifestrAs r7initialize_optionszegg_info.initialize_optionss-   +0(((r9cdSr=rerAs r7tag_svn_revisionzegg_info.tag_svn_revision r9cdSr=re)rBvalues r7ruzegg_info.tag_svn_revisionrvr9ctj}||d<d|d<t|t |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. rZrr[)rgN) collections OrderedDictr^rdict)rBfilenamergs r7save_version_infozegg_info.save_version_infosQ *,,!%  HdH55566666r9c~|j|_||_tj|j} t|tjj}|rdnd}tj ||j|jfznB#t$r5}tj d|jd|j|d}~wwxYw|j3|jj}|pidt$j|_|dt+j|jdz|_|jt$jkr/t$j|j|j|_|j|jj_|jj}t9|ddpt9|d d}|`||jkrE|j|_tj|j|_d|j_dSdSdS) Nz%s==%sz%s===%sz-Invalid distribution name or version syntax: -rro .egg-infokeyrC) rCrprIrqrrNVersion isinstance requirements Requirement ValueError distutilserrorsDistutilsOptionErrorror? package_dirgetr!curdirensure_dirnamer filename_componentrgr"joinr _patched_distgetattrlower_version_parsed_version)rBparsed_version is_versionspecrhdirspdrs r7finalize_optionszegg_info.finalize_optionss   ..00"*2243CDD #NI4E4MNNJ)888yD  " . .tt}dFV6W/W X X X X   "777===$"2"24   = $0D!ZR,,R;;DM J'''&9$-HH;V =BI % %GLL FFDM .2-="*   ,b%&&C'"fd*C*C >cT]%8%8%:%:::*BK!*!2!:!:4;K!L!LB .2D  + + + >::s AB C)0CCNc:t|j|j||S)0Compute filename of the output egg. Private API.) _egg_basenamerprq)rB py_versionplatforms r7_get_egg_basenamezegg_info._get_egg_basenamesT]D, )))| Ih       r9c ||j tj|jdn=#t$r0}d|jd}t j||d}~wwxYwtj dD]P}| }|||j tj |j|j Qtj |jd}tj |r|||dS)Nz'Cannot update time stamp of directory ''zegg_info.writers)groupznative_libs.txt)mkpathrgr!utimeOSErrorrrDistutilsFileErrorr entry_pointsloadrCr"rrr find_sources)rBrhmsgepwriternls r7runz egg_info.run1s9 DM""" B HT]D ) ) ) ) B B BLDMLLLC"55c:: A B'.@AAA H HBWWYYF F4"',,t}bg"F"F G G G GW\\$-): ; ; 7>>"   !   R  s7 A1+A,,A1ctj|jd}t |j}|j|_||_| |j |_ dS)z"Generate SOURCES.txt manifest filez SOURCES.txtN) r!r"rrgmanifest_makerr?rrignore_egg_info_dirmanifestrfilelist)rBmanifest_filenamemms r7rzegg_info.find_sourcesCsVGLL FF D- . .!%!A'    r9F)r_r`ra description user_optionsboolean_options negative_optrsrbrusetterr~rPY_MAJORrrrrrrrer9r7rgrgs?K   L"lO:L111  X    7 7 7*3*3*3X,4dTTTT++++$      $$$$$$r9rgcteZdZdfd ZdZdZdZdZdZd Z d Z d Z d Z d Z dZdZdZdZxZS)rNFcZt||||_dSr=)super__init__r)rBr debug_printr __class__s r7rzFileList.__init__Ps+ {+++#6   r9c |||\}}}}|j|j|j|jt j|j|t j|j||j |j d}dddddddd d} ||}n1#t$r$td | wxYw|d } |d vr|g}| r|fnd} ||} |d|g| r|gngz|z|D] } || st#j| | g| R!dS)N)includeexcludezglobal-includezglobal-excludezrecursive-includezrecursive-excludegraftprunez%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->rrrerU)_parse_template_linerrglobal_includeglobal_exclude functoolspartialrecursive_includerecursive_excluderrKeyErrorrformat startswithrrrr) rBlinerpatternsdir dir_pattern action_maplog_mapprocess_actionaction_is_recursiveextra_log_argslog_tmplpatterns r7process_template_linezFileList.process_template_lineTs 04/H/H/N/N,3 ||"1"1!*!2&"""+!2&""ZZ  "?VS6P2CM%  * '/NN   (AHHPVHWW  %// == ' ' '#}H#6>#B6?  HH%8@SEEbAHL       = =G!>'** =7<^<<<< = =s B .B7cd}tt|jdz ddD]E}||j|r-|d|j|z|j|=d}F|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)rB predicatefoundr1s r7 _remove_fileszFileList._remove_filess| s4:*B33  AyA''    1 !=>>>JqM r9c|dt|D}||t|S)z#Include files that match 'pattern'.cPg|]#}tj|!|$Srer!r"isdir.0rs r7 z$FileList.include..s+BBBqq1A1ABBBBr9rextendrd)rBrrs r7rzFileList.includes9BBDMMBBB EE{{r9cTt|}||jS)z#Exclude files that match 'pattern'.)r8rmatchrBrrs r7rzFileList.excludes%!'**!!%+...r9ctj|d|}dt|dD}||t |S)zN Include all files anywhere in 'dir/' that match the pattern. rcPg|]#}tj|!|$Srerrs r7rz.FileList.recursive_include..s,WWWqbgmmTUFVFVWWWWr9T) recursive)r!r"rrrrd)rBrr full_patternrs r7rzFileList.recursive_includesYw||Cw77 WWD>>>WWW EE{{r9cttj|d|}||jS)zM Exclude any file anywhere in 'dir/' that match the pattern. rr8r!r"rrr)rBrrrs r7rzFileList.recursive_excludes9""',,sD'"B"BCC!!%+...r9c|dt|D}||t|S)zInclude all files from 'dir/'.cVg|]&}tj|D]}|'Sre)rrfindall)r match_diritems r7rz"FileList.graft..sP   !*229==       r9r)rBrrs r7rzFileList.graftsF  !#YY    EE{{r9cttj|d}||jS)zFilter out files from 'dir/'.rr)rBrrs r7rzFileList.prunes5!"',,sD"9"9::!!%+...r9c|j|ttjd|fd|jD}||t|S)z Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. Nrc>g|]}||Sre)r)rrrs r7rz+FileList.global_include..s(<<> r9cd}tj|}|tjd|zdStj|d}|tj||ddS d|vpd|v}|jr|rdSt j|st j|rdSdS#t$r+tj||tj YdSwxYw)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFrrs .egg-infoT) unicode_utilsfilesys_decoderr try_encoderr!r"rUnicodeEncodeErrorsysgetfilesystemencoding)rBr"enc_warnu_path utf8_path is_egg_infos r7rzFileList._safe_paths6-d33 > H>E F F F5",VW==   HXtW - - -5 B%/L<93LK' K uw~~f%%  )B)B t  " B B B HXtS%>%@%@ A A A A A A Bs"B75>B771C,+C,)NNF)r_r`rarrrrrrrrrrrrrr"r __classcell__)rs@r7rrMs777777E=E=E=N    /// //////   ///$$$:::???BBBBBBBr9rcjeZdZdZdZdZdZdZdZdZ e dZ d Z d Z d Zd Zd ZdS)rz MANIFEST.incLd|_d|_d|_d|_d|_dS)Nr F) use_defaultsr manifest_onlyforce_manifestrrAs r7rsz!manifest_maker.initialize_optionss/ #(   r9cdSr=rerAs r7rzmanifest_maker.finalize_options s r9cFt|j|_tj|js||tj|j r| | | | |j|j|dS)N)r)rrrr!r"rrwrite_manifest add_defaultstemplate read_templateadd_license_files_add_referenced_filesprune_file_listsortremove_duplicatesrAs r7rzmanifest_maker.run#s T5MNNN w~~dm,, "    ! ! !  7>>$- ( ( !         ""$$$   ''))) r9cjtj|}|tjdS)N/)r$r%rXr!r#)rBr"s r7_manifest_normalizez"manifest_maker._manifest_normalize1s(+D11||BFC(((r9cjfdjjD}djz}t j|f|dS)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. c:g|]}|Sre)rA)rrrBs r7rz1manifest_maker.write_manifest..=s'JJJ))!,,JJJr9zwriting manifest file '%s'N)rr"rrexecuter)rBrrs` r7r6zmanifest_maker.write_manifest5si KJJJdm6IJJJ*T]: Z$-!7=====r9c^||stj||dSdSr=)_should_suppress_warningrr)rBrs r7rzmanifest_maker.warnAs:,,S11 " JtS ! ! ! ! ! " "r9c,tjd|S)z; suppress missing-file warnings from sdist zstandard file .*not found)r$r)rs r7rFz'manifest_maker._should_suppress_warningEs x4c:::r9cdtj||j|j|j|jt t}|r|j|n8tj |jr| tj dr|jd| d}|j|jdS)Nzsetup.pyrg)rr7rrr8rr!rrr!r"r read_manifestget_finalized_commandrrg)rBrcfilesei_cmds r7r7zmanifest_maker.add_defaultsLs 4    T]+++ T]+++|~~&&  ! M  ) ) ) ) W^^DM * * !    7>>* % % - M  , , ,++J77 FO,,,,,r9c|jjjpg}|D]}tjd||j|dS)Nzadding license file '%s')r?r license_filesrrrr)rBrNlfs r7r:z manifest_maker.add_license_files^sV)2@FB  5 5B H/ 4 4 4 4 ]+++++r9ct|jdg}|D]}tjd||j|dS)zGAdd files referenced by the config (e.g. `file:` directive) to filelist_referenced_filesz%adding file referenced by config '%s'N)rr?rdebugrr)rB referencedrfs r7r;z$manifest_maker._add_referenced_filesdsZT.0CRHH  C CB I=r B B B B Z(((((r9cZ|d}|j}|j|j|j|t jtj }|j d|zdz|zddS)Nbuildz(^|z)(RCS|CVS|\.svn)r )is_regex) rJr? get_fullnamerr build_baser$r%r!r#exclude_pattern)rBrVbase_dirr#s r7r<zmanifest_maker.prune_file_listls**733$1133 E,--- H%%%i %% SL. . 4q &     r9ct|dr|Stjddd|S)a0 The parent class implementation of this method (``sdist``) will try to include data files, which might cause recursion problems when ``include_package_data=True``. Therefore, avoid triggering any attempt of analyzing/building the manifest again. get_data_files_without_manifestz@`build_py` command does not inherit from setuptools' `build_py`.z Custom 'build_py' does not implement 'get_data_files_without_manifest'. Please extend command classes from setuptools instead of distutils. z!https://peps.python.org/pep-0632/)see_url)hasattrr]remitget_data_files)rBbuild_pys r7_safe_data_fileszmanifest_maker._safe_data_filesvsd 8> ? ? >;;== =$) N 8     &&(((r9N)r_r`rar8rsrrrAr6r staticmethodrFr7r:r;r<rcrer9r7rrsH)))      ))) > > >""";;\; ---$,,, )))   )))))r9rcd|}|d}t|d5}||ddddS#1swxYwYdS)z{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.  rrN)rrrr)r}contentsrs r7rrsyy""Hw''H h   sAA"%A"c~tjd||js|jj}|j|jc|_}|j|jc|_} |j |j ||c|_|_n#||c|_|_wxYwt|jdd}tj |j |dSdS)Nz writing %szip_safe)rrrr?rrqrNrprCwrite_pkg_inforgrrwrite_safety_flag)cmdbasenamer}roldveroldnamesafes r7rjrjsH\8$$$ ;8#,#&?H4D &!$x} w > $H #CL 1 1 1.5v +HM8++gv +HM8+ = = = =s'T::#CL$7777788s A77BcdS)aj Unused: left to avoid errors when updating (from source) from <= 67.8. Old installations have a .dist-info directory with the entry-point ``depends.txt = setuptools.command.egg_info:warn_depends_obsolete``. This may trigger errors when running the first egg_info in build_meta. TODO: Remove this function in a version sufficiently > 68. Nrerlrmr}s r7warn_depends_obsoleterssr9c td|jD}|d|dt |dzdS)NcFg|]}|dddS)rVr r)r )rks r7rz(write_toplevel_names..s)PPPa PPPr9ztop-level namesrf)r|fromkeysr?iter_distribution_namesrrsorted)rlrmr}pkgss r7write_toplevel_namesr{sk ==PPS%5%M%M%O%OPPP  DNN$h &,,0G0G$0NOOOOOr9c*t|||ddS)NT) write_argrrs r7 overwrite_argr~s c8Xt,,,,,r9Fctj|d}t|j|d}|d|dz}|||||dS)Nrrf)r!r"splitextrr?rr)rlrmr}rargnamerxs r7r}r}slgx((+G C$gt 4 4E  %  4'Whu=====r9ctj|jj}tj|}|d||ddS)Nz entry pointsT)r rr?rrenderr)rlrmr}epsdefns r7 write_entriesrsH  S-: ; ;C   $ $D^XtTBBBBBr9ctj|}tj|}|d|d|pt}|r|d|z }|S)rrz-py)r rr)rprqrrrCrNeggs r7rrs_  ,X 6 6D/ <rsX<<544444333333'''''' !!!!!!,,,,,,,,******111111111111((((((000000 ''''''333333 7>3+ ,P;P;P;f,,,,,,,,^c$c$c$c$c$z7c$c$c$LFBFBFBFBFByFBFBFBRv)v)v)v)v)Uv)v)v)r   888&"4'@PPP--->>>>CCC JJJJJ <JJJJJr9