K ie`dZddlZddlZddlZddlZddlZddlmZddlZddl 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(ejRjTdejRjVZ,dZ-GddZ.Gdde.eZ/Gdde&Z%GddeZ0d)dZ1d)dZ2d)d Z3ejhZ4ejjZ5d)d!Z6d)d"Z7d*d#e8ddfd$Z9d)d%Z:d+d&Z;Gd'd(eZ5#f+/)  D=t ZL#b11  J )m8Ds{zC''z!a%Y&5>S+@%kGY&5>S+@%kG )eGn.C%kG )eGn.Ci'299T?*C"!a%'2E!#JQx3%( %ab "))E"22JQzl!,,C Aryy& FAU)mZ 3JC}>@5LC ::c !9 ::cheZdZdZdZedZdZdZde de fdZ de fdZ de fd Z ee Zy) InfoCommonNc\tj|jjSN)r safe_name distributionget_nameselfs r8namezInfoCommon.name}s"''(9(9(B(B(DEEr:c~|j|jj}tj|Sr>) _maybe_tagr@ get_versionr safe_version)rCtaggeds r8tagged_versionzInfoCommon.tagged_versions0!2!2!>!>!@A**622r:c^|jr|j|r|S||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_tags5zzd227;  4::% r:rOreturncz|j|jxs|j|jSr>)endswithrL _safe_tagsrNs r8rMzInfoCommon._already_taggeds0 +Rw/?/?@Q/RRr:c tjd|jddS#tjj $r2tj |jjddcYSwxYw)N0r r)r rHrL packagingrOInvalidVersionr?replacerBs r8rSzInfoCommon._safe_tagssj J!..4::,/?@D D  // J!++DJJ,>,>sC,HI I Js$'A A65A6cd}|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<yseIH FF3  SsStS JCJc TNEr:r<ceZdZdZgdZdgZddiZdZeddZ e jd Z dd Z dd Z e dfd Zdd eddfdZddZddZddZddZy)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]rjrmcJd|_d|_d|_d|_d|_y)NF)egg_baseegg_namerh egg_versionignore_egg_info_in_manifestrBs r8initialize_optionszegg_info.initialize_optionss'   +0(r:rPNcyr>rfrBs r8tag_svn_revisionzegg_info.tag_svn_revision r:cyr>rf)rCvalues r8rvzegg_info.tag_svn_revisionrwr:cft|jd}t|t|y)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%$))+:HdH56r:c|j|_|j|_tj j |j} t|tj j }|rdnd}tjj||j|jfz|j?|jj }|xsij#dt$j&|_|j)dt+j,|jdz|_|jt$j&k7r9t$j0j3|j|j.|_|j|jj4_y#t$r?}tjjd|jd|j|d}~wwxYw)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   ..0"**2243C3CD #NI4E4E4M4MNJ)8yD  " " . .tt}}dFVFV6W/W X == $$00D!ZR,,R;DM J'&99$--H;V ==BII %GGLL FDM .2-=-=""*# ""77? aPTP`P`Oab  sA"F22 G:;:G55G:cFt|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,<,>"    R   B;DMM?!LC""55c: A Bs D$$ E"-0EE"ctjj|jd}t |j }|j |_||_|j|j|_ y)z"Generate SOURCES.txt manifest filez SOURCES.txtN) r"r#rrhmanifest_makerr@rsignore_egg_info_dirmanifestrfilelist)rCmanifest_filenamemms r8rzegg_info.find_sources:sTGGLL F D-- .!%!A!A'    r:rPNF)r`rarb description user_optionsboolean_options negative_optrtrcrvsetterr}rPY_MAJORrrerrrrrrfr:r8rhrhs?K L"lO:L1    7>@,4dT++QU+$  ,$r:rhceZdZ ddeddffd ZddZdZdZdZd Z d Z d Z d Z d Z dZddZddZdZdZxZS)rNrrPc4t|||||_yr>)super__init__r)rCr debug_printr __class__s r8rzFileList.__init__Gs {+#6 r:c |j|\}}}}|j|j|j|jt j |j|t j |j||j|jd}dddddddd d} ||}|jd } |d vr|g}| r|fnd} ||} |jdj|g| r|gngz|z|D]"} || r t!j"| | g| $y#t$rd |d |} t| dwxYw)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_lineMs 04/H/H/N,3 ||||"11"11!*!2!2&&""+!2!2&&"ZZZZ+ "?SP6M2CM% * 8'/N%// = ' '#}H#6#B6?  HH%8SEbAHL    =G!'*7<^< =' 88 $thOC(-4 7 8s &D##Ecd}tt|jdz ddD]H}||j|s|jd|j|z|j|=d}J|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_filessp s4::*B3 AA'   1 !=>JJqM    r:ct|Dcgc]$}tjj|r#|&}}|j |t |Scc}w)z#Include files that match 'pattern'.)r r"r#isdirextendre)rCrrrs r8rzFileList.includesD MBqq1ABB EE{Cs $AAcNt|}|j|jS)z#Exclude files that match 'pattern'.)r9rmatchrCrrs r8rzFileList.excludes!!'*!!%++..r:ctjj|d|}t|dDcgc]$}tjj |r#|&}}|j |t |Scc}w)zN Include all files anywhere in 'dir/' that match the pattern. rT) recursive)r"r#rr rrre)rCrr full_patternrrs r8rzFileList.recursive_includes`ww||Cw7  >WqbggmmTUFVWW EE{Xs $A8A8cttjj|d|}|j |j S)zM Exclude any file anywhere in 'dir/' that match the pattern. rr9r"r#rrr)rCrrrs r8rzFileList.recursive_excludes4""'',,sD'"BC!!%++..r:ct|Dcgc](}tjj|D]}|*}}}|j |t |Scc}}w)zInclude all files from 'dir/'.)r rrfindallrre)rCr match_diritemrs r8rzFileList.graftsh"#Y !**229=     EE{  s-Acttjj|d}|j |j S)zFilter out files from 'dir/'.rr)rCrrs r8rzFileList.prunes0!"'',,sD"9:!!%++..r:c$|j|jttjj d|}|jDcgc]}|j |s|}}|j|t|Scc}w)z Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. r) allfilesrr9r"r#rrrre)rCrrrrs r8rzFileList.global_includesl == LLN!"'',,tW"=> MM!!%++..r:c|jdr|dd}t|}|j|r|jj |yy)N r)rRr _safe_pathrappend)rCrr#s r8r zFileList.appendsF == 9DD! ??4 JJ  d # !r:cb|jjt|j|yr>)rrfilterr )rCpathss r8rzFileList.extends &%89r:c`tt|j|j|_y)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)rrr rrBs r8_repairzFileList._repairs&$**=> r:cd}tj|}|tjd|dytj|d}|tj||dy d|vxsd|v}|j r|ryt jj|st jj|ryy#t$r,tj||tjYywxYw) Nz!'%s' not %s encodable -- skippingrz$' in unexpected encoding -- skippingFrrs .egg-infoT) unicode_utilsfilesys_decoderr try_encoderr"r#rUnicodeEncodeErrorsysgetfilesystemencoding)rCr#enc_warnu_path utf8_path is_egg_infos r8r zFileList._safe_paths6--d3 > HHqBC D",,VW=   HHXtW - B%/L<93LK''Kww~~f% )B*C" B HHXtS%>%>%@ A Bs%B>>>B>>2C32C3)NNFr)r`rarbrerrrrrrrrrrrr rrr  __classcell__)rs@r8rrDshHM7@D7 7 D=L  / // /$:?Br:rcjeZdZdZddZddZddZdZddZddZ e d Z dd Z dd Z d Zd Zy)rz MANIFEST.inNcJd|_d|_d|_d|_d|_y)NTF) use_defaultsr manifest_onlyforce_manifestrrBs r8rtz!manifest_maker.initialize_optionss)  !"#( r:cyr>rfrBs r8rzmanifest_maker.finalize_optionss r:c&t|j|_tjj |j s|j|jtjj |jr|j|j|j|j|jj|jj|jy)N)r)rrrr"r#rrwrite_manifest add_defaultstemplate read_templateadd_license_files_add_referenced_filesprune_file_listsortremove_duplicatesrBs r8rzmanifest_maker.runs T5M5MN ww~~dmm,    !  77>>$-- (       ""$   '') r:cltj|}|jtjdS)N/)rrrYr"r$)rCr#s r8_manifest_normalizez"manifest_maker._manifest_normalize)s'++D1||BFFC((r:c |jj|jjDcgc]}|j|}}d|jd}|j t |j|f|ycc}w)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. zwriting manifest file 'rN)rrrr1rexecuter)rCrrrs r8r&zmanifest_maker.write_manifest-so 7;mm6I6IJ))!,JJ' a8 Z$--!7=KsBcT|j|stj||yyr>)_should_suppress_warningrr)rCrs r8rzmanifest_maker.warn9s#,,S1 JJtS !2r:c.tjd|S)z; suppress missing-file warnings from sdist zstandard file .*not found)r%r)rs r8r5z'manifest_maker._should_suppress_warning=s xx4c::r:cvtj||jj|j|jj|j t t}|r|jj|n9tjj|j r|jtjjdr|jjd|jd}|jj|jy)Nzsetup.pyrh)rr'rr r(rrrrr"r#r read_manifestget_finalized_commandrrh)rCrcfilesei_cmds r8r'zmanifest_maker.add_defaultsDs 4  T]]+ T]]+|~&  MM  ) WW^^DMM *    77>>* % MM  ,++J7 FOO,r:c|jjjxsg}|D]}tjd||j j |y)Nzadding license file '%s')r@r license_filesrrrr)rCr=lfs r8r*z manifest_maker.add_license_filesVsN))22@@FB  5B HH/ 4 5 ]+r:ct|jdg}|D]}tjd||jj |y)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 r8r+z$manifest_maker._add_referenced_files\sIT..0CRH  CB II=r B C Z(r:ct|dr|jStjddd|j 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)hasattrrFremitget_data_files)rCbuild_pys r8_safe_data_fileszmanifest_maker._safe_data_filesdsJ 8> ?;;= =$)) N 8  &&((r:r)r`rarbr(rtrrr1r&r staticmethodr5r'r*r+rLrfr:r8rrsMH)  ) >";; -$, ))r:rrPcdj|}|jd}t|d5}|j|dddy#1swYyxYw)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}sOyy"Hw'H h  s A  Actjd||js|jj}|j |j c|_}|j|jc|_} |j|j||c|_|_t|jdd}tj|j|yy#||c|_|_wxYw)Nz writing %szip_safe)rrrr@r rrrOrqrDwrite_pkg_inforhrArwrite_safety_flag)cmdbasenamer|r oldveroldnamesafes r8rSrSsHH\8$ ;;##,,#&??H4D4D &!$x}} w > #H # #CLL 1.5v +HM8+s''T:##CLL$7 /6v +HM8+s 6CC+cy)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. NrfrUrVr|s r8warn_depends_obsoleter\sr:c tj|jjDcgc]}|j dddc}}|j d|dj t|dzycc}w)Nrrrztop-level namesrO)r{fromkeysr@iter_distribution_namesr!rrsorted)rUrVr|kpkgss r8write_toplevel_namesrcsk ==$'$4$4$L$L$N Q DNN$h &,0G$0NOsA>c t|||dy)NT) write_argr[s r8 overwrite_argrfs c8Xt,r:rctjj|d}t|j|d}|dj |dz}|j ||||y)NrrO)r"r#splitextrAr@rr)rUrVr|rargnamerys r8reres\ggx(+G C$$gt 4E  % 4'Whu=r:ctj|jj}tj|}|j d||dy)Nz entry pointsT)r rr@rrenderr)rUrVr|epsdefns r8 write_entriesrnsB   S--:: ;C    $D^XtTBr:ctj|}tj|}|d|d|xst}|r|d|z }|S)rrz-py)r rr)rqrrrrrDrOeggs r8rrsV  , ,X 6D// rs%< $0(81 ,!334'$$ %Qs'7'7'='=&> ?P;f,,^Y$z7Y$xGByGBTl)Ul)^ 8""44'@@P->d>t>C J <Jr: