Vccs ddlZddlZddlZddlmZ ddlZn #e$rdZYnwxYwddlTddlm Z m Z ddl m Z m Z mZddlmZddlmZejdZd ZGd d ZGd d ZdZdS)N)message_from_file)Z*) FancyGetopttranslate_longopt) check_environ strtobool rfc822_escapelog)DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$cst|trn`t|tsKt|j}d|d|d}t jt j|t|}|S)Nz Warning: 'z' should be a list, got type '') isinstancestrlisttype__name__rZWARN)valueZ fieldnameZtypenamemsg '/usr/lib64/python3.11/distutils/dist.py _ensure_listrsu%  t $ $;;'O9OOHOOO #U  LcseZdZ 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))quietZqz!run quietly (turns verbosity off))zdry-runZnzdon't actually do anything)helpZhzshow 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)versionZVzprint 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 obsoletecs8g|]}t|dSrr).0Zx r zDistribution.s%MMM-ad33MMMrrrNc s 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 rcsX |j|}| ix}|j|<|SN)rBrL)rUrWZdict rrNzDistribution.get_option_dict&s> #''00  635 5D4'0 rr3csddlm}|&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:r5)Zpprintr_ZsortedrBkeysannouncerLsplit) rUheadercommandsZindentr_Zcmd_namerXZoutZline 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 8rcs" g}ttjtjdj}tj|d}tj|r| |tj dkrd}nd}|j rqtjtj d|}tj|r| |d}tj|r| |tr+|dd |z|S) N distutilsz distutils.cfgZposixz.pydistutils.cfgzpydistutils.cfgz~z setup.cfgzusing config files: %sz, )rospathZdirnamerPmodulesZ__file__joinZisfileappendrrSZ expanduserr ra)rUZfilesZsys_dirZsys_fileZ user_filenameZ user_fileZ local_file rfind_config_fileszDistribution.find_config_filesMsM '//#+k":"CDD7<<99 7>>( # # # LL " " " 7g  ..MM-M   ( RW%7%7%<%>* % % % LL $ $ $  G MM2TYYu5E5EE F F F rcsddlm}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-prefixZhomeZuserZrootz"Distribution.parse_config_files():z reading %srr6Z_Zglobal)rr7)Z configparserrorPrpZ base_prefixZ frozensetrnr raZreadZsectionsr4rNrLZreplacer\rBrM negative_optr9r ValueErrorDistutilsOptionError)rUZ filenamesroZignore_optionsparserZfilenameZsectionr4rXrYrZZsrcZaliasrr[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>>Hcsn |}g|_t||jz}||j|ddi||j|}| }tj |j | |rdS|r|||}|dS||jr5||t#|jdk|jdS|jst%ddS)Nr%r$)argsZobjectrdisplay_optionsrdzno commands suppliedT)_get_toplevel_optionsrdrrxset_negative_aliasesrqZ set_aliasesgetoptrAZget_option_orderrZ set_verbosityrhandle_display_options_parse_command_optsr _show_helplenDistutilsArgError)rUZtoplevel_optionsrtrv option_order rparse_command_linezDistribution.parse_command_lines` , 5577 -0DDEE##D$5666Iy1222}}$"24}@@..00  $,'''  & &| 4 4  F ++FD99D   9  OOF,/ ,>,>!,C%)]  4 4 4 F} <#$:;; ;trcs |jdgzS)N)zcommand-packages=Nz0list of packages that provide distutils commands)global_optionsrU rryz"Distribution._get_toplevel_optionss$ " A& rcs 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)rq help_optionsrrrwzinvalid help function z for help option 'z-': must be a callable object (function, etc.)z command line) distutils.cmdr command_reZmatchZ SystemExitrdrlget_command_classDistutilsModuleErrorr issubclassZDistutilsClassErrorrRr rr rqZcopyZupdaterfix_help_optionsset_option_tablerrzr{rr~Z get_attr_nameZcallablerNZvarsrM)rUrtrvrrWZ cmd_classrrqrZoptsZhelp_option_foundZ help_optionZshortZdescZfuncrXrrs rr}z 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 cs dD]d}t|j|}|t|tr5d|dD}t |j||edS)Nr)r'c6g|]}|SZstrip)r/Zelmr0rr1z1Distribution.finalize_options..js AAAAAAr,)r=r;r r rbr9)rUrVrr^rrTzDistribution.finalize_options`s . 4 4DDM400E %%% 4AA C0@0@AAA tU333  4 4rrcsj 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:r3zKInformation display options (just display information, ignore any commands)rzOptions for '%s' command:)distutils.corerrrryrrZ print_help common_usageprintrxrdr rrrrRrr rrrr@) rUrtrrxrdrrr4rWklasss rr~zDistribution._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())*****rcs2 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) Nrrr3rr2rr)r(r*r+r,r5) rrZ help_commandsprint_commandsrr@rxrLrr=r;rk) rUrrZany_display_optionsZis_display_optionoptionrYrZrrerr|z#Distribution.handle_display_optionssb -,,,,,       ! ! ! "III ))D,-- . . .1  * - -F+, fQi ( (& ( (JS# ((,,S11 (',,: vcz::<<33!#((5//******!$))E**++++%LLL&'#""rcs t|dz|D]c}|j|}|s||} |j}n#t $rd}YnwxYwtd|||fzddS)Nz:(no description available)z %-*s %s)rr>rLrr&AttributeError)rUrdrc max_lengthcmdrr&rmrprint_command_listzDistribution.print_command_lists  fsl A ACM%%c**E 4..s33 ;#/ ! ; ; ;:  ; ,*c;!?? @ @ @ @ A As A A! A!cs ddl}|jj}i}|D]}d||<g}|jD],}||s||-d}||zD]$}t||krt|}%||d||r't||d|dSdS)NrrzStandard commandszExtra commands) distutils.commandrW__all__r>r`rLrlrrr)rUrg std_commandsis_stdrextra_commandsrrmrrzDistribution.print_commandss'  !    (0   CF3KK=%%'' + +C::c?? +%%c***  >1 & &C3xx*$ & XX   3 * , , ,  0 GGG  # #N$4$. 0 0 0 0 0 0 0rcs ddl}|jj}i}|D]}d||<g}|jD],}||s||-g}||zD]e}|j|}|s||} |j}n#t$rd}YnwxYw|||ff|S)Nrrr) rrWrr>r`rLrlrr&r) rUrgrrrrZrvrr&rerget_command_listzDistribution.get_command_lists#  !    (0   CF3KK=%%'' + +C::c?? +%%c***  >1 * *CM%%c**E 4..s33 ;#/ ! ; ; ;:  ; IIsK( ) ) ) ) s!B)) B87B8cs |j}t|tsD|d}d|dD}d|vr|dd||_|S)Nr3csBg|]}|dk|S)r3r)r/Zpkgr0rr1z5Distribution.get_command_packages..!s)HHHCcRiHCIIKKHHHrrzdistutils.commandr)r?r r rbZinsert)rUZpkgsr0rget_command_packagesz!Distribution.get_command_packagessxG$$%% ) HH4::c??HHHD"$. 4 A2333$(D ! rc s |j|}|r|S|D]}|d|}|} t|tj|}n#t $rY:wxYw t||}n'#t$rtd|d|d|dwxYw||j|<|cStd|z)Nz.zinvalid command 'z ' (no class 'z ' in module 'z')zinvalid command '%s') r>rLrZ __import__rPrj ImportErrorr=rr)rUrWrZpkgnameZ module_nameZ klass_nameZmodulermrrzDistribution.get_command_class's%  !!'**  L0022  G%,WWgg6K J ;'''[1     : 33! : : :**ww KKK9::: : &+DM' "LLL"#9G#CDDDs!A"" A/.A/3B$B(csN |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_namerNr rarMZboolean_optionsrrqr r r9rrRrsrr) rUrJZ option_dict command_namerZsourcerZ bool_optsZneg_optZ 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  Frcsp ddlm}t||s|}||}n|}|js|S|d|_d|j|<|||r-| D]}| |||S)Nrr) rrr rrZ finalizedZinitialize_optionsrKrZget_sub_commandsreinitialize_command)rUrWZreinit_subcommandsrrZsubrrrz!Distribution.reinitialize_commands $ *)))))'7++ 6"L**<88GG"3355L  N""$$$&' l# !!'***  C//11 C C))#/ABBBBrcs0tj||dSr]r)rUrZlevelr^rrazDistribution.announces srcsF |jD]}||dSr])rd run_command)rUrr0r run_commandszDistribution.run_commandss; = " "C   S ! ! ! ! " "rcs |j|rdStjd|||}||d|j|<dS)Nz running %sr)rKrLrZinforZensure_finalizedZrun)rUrWrr^rrzDistribution.run_commands|  =  W % %  F w'''&&w//  """ !" grcsDt|jp|jpgdkSNr)rrCrDrrrhas_pure_moduleszDistribution.has_pure_moduless#4=9DO9r::Q>>rc@|jot|jdkSr)rGrrrrhas_ext_moduleszDistribution.has_ext_moduless =C(8$9$9A$==rcrr)rErrrrhas_c_librarieszDistribution.has_c_librariess~9#dn"5"5"99rcsR|p|Sr])rrrrr has_moduleszDistribution.has_moduless%$$&&@$*>*>*@*@@rcrr)rFrrrr has_headerszDistribution.has_headers|5DL 1 1A 55rcrr)rHrrrr has_scriptszDistribution.has_scriptsrrcrr)rIrrrrhas_data_fileszDistribution.has_data_filess;3t#7#7!#;;rcs~|o)| o| Sr])rrrrrris_purezDistribution.is_puresD%%''+((***+((*** ,rr])NNr3)rr-)(r __module__ __qualname__rrrxr8rqr\rNrfrnrurryr}rTr~r|rrrrrrrrrZINFOrarrrrrrrrrrrrrrr,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<<<,,,,,rrcseZdZ dZd"dZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZeZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#dS)#r:)rrr author_emailr!maintainer_emailr#r$r&long_descriptionr)r'rr"Z contact_emailr( download_urlr*r+r,Ncs@|$|t|dSd|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_d|_dSr]) read_pkg_fileopenrrrrr!rr#r$r&rr)r'r(rr*r+r,)rUrir0rr\zDistributionMetadata.__init__ s  "   tDzz * * * * *DIDLDK $D "DO$(D !DHDL#D $(D ! DM!DN#D  $D  DM DM!DNNNrcs 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)Ncs(|}|dkrdS|SNZUNKNOWNr)rrr r _read_fieldz7DistributionMetadata.read_pkg_file.._read_field(s#IE ! tLrcsD|d}|gkrdS|Sr])Zget_all)rvaluesrrr _read_listz6DistributionMetadata.read_pkg_file.._read_list.s,[[t,,F| tMrzmetadata-versionrrZsummaryrr z home-pager$z download-urlr&r)rZplatformZ classifier1.1r+r*r,)rrrr&rr!rrr#r$rrrbr)r'r(r+r*r,)rUfilerrZmetadata_versionrs @rrz"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!DNNNrcs ttj|ddd5}||ddddS#1swxYwYdS)NzPKG-INFOZwzUTF-8)Zencoding)rrhrirkwrite_pkg_file)rUZbase_dirZpkg_infor^rwrite_pkg_infoz#DistributionMetadata.write_pkg_infoXs "',,x44c"$$$ *'/    ) ) ) * * * * * * * * * * * * * * * * * *sAAAcs 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.0rzMetadata-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 ZPlatformZ ClassifierZRequiresZProvidesZ Obsoletes)r*r+r,r(rrQget_name get_versionget_descriptionget_url get_contactget_contact_email get_licenserget_long_descriptionrk get_keywords _write_list get_platformsget_classifiers get_requires get_provides get_obsoletes)rUrrZ long_descr)rrrz#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,>,>,@,@AAAAArcsF|D]}||d|ddS)Nz: r5)rQ)rUrrrrrrrz DistributionMetadata._write_lists= 3 3E JJTTT5551 2 2 2 2 3 3rc|jpdSr)rrrrrzDistributionMetadata.get_namesy%I%rcr)Nz0.0.0)rrrrrz DistributionMetadata.get_versions|&w&rcsX|d|S)Nr6)rrrrr get_fullnamez!DistributionMetadata.get_fullnames(--////4+;+;+=+=+=>>rcrr)rrrr get_authorzDistributionMetadata.get_authors{'i'rcrr)rrrrget_author_emailz%DistributionMetadata.get_author_email -I-rcrr)r!rrrget_maintainerz#DistributionMetadata.get_maintainers+)+rcrr)rrrrget_maintainer_emailz)DistributionMetadata.get_maintainer_email$1 1rc"|jp|jpdSr)r!rrrrrz DistributionMetadata.get_contacts:$+::rcrr)rrrrrrz&DistributionMetadata.get_contact_emails$F(9FYFrcrr)r#rrrrzDistributionMetadata.get_urlsx$9$rcrr)r$rrrrz DistributionMetadata.get_licenses|(y(rcrr)r&rrrrz$DistributionMetadata.get_descriptions,9,rcrr)rrrrrz)DistributionMetadata.get_long_descriptionrrc|jpgSr])r)rrrrz!DistributionMetadata.get_keywords}""rc0t|d|_dS)Nr))rr)rUrr0r set_keywordsz!DistributionMetadata.set_keywordss$UJ77 rcs|jpdgSr)r'rrrrz"DistributionMetadata.get_platformss~,),rcr)Nr')rr'rr0r set_platformsz"DistributionMetadata.set_platformss%e[99rcrr])r(rrrrz$DistributionMetadata.get_classifierss%2%rcr)Nr()rr(rr0rset_classifiersz$DistributionMetadata.set_classifierss'}==rcrr)rrrrget_download_urlz%DistributionMetadata.get_download_urlrrcrr])r+rrrrz!DistributionMetadata.get_requiresrrctddl}|D]}|j|t||_dSr)distutils.versionpredicateversionpredicateVersionPredicater r+rUrrgrrr set_requiresz!DistributionMetadata.set_requiressH)))) ; ;A  & 7 7 : : : :U  rcrr])r*rrrrz!DistributionMetadata.get_providesrrcsrd|D}|D] }ddl}|j|!||_dS)Ncrrr)r/rr0rr1z5DistributionMetadata.set_provides..s ***q***rr)rrZsplit_provisionr*)rUrrrgrr set_providesz!DistributionMetadata.set_providessU**E*** : :A - - - -  & 6 6q 9 9 9 9 rcrr])r,rrrrz"DistributionMetadata.get_obsoletess~##rcrr)rrrr r,rrr set_obsoletesz"DistributionMetadata.set_obsoletessH)))) ; ;A  & 7 7 : : : :err])$rrrr<r\rrrrrrrrrrrrrrrZ get_licencerrrrrrrrrrrrrrrrrrr:r:s"""".2"2"2"h*** B B BD333 &&&'''???(((...,,,222;;;GGG%%%)))K---222###888---:::&&&>>>...###$$$ ###$$$%%%%%rr:csP g}|D]}||dd |S)Nri)rl)r4Z new_optionsZ help_tupler^rrrsBK,, :ac?++++ r)rPrhZreZemailrrOrZdistutils.errorsZdistutils.fancy_getoptrrZdistutils.utilrrrrgrZdistutils.debugr Zcompilerrrr:rrrrrss  ######OOOOHHHAAAAAAAABBBBBBBBBB!!!!!! RZ4 5 5    J,J,J,J,J,J,J,J,f`%`%`%`%`%`%`%`%Ds $$