\bgeDdZddlZddlZddlZddlZddlZddlmZddlZddl Zddl Zddl m Z ddl mZddlmZddlmZmZddlmZddlmZd d lmZmZd d lmZd d lmZd dlmZddl Z!ddl"Z!ddl!m#Z#ddl m$Z$ddl"m%Z&ddl'm(Z(ej)j*dej)j+Z,dZ-GddZ.Gdde.eZ/Gdde&Z%GddeZ0d*dZ1d*dZ2d*d Z3ej4Z4ej5Z5d*d!Z6d*d"Z7d+d$e8ddfd%Z9d*d&Z:d,d'Z;Gd(d)eZ>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 r8namezInfoCommon.name}s"'(9(B(B(D(DEEEr:c||j}tj|Sr>) _maybe_tagr@ get_versionr safe_version)rCtaggeds r8tagged_versionzInfoCommon.tagged_versions3!2!>!>!@!@AA*6222r:cR|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_taggedrCversions r8rFzInfoCommon._maybe_tags7z &"227;; &GG4:% r:rOreturnc||jp&||Sr>)endswithrL _safe_tagsrNs r8rMzInfoCommon._already_taggeds7 ++Rw/?/?@Q@Q/R/RRr:c tjd|jddS#tjj$r0tj|jddcYSwxYw)N0r r)r rHrL packagingrOInvalidVersionr?replacerBs r8rSzInfoCommon._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_datetimestrftimerNs r8tagszInfoCommon.tagss@ > & t~ %G = / t}X.. .Gr:)__name__ __module__ __qualname__r[r\propertyrDrJrFstrboolrMrSr_rLr:r8r<r<ysIH FFXF333    SsStSSSS JCJJJJc HTNNEEEr:r<ceZdZdZgdZdgZddiZdZeddZ e j d Z dd Z dd Z e dfd ZddeddfdZddZddZddZddZdS)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]rjrmcLd|_d|_d|_d|_d|_dS)NF)egg_baseegg_namerh egg_versionignore_egg_info_in_manifestrBs r8initialize_optionszegg_info.initialize_optionss-   +0(((r:rPNcdSr>rfrBs r8tag_svn_revisionzegg_info.tag_svn_revision r:cdSr>rf)rCvalues r8rvzegg_info.tag_svn_revisionrwr:ct|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. r)r[r\)rhN)dictr_r)rCfilenamerhs r8save_version_infozegg_info.save_version_infos?$))++:::HdH55566666r:cZ|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_dS)Nz%s==%sz%s===%sz-Invalid distribution name or version syntax: -rrp .egg-info)rDrqrJrrrWrOVersion isinstance requirements Requirement ValueError distutilserrorsDistutilsOptionErrorrpr@ package_dirgetr"curdirensure_dirnamer filename_componentrhr#joinr )rCparsed_version is_versionspecridirss r8finalize_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-="***s AB C)0CCc:t|j|j||S)0Compute filename of the output egg. Private API.) _egg_basenamerqrr)rC py_versionplatforms r8_get_egg_basenamezegg_info._get_egg_basenamesT]D, )))| Ih       r:c ttjd}||j t j|jdn=#t$r0}d|jd}tj ||d}~wwxYw|D]P}| }|||j t j |j|j Qt j |jd}t j |r|||dS)Nzegg_info.writers)groupz'Cannot update time stamp of directory ''znative_libs.txt)listr entry_pointsmkpathrhr"utimeOSErrorrrDistutilsFileErrorloadrDr#rrr find_sources)rCwritersrimsgepwriternls r8runz egg_info.run%sHx,3EFFFGG DM""" B HT]D ) ) ) ) B B BLDMLLLC"55c:: A B H HBWWYYF F4"',,t}bg"F"F G G G GW\\$-): ; ; 7>>"   !   R  sA B#+BBctj|jd}t |j}|j|_||_| |j |_ dS)z"Generate SOURCES.txt manifest filez SOURCES.txtN) r"r#rrhmanifest_makerr@rsignore_egg_info_dirmanifestrfilelist)rCmanifest_filenamemms r8rzegg_info.find_sources;sVGLL FF D- . .!%!A'    r:rPNF)r`rarb description user_optionsboolean_options negative_optrtrcrvsetterr}rPY_MAJORrrerrrrrrfr:r8rhrhsM?K   L"lO:L111   X    7 7 7 7>>>>B,4dTTTT+++QU++++$        ,$$$$$$r:rhceZdZ ddeddffd ZddZdZdZd Zd Z d Z d Z d Z dZ dZddZddZdZdZxZS)rNFrrPcZt||||_dSr>)super__init__r)rCr debug_printr __class__s r8rzFileList.__init__Hs- {+++#6   r:c f||\}}}}|j|j|j|jt j|j|t j|j||j |j d}dddddddd d} ||}n&#t$rd |d |} t| dwxYw| 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$Invalid MANIFEST.in: unknown action z in z recursive->rrrfrV)_parse_template_linerrglobal_includeglobal_exclude functoolspartialrecursive_includerecursive_excluderrKeyErrorr startswithrrrr)rClineactionpatternsdir dir_pattern action_maplog_mapprocess_actionraction_is_recursiveextra_log_argslog_tmplpatterns r8process_template_linezFileList.process_template_lineNs 04/H/H/N/N,3 ||"1"1!*!2&"""+!2&""ZZ+ + "?SP6M2CM%  * 8'/NN 8 8 8OOOtOOC(--4 7 8%// == ' ' '#}H#6>#B6?  HH%8@SEEbAHL       = =G!>'** =7<^<<<< = =s B #B,cd}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 Frz removing T)ranger(filesr)rC predicatefoundr2s r8 _remove_fileszFileList._remove_filess| s4:*B33  AyA''    1 !=>>>JqM r:c|dt|D}||t|S)z#Include files that match 'pattern'.cPg|]#}tj|!|$Srfr"r#isdir.0rs r8 z$FileList.include..s+BBBqq1A1ABBBBr:r extendre)rCrrs r8rzFileList.includes9BBDMMBBB EE{{r:cTt|}||jS)z#Exclude files that match 'pattern'.)r9rmatchrCrrs r8rzFileList.excludes%!'**!!%+...r:ctj|d|}dt|dD}||t |S)zN Include all files anywhere in 'dir/' that match the pattern. rcPg|]#}tj|!|$Srfrrs r8rz.FileList.recursive_include..s,WWWqbgmmTUFVFVWWWWr:T) recursive)r"r#rr rre)rCrr full_patternrs r8rzFileList.recursive_includesYw||Cw77 WWD>>>WWW EE{{r:cttj|d|}||jS)zM Exclude any file anywhere in 'dir/' that match the pattern. rr9r"r#rrr)rCrrrs r8rzFileList.recursive_excludes9""',,sD'"B"BCC!!%+...r:c|dt|D}||t|S)zInclude all files from 'dir/'.cVg|]&}tj|D]}|'Srf)rrfindall)r match_diritems r8rz"FileList.graft..sP   !*229==       r:r)rCrrs r8rzFileList.graftsF  !#YY    EE{{r:cttj|d}||jS)zFilter out files from 'dir/'.rr)rCrrs r8rzFileList.prunes5!"',,sD"9"9::!!%+...r:c|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|]}||Srf)r)rrrs r8rz+FileList.global_include..s(<< 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,)NNFr)r`rarbrerrrrrrrrrrrrrrr __classcell__)rs@r8rrEsFHM77@D7 777777 D=D=D=D=L    /// //////   ///$$$$::::???BBBBBBBr:rcreZdZdZddZddZddZdZddZdd Z e d Z dd Z dd Z d ZdZdS)rz MANIFEST.inrPNcLd|_d|_d|_d|_d|_dS)NTF) use_defaultsr manifest_onlyforce_manifestrrBs r8rtz!manifest_maker.initialize_optionss/  !"#(   r:cdSr>rfrBs r8rzmanifest_maker.finalize_optionss r:cFt|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_duplicatesrBs r8rzmanifest_maker.runs T5MNNN w~~dm,, "    ! ! !  7>>$- ( ( !         ""$$$   ''))) r:cjtj|}|tjdS)N/)rrrYr"r$)rCr#s r8_manifest_normalizez"manifest_maker._manifest_normalize*s(+D11||BFC(((r:cjfdjjD}djz}t j|f|dS)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. c:g|]}|Srf)r:)rrrCs r8rz1manifest_maker.write_manifest..6s'JJJ))!,,JJJr:zwriting manifest file '%s'N)rrrrexecuter)rCrrs` r8r/zmanifest_maker.write_manifest.si KJJJdm6IJJJ*T]: Z$-!7=====r:c^||stj||dSdSr>)_should_suppress_warningrr)rCrs r8rzmanifest_maker.warn:s:,,S11 " JtS ! ! ! ! ! " "r:c,tjd|S)z; suppress missing-file warnings from sdist zstandard file .*not found)r%r)rs r8r?z'manifest_maker._should_suppress_warning>s x4c:::r:cdtj||j|j|j|jt t}|r|j|n8tj |jr| tj dr|jd| d}|j|jdS)Nzsetup.pyrh)rr0rrr1rrrrr"r#r read_manifestget_finalized_commandrrh)rCrcfilesei_cmds r8r0zmanifest_maker.add_defaultsEs 4    T]+++ T]+++|~~&&  ! M  ) ) ) ) W^^DM * * !    7>>* % % - M  , , ,++J77 FO,,,,,r:c|jjjpg}|D]}tjd||j|dS)Nzadding license file '%s')r@r license_filesrrrr)rCrGlfs r8r3z manifest_maker.add_license_filesWsV)2@FB  5 5B H/ 4 4 4 4 ]+++++r:ct|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)getattrr@rdebugrr)rC referencedrfs r8r4z$manifest_maker._add_referenced_files]sZT.0CRHH  C CB I=r B B B B Z(((((r:ct|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)hasattrrPremitget_data_files)rCbuild_pys r8_safe_data_fileszmanifest_maker._safe_data_filesesd 8> ? ? >;;== =$) N 8     &&(((r:r)r`rarbr1rtrrr:r/r staticmethodr?r0r3r4rVrfr:r8rrsH))))        ))) > > > >"""";;\; ----$,,,, ))))))))r:rrPcd|}|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 r8rr~syy""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@r rrrOrqrDwrite_pkg_inforhrKrwrite_safety_flag)cmdbasenamer|r oldveroldnamesafes r8r]r]sH\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. Nrfr_r`r|s r8warn_depends_obsoleterfsr:c td|jD}|d|dt |dzdS)NcFg|]}|dddS)rrr)r!)rks r8rz(write_toplevel_names..s6 Qr:ztop-level namesrY)r{fromkeysr@iter_distribution_namesrrsorted)r_r`r|pkgss r8write_toplevel_namesrnsv ==$'$4$L$L$N$N  DNN$h &,,0G0G$0NOOOOOr:c*t|||ddS)NT) write_argres r8 overwrite_argrqs c8Xt,,,,,r:Frctj|d}t|j|d}|d|dz}|||||dS)NrrY)r"r#splitextrKr@rr)r_r`r|rargnamerys r8rprpslgx((+G C$gt 4 4E  %  4'Whu=====r:ctj|jj}tj|}|d||ddS)Nz entry pointsT)r rr@rrenderr)r_r`r|epsdefns r8 write_entriesrysH  S-: ; ;C   $ $D^XtTBBBBBr:ctj|}tj|}|d|d|pt}|r|d|z }|S)rrz-py)r rr)rqrrrrrDrOeggs r8rrs_  ,X 6 6D/ <rs<< $$$$$$000000((((((88888888111111 ,,,,,,,,!!!!!!333333333333444444''''''$ ? ?s'7'= ? ?P;P;P;f,,,,,,,,^Z$Z$Z$Z$Z$z7Z$Z$Z$zGBGBGBGBGByGBGBGBTl)l)l)l)l)Ul)l)l)^    8888&"4'@PPPP---->>d>t>>>>CCCC JJJJJ <JJJJJr: