hVSrSSKJr SSKrSSKrSSKrSSKrSSKJr SSK J r J r SSK J r JrJrJrJr SSKJrJrJrJrJr SS KJr SS KJr \ (aSS KJr SS KJrJ r \"S 5r!\"SSS9r"\"SSS9r#\"SSS9r$"SS5r%g)ztdistutils.cmd Provides the Command class, the base class for the command classes in the distutils.command package. ) annotationsN)abstractmethod)CallableMutableSequence) TYPE_CHECKINGAnyClassVarTypeVaroverload) _modified archive_utildir_util file_utilutillog)DistutilsOptionError Distribution) TypeVarTupleUnpack_Ts _StrPathTstr | os.PathLike[str])bound _BytesPathTbytes | os.PathLike[bytes] _CommandTCommandc\rSrSr%Sr/rS\S'/rS\S'S/SjrSr S0S jr \ S0S j5r \ S0S j5r S1S jr\ S0Sj5r\R"4S2SjjrS3SjrS4SjrS4S5SjjrS6SjrS4SjrS6SjrS6SjrS7SjrS8SjrS9S:Sjjr\S;SSjjrS?SjrS@Sjr S3Sjr!SASBS jjr"SCSDS!jjr#\SESFS"jj5r$\SESGS#jj5r$SESHS$jjr$SISJS%jjr%\SKSLS&jj5r&\SKSMS'jj5r&SKSNS(jjr&SOSPS)jjr'\SQSRS*jj5r(\SSSTS+jj5r(SQSUS,jjr(SVSWS-jjr)S.r*g )Xr "aIAbstract base class for defining command classes, the "worker bees" of the Distutils. A useful analogy for command classes is to think of them as subroutines with local variables called "options". The options are "declared" in 'initialize_options()' and "defined" (given their final values, aka "finalized") in 'finalize_options()', both of which must be defined by every command class. The distinction between the two is necessary because option values might come from the outside world (command line, config file, ...), and any options dependent on other options must be computed *after* these outside influences have been processed -- hence 'finalize_options()'. The "body" of the subroutine, where it does all its work based on the values of its options, is the 'run()' method, which must also be implemented by every command class. z8ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] sub_commandszHClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]] user_optionscSSKJn [X5(d [S5eUR[ La [ S5eXlUR5 SUl URUl SUl SUl SUl g)zCreate and initialize a new Command object. Most importantly, invokes the 'initialize_options()' method, which is the real initializer and depends on the actual command being instantiated. rrz$dist must be a Distribution instancezCommand is an abstract classNF)distutils.distr isinstance TypeError __class__r RuntimeError distributioninitialize_options_dry_runverboseforcehelp finalized)selfdistrs ;/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py__init__Command.__init__Ksy 0$--BC C >>W $=> >  ! ||   cxUS:Xa*[USU-5nUc[URU5$U$[U5e)Ndry_run_)getattrr+AttributeError)r2attrmyvals r4 __getattr__Command.__getattr__{sB 9 D#*-E}t00$77  & &r7cTUR(dUR5 SUlg)NT)r1finalize_optionsr2s r4ensure_finalizedCommand.ensure_finalizeds~~  ! ! #r7c4[SURS35e)aSet default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_options()' implementations are just a bunch of "self.foo = None" assignments. This method must be implemented by all command classes. abstract method -- subclass  must overrider*r)rCs r4r,Command.initialize_options"*4>>*:. I  r7c4[SURS35e)aSet final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in 'initialize_options()'. This method must be implemented by all command classes. rGrHrIrCs r4rBCommand.finalize_optionss"*4>>*:. I  r7NcTSSKJn UcSUR5S3nURX!-[R S9 US-nUR HVun nURU5nUSS:XaUSSn[X5nURX$S U3-[R S9 MX g) Nr) longopt_xlatezcommand options for 'z':)levelz =z = ) distutils.fancy_getoptrOget_command_nameannounceloggingINFOr$ translater;)r2headerindentrOoptionr:values r4 dump_optionsCommand.dump_optionss8 >,T-B-B-D,ERHF foW\\ :$ --LFAq%%m4FbzS D)E MM&XS#88 M M .r7c4[SURS35e)aA command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'. All terminal output and filesystem interaction should be done by 'run()'. This method must be implemented by all command classes. rGrHrIrCs r4run Command.runrKr7c0[R"X!5 gNr)r2msgrPs r4rUCommand.announces r7crSSKJn U(a*[U5 [RR 5 gg)znPrint 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true. r)DEBUGN)distutils.debugrgprintsysstdoutflush)r2rdrgs r4 debug_printCommand.debug_prints& *  #J JJ    r7c [X5nUc[XU5 U$[U[5(d[ SUSUSUS35eU$)N'z ' must be a z (got `z`))r;setattrr'strr)r2r[whatdefaultvals r4_ensure_stringlikeCommand._ensure_stringlikesSd# ; D' *NC%%&6(,tfGC5PR'ST T r7c*URUSU5 g)zGEnsure that 'option' is a string; if not defined, set it to 'default'. stringN)rv)r2r[rts r4 ensure_stringCommand.ensure_strings ':r7c[X5nUcg[U[5(a"[X[R "SU55 g[U[ 5(a[SU55nOSnU(d[SUSU<S35eg)zEnsure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. Nz,\s*|\s+c3B# UHn[U[5v M g7frc)r'rr).0vs r4 -Command.ensure_string_list.. s9SAs++SsFrpz!' must be a list of strings (got )) r;r'rrrqresplitlistallr)r2r[ruoks r4ensure_string_listCommand.ensure_string_lists d# ;  S ! ! D"((;"< =#t$$9S99*x@qIr7cnURXU5nUb U"U5(d[SU-X4-5egg)Nzerror in '%s' option: )rvr)r2r[testerrs error_fmtrtrus r4_ensure_tested_stringCommand._ensure_tested_stringsD%%fG< ?6#;;&)I5&F $/?r7c\URU[RRSS5 g)z5Ensure that 'option' is the name of an existing file.filenamez$'%s' does not exist or is not a fileN)rospathisfiler2r[s r4ensure_filenameCommand.ensure_filenames" "" BGGNNJ0V r7c\URU[RRSS5 g)Nzdirectory namez)'%s' does not exist or is not a directory)rrrisdirrs r4ensure_dirnameCommand.ensure_dirnames$ ""  GGMM  7  r7ch[US5(a UR$URR$)N command_name)hasattrrr)__name__rCs r4rTCommand.get_command_name(s+ 4 ( ($$ $>>** *r7c URRU5nUR5 UH(upE[X5bM[ X[X455 M* g)aSet the values of any "undefined" options from corresponding option values in some other command object. "Undefined" here means "is None", which is the convention used to indicate that an option has not been changed between 'initialize_options()' and 'finalize_options()'. Usually called from 'finalize_options()' for options that depend on some other command rather than another option of the same command. 'src_cmd' is the other command from which option values will be taken (a command object will be created for it if necessary); the remaining arguments are '(src_option,dst_option)' tuples which mean "take the value of 'src_option' in the 'src_cmd' command object, and copy it to 'dst_option' in the current command object". N)r+get_command_objrDr;rq)r2src_cmd option_pairs src_cmd_obj src_option dst_options r4set_undefined_optionsCommand.set_undefined_options.sM"''77@ $$&&2 "Jt(0'+*JK'3r7c\URRX5nUR5 U$)zWrapper around Distribution's 'get_command_obj()' method: find (create if necessary and 'create' is true) the command object for 'command', call its 'ensure_finalized()' method, and return the finalized command object. )r+rrD)r2commandcreatecmd_objs r4get_finalized_commandCommand.get_finalized_commandGs+ ##33GD  "r7cgrcr2rreinit_subcommandss r4reinitialize_commandCommand.reinitialize_commandSsr7cgrcrrs r4rrWsr7c8URRX5$rc)r+rrs r4rr[s  55gRRr7c:URRU5 g)zRun some other command: uses the 'run_command()' method of Distribution, which creates and finalizes the command object if necessary and then invokes its 'run()' method. N)r+ run_command)r2rs r4rCommand.run_command`s %%g.r7cz/nURH(up#UbU"U5(dMURU5 M* U$)aCDetermine the sub-commands that are relevant in the current distribution (ie., that need to be run). This is based on the 'sub_commands' class attribute: each tuple in that list may include a method that we call to determine if the subcommand needs to be run for the current distribution. Return a list of command names. )r#append)r2commandscmd_namemethods r4get_sub_commandsCommand.get_sub_commandsgs< $ 1 1 H~)!2r7cP[R"SUR5U5 g)Nzwarning: %s: %s )rwarningrT)r2rds r4warn Command.warnvs ')>)>)@#Fr7cB[R"XX0RS9 gNr9)rexecuter9)r2funcargsrdrPs r4rCommand.executeys Tll;r7cB[R"XURS9 gr)rmkpathr9)r2namemodes r4rCommand.mkpathsDLL9r7cgrcrr2infileoutfile preserve_modepreserve_timeslinkrPs r4 copy_fileCommand.copy_files(+r7cgrcrrs r4rrs,/r7c h[R"UUUUUR(+UURS9$)zCopy a file respecting verbose, dry-run and force flags. (The former two default to whatever is in the Distribution object, and the latter defaults to false for commands that don't define it.)r)rrr/r9rs r4rrs6""     N LL  r7c h[R"UUUUUUR(+URS9$)zLCopy an entire directory tree respecting verbose, dry-run, and force flags. r)r copy_treer/r9)r2rrrrpreserve_symlinksrPs r4rCommand.copy_trees6!!      NLL  r7cgrcrr2srcdstrPs r4 move_fileCommand.move_filesr7cgrcrrs r4rrs"r7c@[R"XURS9$)z$Move a file respecting dry-run flag.r)rrr9rs r4rrs""3T\\BBr7c2SSKJn U"XURS9 g)z2Spawn an external command respecting dry-run flag.r)spawnrN)distutils.spawnrr9)r2cmd search_pathrPrs r4r Command.spawns * c 5r7cgrcrr2 base_nameformatroot_dirbase_dirownergroups r4 make_archiveCommand.make_archiver7cgrcrrs r4rrrr7c J[R"UUUUURUUS9$)N)r9rr)rrr9rs r4rrs0((    LL  r7cUcSUS3n[U[5(aU4nO&[U[[45(d [ S5eUc!SR USR U55nUR(d[R"X5(aURX4XW5 g[R"U5 g)aSpecial case of 'execute()' for operations that process one or more input files and generate one output file. Works just like 'execute()', except the operation is skipped and a different message printed if 'outfile' already exists and is newer than all files listed in 'infiles'. If the command defined 'self.force', and it is true, then the command is unconditionally run -- does no timestamp checks. Nz skipping z (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating {} from {}z, ) r'rrrtupler(rjoinr/r newer_grouprrdebug)r2infilesrrrexec_msgskip_msgrPs r4 make_fileCommand.make_files$  "7)+>?H gs # #jGGdE]33WX X  .55gtyy?QRH ::..w@@ LLX 5 IIh r7)r-r+r1r/r0r.)r3rreturnNone)rr)N)rdobjectrPintrr)rdrrrrc)r[rrrt str | Nonerr)r[rrrr)rrr)rrrrztuple[str, str]rr)T)rrrrboolrr )F)rrrrr rr )rrrr rr)rz str | Commandrr )rrrrr)r list[str])Nr ) rCallable[[Unpack[_Ts]], object]rtuple[Unpack[_Ts]]rdrrPr rr)i)rrrrr rr)TTNr )rrrrrr rr rr rPr rztuple[_StrPathT | str, bool])rrrrrr rr rr rPr rz tuple[_BytesPathT | bytes, bool])r3str | os.PathLike[str] | bytes | os.PathLike[bytes]rrrr rr rr rPr rz@tuple[str | os.PathLike[str] | bytes | os.PathLike[bytes], bool])TTFr )rrrrrrr rr rr rPr rr )r )rrrrrPr rz_StrPathT | str)rrrrrPr rz_BytesPathT | bytes)rrrrrPr rr)Tr )rzMutableSequence[str]rr rPr rr)NNNN)rrrrrrr:str | os.PathLike[str] | bytes | os.PathLike[bytes] | Nonerr rr rr rrr)NNN)rrrrrrrrr rr rr rrr)rrrrrrrrr rr rr rrr)NNr )rz!str | list[str] | tuple[str, ...]rrrr rrrrrrrPr rr)+r __module__ __qualname____firstlineno____doc__r#__annotations__r$r5r?rDrr,rBr]r`rVrgrUrmrvrzrrrrrTrrr rrrrrrrrrrrr__static_attributes__rr7r4r r "s >    -`'$         N    29.; *  + LL+:L L27<04 =B 6: :?S$S S / G <-<!< <  <  <: ##+&++ +  +  ++ &++ ##/*// /  /  // *//## C E         J 4##"' &           ,HI)09BE NO"-"4?"HK" "" C @CAC C = CQR6'66:6JM6 6 PT#  M       $  )F      PT#   )  M         2 % 2% E% . % ! %  % % %  % % r7)&r __future__rrVrrrjabcrcollections.abcrrtypingrrr r r rr rrrr_logrerrorsrr&rtyping_extensionsrrrrrrr rr7r4rsx # 5BB@@(+6 u C K'? @ m+GH Ky 1 H H r7