Vc ddlZddlZddlZddlmZ ddlZn #e$rdZYnwxYwddlTddlm Z m Z ddl m Z m Z mZddlmZddlmZejdZd ZGd d ZGd d ZdZdS)N)message_from_file)*) FancyGetopttranslate_longopt) check_environ strtobool rfc822_escapelog)DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$ct|trn`t|tsKt|j}d|d|d}t jt j|t|}|S)Nz Warning: 'z' should be a list, got type '') isinstancestrlisttype__name__r WARN)value fieldnametypenamemsgs '/usr/lib64/python3.11/distutils/dist.py _ensure_listrsu%  t $ $;;'O9OOHOOO #U  LceZdZ gdZdZgdZdeDZddiZd)dZd Z d*d Z d Z d)d Z dZ dZdZdZddgfdZdZdZdZdZdZdZd+dZd)dZd,dZejfdZdZd Zd!Z d"Z!d#Z"d$Z#d%Z$d&Z%d'Z&d(Z'dS)- Distribution))verbosevzrun verbosely (default))quietqz!run quietly (turns verbosity off))zdry-runnzdon't actually do anything)helphzshow detailed help message)z no-user-cfgNz-ignore pydistutils.cfg in your home directoryzCommon commands: (see '--help-commands' for more) setup.py build will build the package underneath 'build/' setup.py install will install the package ))z help-commandsNzlist all available commands)nameNzprint package name)versionVzprint package version)fullnameNzprint -)authorNzprint the author's name) author-emailNz print the author's email address) maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)contactNz7print the maintainer's name if known, else the author's)z contact-emailNz@print the maintainer's email address if known, else the author's)urlNzprint the URL for this package)licenseNz print the license of the package)licenceNzalias for --license) descriptionNzprint the package description)zlong-descriptionNz"print the long package description) platformsNzprint the list of platforms) classifiersNzprint the list of classifiers)keywordsNzprint the list of keywords)providesNz+print the list of packages/modules provided)requiresNz+print the list of packages/modules required) obsoletesNz0print the list of packages/modules made obsoletec8g|]}t|dSrr).0xs r zDistribution.s%MMM-ad33MMMrr!rNc  d|_d|_d|_|jD]}t ||dt |_|jjD]+}d|z}t ||t|j|,i|_ d|_ d|_ d|_ i|_ g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|r|d}|S|d=|D];\}}| |}|D] \} } d| f|| < )$.5mmoo>>*Wk#33G<> c)7(= >E! 1#(#3i )$R1M#&&&&J$$S4Z000$kkmm ' ' c4=&3,77'8GDM6C<88====T]C00'DM34444T3'''D#s++++;d3iiGCM#&&&&"   '  ~~c**E/)).D&E rcX |j|}| ix}|j|<|SN)rPra)rnrsdicts rrczDistribution.get_option_dict&s> #''00  635 5D4'0 rr@cddlm}|&t|j}||||z|dz}|s||dzdS|D]}|j|}|||d|zz:||d|zz||}|dD]}||dz|zdS)Nr)pformatz zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:rB)pprintrsortedrPkeysannouncerasplit) rnheadercommandsindentrcmd_nameruoutlines rdump_option_dictszDistribution.dump_option_dicts1s`""""""  ;d27799::H  # MM&6/ * * *d]F  MM&#:: ; ; ; F 8 8H+//99H 8 f?(JKLLLL f=HIJJJgh''IIdOO88DMM&4-$"677778 8 8rc" g}ttjtjdj}tj|d}tj|r| |tj dkrd}nd}|j rqtjtj d|}tj|r| |d}tj|r| |tr+|dd |z|S) N distutilsz distutils.cfgposixz.pydistutils.cfgzpydistutils.cfg~z setup.cfgzusing config files: %sz, )rospathdirnamerfmodules__file__joinisfileappendr&rk expanduserr r)rnfilessys_dirsys_file user_filename user_file local_files rfind_config_fileszDistribution.find_config_filesMsM '//#+k":"CDD7<<99 7>>( # # # LL " " " 7g  ..MM-M   ( RW%7%7%<%>* % % % LL $ $ $  G MM2TYYu5E5EE F F F rcddlm}tjtjkrgd}ng}t |}||}tr|d|}|D]}tr|d|z| || D]n}| |}| |}|D]?} | dkr7| |vr3| || } | dd} || f|| <@o|d |jvr|jd D]\} \} } |j | } | r t'|| t)|  n4| d vrt'|| t)| nt'|| | z#t*$r} t-| d} ~ wwxYwdSdS) Nr) ConfigParser) z install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-dataprefixz exec-prefixhomeuserrootz"Distribution.parse_config_files():z reading %srrD_global)rrE) configparserrrfr base_prefix frozensetrr rreadsectionsrArcrareplacerzrPrb negative_optrGr ValueErrorDistutilsOptionError)rn filenamesrignore_optionsparserfilenamesectionrArurvrwsrcaliasrs rparse_config_fileszDistribution.parse_config_files}s}------ : ( (((NN  N">22  1..00I  @ MM> ? ? ?!  H 9 nx7888 KK ! ! !!??,, 8 8 ..11//88"88Cj(8S-F8$jj55!kk#s33)13 8 OO     t+ + 4%)%9(%C%I%I%K%K 4 4!jsC)--c2240e3-?@@@@ 660c9S>>::::c3///!444.s3334 4 4 4 4sAG%% H/G>>Hcn |}g|_t||jz}||j|ddi||j|}| }tj |j | |rdS|r|||}|dS||jr5||t#|jdk|jdS|jst%ddS)Nr0r/)argsobjectrdisplay_optionsrzno commands suppliedT)_get_toplevel_optionsrrrset_negative_aliasesr set_aliasesgetoptrOget_option_orderr set_verbosityrhandle_display_options_parse_command_optsr$ _show_helplenDistutilsArgError)rntoplevel_optionsrr option_orders rparse_command_linezDistribution.parse_command_lines` , 5577 -0DDEE##D$5666Iy1222}}$"24}@@..00  $,'''  & &| 4 4  F ++FD99D   9  OOF,/ ,>,>!,C%)]  4 4 4 F} <#$:;; ;trc |jdgzS)N)zcommand-packages=Nz0list of packages that provide distutils commands)global_optionsrns rrz"Distribution._get_toplevel_optionss$ " A& rc ddlm}|d}t|st d|z|j| ||}n!#t$r}t|d}~wwxYwt||std|zt|drt|jtsd}t||z|j}t|dr.|}||jt|dr/t|jtrt)|j}ng}||j|jz|z||||d d\}} t| d r"| jr||d|g dSt|drt|jtrjd} |jD]\\} } } }t| || r2d } t9|r |Ftd |d | d]| rdS||}t=| D] \}}d|f||< |S)NrCommandzinvalid command name '%s'z&command class %s must subclass Command user_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)r help_optionsr r$rzinvalid help function z for help option 'z-': must be a callable object (function, etc.)z command line) distutils.cmdr command_rematch SystemExitrrget_command_classDistutilsModuleErrorr issubclassDistutilsClassErrorrirrrrcopyupdaterfix_help_optionsset_option_tablerrrr$r get_attr_namecallablercvarsrb)rnrrrrs cmd_classrrroptshelp_option_found help_optionshortdescfuncrur&rs rrz Distribution._parse_command_optssZ  *)))))q'(( D87BCC C W%%%  )..w77II# ) ) )#C(( ( ) )W-- F%89DFF F  >22 791488 7>C%cIo66 6( 9n - - 8',,..L    6 7 7 7 I~ . . 91488 +I,BCCLLL  3 ) 6!7 ,!- . . . ##L111}}T!""X.. t 4  TY  OOFA O L L L F I~ . . 91488  4=4J 3 30eT44!5!5k!B!BCC3&'%~~311 $tt[[[2333 3! ''00!$ZZ--// 5 5MT5,e4HTNN sA-- B 7BB c dD]d}t|j|}|t|tr5d|dD}t |j||edS)Nr4r2c6g|]}|Sstrip)r;elms rr=z1Distribution.finalize_options..js AAAAAAr,)rKrIrrrrG)rnrprs rrmzDistribution.finalize_options`s . 4 4DDM400E %%% 4AA C0@0@AAA tU333  4 4rr cj ddlm}ddlm}|r_|r|}n|j}||||jdztd|r>||j |dtd|j D]}t|trt||r|} n||} t!| drJt| jt$r0|| jt)| jzn|| j|d| jztdt||jdS) Nr gen_usagerz Global options:r@zKInformation display options (just display information, ignore any commands)rzOptions for '%s' command:)distutils.corerrrrrr print_help common_usageprintrrrrrrrirrrrrrN) rnrrrrrrrArsklasss rrzDistribution._show_helpms  -,,,,,))))))   .4466-  # #G , , ,   d/2EE F F F "III    # #D$8 9 9 9   4 5 5 5 "III}  G'4(( 8Z-I-I 8..w77~.. <u1488 <''(:(89K(L(L)MNNNN''(:;;;   9ENJ K K K "IIII ii())*****rc2 ddlm}|jrB|t dt ||jdSd}i}|jD] }d||d<|D]\}}|r||rt|}t|j d|z}|dvr#t d |n6|dvr#t d |nt |d}|S) Nrrr@r r?rr)r3r5r6r7rB) rr help_commandsprint_commandsrrNrrarrKrIr) rnrrany_display_optionsis_display_optionoptionrvrwrs rrz#Distribution.handle_display_optionssb -,,,,,       ! ! ! "III ))D,-- . . .1  * - -F+, fQi ( (& ( (JS# ((,,S11 (',,: vcz::<<33!#((5//******!$))E**++++%LLL&'#""rc t|dz|D]c}|j|}|s||} |j}n#t $rd}YnwxYwtd|||fzddS)N:(no description available)z %-*s %s)rrLrarr1AttributeError)rnrr max_lengthcmdrr1s rprint_command_listzDistribution.print_command_lists  fsl A ACM%%c**E 4..s33 ;#/ ! ; ; ;:  ; ,*c;!?? @ @ @ @ A As A A! A!c ddl}|jj}i}|D]}d||<g}|jD],}||s||-d}||zD]$}t||krt|}%||d||r't||d|dSdS)Nrr zStandard commandszExtra commands) distutils.commandrs__all__rLrrarrrr)rnr std_commandsis_stdrextra_commandsrs rrzDistribution.print_commandss'  !    (0   CF3KK=%%'' + +C::c?? +%%c***  >1 & &C3xx*$ & XX   3 * , , ,  0 GGG  # #N$4$. 0 0 0 0 0 0 0rc ddl}|jj}i}|D]}d||<g}|jD],}||s||-g}||zD]e}|j|}|s||} |j}n#t$rd}YnwxYw|||ff|S)Nrr r) rrsr rLrrarrr1r) rnrr r rr rvrr1s rget_command_listzDistribution.get_command_lists#  !    (0   CF3KK=%%'' + +C::c?? +%%c***  >1 * *CM%%c**E 4..s33 ;#/ ! ; ; ;:  ; IIsK( ) ) ) ) s!B)) B87B8c |j}t|tsD|d}d|dD}d|vr|dd||_|S)Nr@cBg|]}|dk|S)r@r)r;pkgs rr=z5Distribution.get_command_packages..!s)HHHCcRiHCIIKKHHHrrzdistutils.commandr)rMrrrinsert)rnpkgss rget_command_packagesz!Distribution.get_command_packagessxG$$%% ) HH4::c??HHHD"$. 4 A2333$(D ! rc  |j|}|r|S|D]}|d|}|} t|tj|}n#t $rY:wxYw t||}n'#t$rtd|d|d|dwxYw||j|<|cStd|z)N.zinvalid command 'z ' (no class 'z ' in module 'z')zinvalid command '%s') rLrar __import__rfr ImportErrorrKrr)rnrsrpkgname module_name klass_namemodules rrzDistribution.get_command_class's%  !!'**  L0022  G%,WWgg6K J ;'''[1     : 33! : : :**ww KKK9::: : &+DM' "LLL"#9G#CDDDs!A"" A/.A/3B$B(cN |j|}|s|rtr|d|z||}||x}|j|<d|j|<|j|}|r||||S)Nz.|s6CCC!"/q11CCCrz error in z : command 'z' has no such option 'r)get_command_namercr rrbboolean_optionsrrrrrGrrirr) rnr_ option_dict command_namersourcer bool_optsneg_opt is_stringrs rrz!Distribution._set_command_optionshsF #3355  =..|<N>N:NOOOOy(:Y:K51A1ABBBB[&11:K7777..!66<<<9::: 0 0 0*3/// 05 0 0s=B"" B10B15B== C  C B!E33 F=F  Frcp ddlm}t||s|}||}n|}|js|S|d|_d|j|<|||r-| D]}| |||S)Nrr) rrrr"r' finalizedinitialize_optionsr`rget_sub_commandsreinitialize_command)rnrsreinit_subcommandsrr*subs rr3z!Distribution.reinitialize_commands $ *)))))'7++ 6"L**<88GG"3355L  N""$$$&' l# !!'***  C//11 C C))#/ABBBBrc0tj||dSr|r )rnrlevels rrzDistribution.announces srcF |jD]}||dSr|)r run_command)rnrs r run_commandszDistribution.run_commandss; = " "C   S ! ! ! ! " "rc |j|rdStjd|||}||d|j|<dS)Nz running %sr )r`rar infor"ensure_finalizedrun)rnrsr!s rr9zDistribution.run_commands|  =  W % %  F w'''&&w//  """ !" grcDt|jp|jpgdkSNr)rrRrUrs rhas_pure_moduleszDistribution.has_pure_moduless#4=9DO9r::Q>>rc@|jot|jdkSr@)rXrrs rhas_ext_moduleszDistribution.has_ext_moduless =C(8$9$9A$==rc@|jot|jdkSr@)rVrrs rhas_c_librarieszDistribution.has_c_librariess~9#dn"5"5"99rcR|p|Sr|)rArCrs r has_moduleszDistribution.has_moduless%$$&&@$*>*>*@*@@rc@|jot|jdkSr@)rWrrs r has_headerszDistribution.has_headers|5DL 1 1A 55rc@|jot|jdkSr@)r\rrs r has_scriptszDistribution.has_scriptsrJrc@|jot|jdkSr@)r]rrs rhas_data_fileszDistribution.has_data_filess;3t#7#7!#;;rc~|o)| o| Sr|)rArCrErs ris_purezDistribution.is_puresD%%''+((***+((*** ,rr|)NNr@)r r9)(r __module__ __qualname__rrrrFrrzrcrrrrrrrmrrrrrrrr"rr3r INFOrr:r9rArCrErGrIrLrNrPrrrrr,s *NL+ + + OXNM_MMMY'L\ \ \ \ |   88888...`64646464tAAAF   YYYv 4 4 41210+0+0+0+d&#&#&#PAAA"000BD   $E$E$EL6*0*0*0*0X%%%%R#&("""###(???>>>:::AAA666666<<<,,,,,rrceZdZ dZd"dZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZeZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#dS)#rH)r&r'r* author_emailr,maintainer_emailr.r/r1long_descriptionr4r2r)r- contact_emailr3 download_urlr5r6r7Nc@|$|t|dSd|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_d|_dSr|) read_pkg_fileopenr&r'r*rUr,rVr.r/r1rWr4r2r3rYr5r6r7)rnrs rrzzDistributionMetadata.__init__ s  "   tDzz * * * * *DIDLDK $D "DO$(D !DHDL#D $(D ! DM!DN#D  $D  DM DM!DNNNrc t|fd}fd}d}|d|_|d|_|d|_|d|_d|_|d|_d|_|d |_|d |_ d vr|d |_ nd|_ |d |_ |d|_d vr#|d  d|_ |d|_|d|_|dkr2|d|_|d|_|d|_dSd|_d|_d|_dS)Nc(|}|dkrdS|SNUNKNOWNr)r&rrs r _read_fieldz7DistributionMetadata.read_pkg_file.._read_field(s#IE ! tLrcD|d}|gkrdS|Sr|)get_all)r&valuesrs r _read_listz6DistributionMetadata.read_pkg_file.._read_list.s,[[t,,F| tMrzmetadata-versionr&r'summaryr*r+z home-pager/z download-urlr1r4rplatform classifier1.1r6r5r7)rr&r'r1r*r,rUrVr.r/rYrWrr4r2r3r6r5r7)rnfileraremetadata_versionrs @rr[z"DistributionMetadata.read_pkg_file$s;%%            12K'' "{9-- &;y11!k(++ 'K77 $;{++"{9-- S  % + N ; ;D   $D  + M : :&;y11   ?'K 3399#>>DM#J//%:l33 u $ "&Jz22DM&Jz22DM'Z 44DNNN DM DM!DNNNrc ttj|ddd5}||ddddS#1swxYwYdS)NzPKG-INFOwzUTF-8)encoding)r\rrrwrite_pkg_file)rnbase_dirpkg_infos rwrite_pkg_infoz#DistributionMetadata.write_pkg_infoXs "',,x44c"$$$ *'/    ) ) ) * * * * * * * * * * * * * * * * * *sAAAc d}|js|js|js|js|jrd}|d|z|d|z|d|z|d|z|d| z|d| z|d | z|d | z|jr|d |jzt|}|d |zd |}|r|d|z||d|||d|||d|||d|||d|dS)Nz1.0rizMetadata-Version: %s z Name: %s z Version: %s z Summary: %s zHome-page: %s z Author: %s zAuthor-email: %s z License: %s zDownload-URL: %s zDescription: %s rz Keywords: %s Platform ClassifierRequiresProvides Obsoletes)r5r6r7r3rYrhget_name get_versionget_descriptionget_url get_contactget_contact_email get_licenser get_long_descriptionr get_keywords _write_list get_platformsget_classifiers get_requires get_provides get_obsoletes)rnrjr' long_descr4s rroz#DistributionMetadata.write_pkg_file_s  M T] dn   $($5 G +g5666 <$--//1222 ?T%5%5%7%77888 ?T%9%9%;%;;<<< $t||~~5666 >D$4$4$6$66777 '$*@*@*B*BBCCC ?T%5%5%7%77888   A JJ+d.?? @ @ @!$";";"="=>>  &233388D--//00  4 JJ'(2 3 3 3 z4+=+=+?+?@@@ |T-A-A-C-CDDD z4+<+<+>+>??? z4+<+<+>+>??? {D,>,>,@,@AAAAArcF|D]}||d|ddS)Nz: rB)rh)rnrjr&rdrs rrz DistributionMetadata._write_lists= 3 3E JJTTT5551 2 2 2 2 3 3rc|jpdSr_)r&rs rryzDistributionMetadata.get_namesy%I%rc|jpdS)Nz0.0.0)r'rs rrzz DistributionMetadata.get_versions|&w&rcX|d|S)NrD)ryrzrs r get_fullnamez!DistributionMetadata.get_fullnames(--////4+;+;+=+=+=>>rc|jpdSr_)r*rs r get_authorzDistributionMetadata.get_authors{'i'rc|jpdSr_)rUrs rget_author_emailz%DistributionMetadata.get_author_email -I-rc|jpdSr_)r,rs rget_maintainerz#DistributionMetadata.get_maintainers+)+rc|jpdSr_)rVrs rget_maintainer_emailz)DistributionMetadata.get_maintainer_email$1 1rc"|jp|jpdSr_)r,r*rs rr}z DistributionMetadata.get_contacts:$+::rc"|jp|jpdSr_)rVrUrs rr~z&DistributionMetadata.get_contact_emails$F(9FYFrc|jpdSr_)r.rs rr|zDistributionMetadata.get_urlsx$9$rc|jpdSr_)r/rs rrz DistributionMetadata.get_licenses|(y(rc|jpdSr_)r1rs rr{z$DistributionMetadata.get_descriptions,9,rc|jpdSr_)rWrs rrz)DistributionMetadata.get_long_descriptionrrc|jpgSr|)r4rs rrz!DistributionMetadata.get_keywords}""rc0t|d|_dS)Nr4)rr4rnrs r set_keywordsz!DistributionMetadata.set_keywordss$UJ77 rc|jpdgSr_)r2rs rrz"DistributionMetadata.get_platformss~,),rc0t|d|_dS)Nr2)rr2rs r set_platformsz"DistributionMetadata.set_platformss%e[99rc|jpgSr|)r3rs rrz$DistributionMetadata.get_classifierss%2%rc0t|d|_dS)Nr3)rr3rs rset_classifiersz$DistributionMetadata.set_classifierss'}==rc|jpdSr_)rYrs rget_download_urlz%DistributionMetadata.get_download_urlrrc|jpgSr|)r6rs rrz!DistributionMetadata.get_requiresrrctddl}|D]}|j|t||_dSr@)distutils.versionpredicateversionpredicateVersionPredicaterr6rnrrrs r set_requiresz!DistributionMetadata.set_requiressH)))) ; ;A  & 7 7 : : : :U  rc|jpgSr|)r5rs rrz!DistributionMetadata.get_providesrrcrd|D}|D] }ddl}|j|!||_dS)Nc6g|]}|Srr)r;rs rr=z5DistributionMetadata.set_provides..s ***q***rr)rrsplit_provisionr5)rnrrrs r set_providesz!DistributionMetadata.set_providessU**E*** : :A - - - -  & 6 6q 9 9 9 9 rc|jpgSr|)r7rs rrz"DistributionMetadata.get_obsoletess~##rctddl}|D]}|j|t||_dSr@)rrrrr7rs r set_obsoletesz"DistributionMetadata.set_obsoletessH)))) ; ;A  & 7 7 : : : :err|)$rrQrRrJrzr[rrrorryrzrrrrrr}r~r|r get_licencer{rrrrrrrrrrrrrrrrrrHrHs"""".2"2"2"h*** B B BD333 &&&'''???(((...,,,222;;;GGG%%%)))K---222###888---:::&&&>>>...###$$$ ###$$$%%%%%rrHcP g}|D]}||dd |S)Nr)r)rA new_options help_tuples rrrsBK,, :ac?++++ r)rfrreemailrrdrdistutils.errorsdistutils.fancy_getoptrrdistutils.utilrrr rr distutils.debugr compilerrrrHrrrrrss  ######OOOOHHHAAAAAAAABBBBBBBBBB!!!!!! RZ4 5 5    J,J,J,J,J,J,J,J,f`%`%`%`%`%`%`%`%Ds $$