+
    i#                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^ RI	H
t
HtHtHt ^ RIHt ^ RIHtHt ^ RIHt ^ RIHtHt ^ R	IHt ]]]]3,          ,          tR
 R ltR R ltR R ltRR R llt R R lt!R# )    )annotationsN)IterableMapping)AnyCallableLiteralUnion)escape)SpinnerInterfaceopen_spinner)InstallationSubprocessError)VERBOSEsubprocess_logger)
HiddenTextc                    V ^8  d   QhRRRR/# )   argszstr | HiddenText | CommandArgsreturnCommandArgs )formats   "d/Users/ahmad/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_internal/utils/subprocess.py__annotate__r      s      6 ;     c                     . pV  F=  p\        V\        4      '       d   VP                  V4       K,  VP                  V4       K?  	  V# )z
Create a CommandArgs object.
)
isinstancelistextendappend)r   command_argsargs   *  r   make_commandr"      sH     !#L c4  $ $  r   c                    V ^8  d   QhRRRR/# )r   r   list[str] | CommandArgsr   strr   )r   s   "r   r   r   %   s      5 # r   c                2    RP                  R V  4       4      # )z'
Format command arguments for display.
 c              3     "   T FP  p\        V\        4      '       d    \        P                  ! \	        V4      4      M\        P                  ! V4      x  KR  	  R # 5i)N)r   r   shlexquoter%   ).0r!   s   & r   	<genexpr>&format_command_args.<locals>.<genexpr>.   s>      C ",C!<!<CH%++cBRRs   AA)join)r   s   &r   format_command_argsr/   %   s"     88   r   c                    V ^8  d   QhRRRR/# )r   r   r$   r   	list[str]r   )r   s   "r   r   r   4   s     P P5 P) Pr   c                t    V  Uu. uF'  p\        V\        4      '       d   VP                  MTNK)  	  up# u upi )z5
Return the arguments in their raw, unredacted form.
)r   r   secret)r   r!   s   & r   reveal_command_argsr4   4   s3     KOO$3*S*55CJJ3>$OOOs   -5c               H    V ^8  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRR/# )r   cmdr$   show_stdoutboolcwd
str | Noneon_returncodez"Literal['raise', 'warn', 'ignore']extra_ok_returncodeszIterable[int] | Noneextra_environMapping[str, Any] | Noneunset_environzIterable[str] | NonespinnerzSpinnerInterface | Nonelog_failed_cmdzbool | Nonestdout_onlycommand_descr%   r   r   )r   s   "r   r   r   ;   s     e e	 ee 
e 6	e
 /e ,e (e %e  e e e 	er   c
          
     	   Vf   . pVf   . pV'       d"   \         P                  p\        P                  pM\         P                  p\
        p\         P                  ! 4       V8*  pV'       * ;'       d    VRJpV! RV
4       \        P                  P                  4       pV'       d   VP                  V4       V F  pVP                  VR4       K  	   \        P                  ! \        V 4      \        P                  \        P                  V	'       g   \        P                   M\        P                  VVRR7      p. pT	'       Eg   TP&                  '       g   Q hTP(                  '       g   Q hTP(                  P+                  4         TP&                  P-                  4       pT'       g   MVTP/                  4       pTP1                  TR,           4       T! T4       T'       g   K^  T'       g   Q hTP3                  4        Kz   TP5                  4        TP&                  '       d   TP&                  P+                  4        RP7                  T4      pMuTP9                  4       w  ppTP;                  4        F  pT! T4       K  	  TP1                  T4       TP;                  4        F  pT! T4       K  	  TP1                  T4       TpTP<                  ;'       d    TP<                  T9  pT'       d6   T'       g   Q hT'       d   TP?                  R	4       MTP?                  R
4       T'       d   TR8X  d   \A        T
TP<                  T'       g   TMRR7      pT'       dw   \         PB                  ! RTRR/R7       \         P                  ! R\E        \G        T 4      4      RR/R7       \         P                  ! R\E        T;'       g    R4      RR/R7       ThTR8X  d&   \         PH                  ! RT
TP<                  T4       T# TR8X  d    T# \K        RT: 24      hT#   \"         d'   pT'       d   \         P$                  ! RTT
4       h Rp?ii ; i  TP&                  '       d   TP&                  P+                  4        i i ; i)a  
Args:
  show_stdout: if true, use INFO to log the subprocess's stderr and
    stdout streams.  Otherwise, use DEBUG.  Defaults to False.
  extra_ok_returncodes: an iterable of integer return codes that are
    acceptable, in addition to 0. Defaults to None, which means [].
  unset_environ: an iterable of environment variable names to unset
    prior to calling subprocess.Popen().
  log_failed_cmd: if false, failed commands are not logged, only raised.
  stdout_only: if true, return only stdout, else return both. When true,
    logging of both stdout and stderr occurs when the subprocess has
    terminated, else logging occurs as subprocess output is produced.
NzRunning command %sbackslashreplace)stdinstdoutstderrr9   enverrorsz#Error %s while executing command %sT
 errordoneraise)command_description	exit_codeoutput_linesz%srich)extraz*[bold magenta]full command[/]: [blue]%s[/]markupz[bold magenta]cwd[/]: %sz	[inherit]warnz$Command "%s" had error code %s in %signorezInvalid value: on_returncode=)&r   infologgingINFOverboser   getEffectiveLevelosenvironcopyupdatepop
subprocessPopenr4   PIPESTDOUT	ExceptioncriticalrG   rF   closereadlinerstripr   spinwaitr.   communicate
splitlines
returncodefinishr   rM   r
   r/   warning
ValueError)r6   r7   r9   r;   r<   r=   r?   r@   rA   rB   rC   log_subprocess
used_levelshowing_subprocessuse_spinnerrI   nameprocexc
all_outputlineoutputouterrout_lineerr_lineproc_had_errorrM   s   &&&&&&&&&&$                 r   call_subprocessr   ;   s   6 #!  .?.D.D\\
 +22
 +<<>*L )(@@WD-@K'6
**//
C

=!d $//??,7:$$Z__%	
$ J;{{{{zzzz

,,.D;;=DdTk* 4 {w	$IIK{{{!!#$ ##%S(H8$ )#(H8$ )#__TT@T)TNwNN7#NN6"G#/$0///AZtE
 !''eFD>J!))@.s34#T*
 ")).3--+.#T* Kf$%%6	 M	 h& M <]<MNOOMk  &&5
 	< {{{!!# s%   A(P Q Q)!Q

Q/Rc                    V ^8  d   QhRRRR/# )r   messager%   r   zCallable[..., None]r   )r   s   "r   r   r      s       1D r   c                   a  RR V 3R lllpV# )zProvide a subprocess_runner that shows a spinner message.

Intended for use with for BuildBackendHookCaller. Thus, the runner has
an API that matches what's expected by BuildBackendHookCaller.subprocess_runner.
c               (    V ^8  d   QhRRRRRRRR/# )	r   r6   r1   r9   r:   r=   r>   r   Noner   )r   s   "r   r   1runner_with_spinner_message.<locals>.__annotate__   s0       0 
	r   c           
        < \        S4      ;_uu_ 4       p\        V SVVVR 7       RRR4       R#   + '       g   i     R# ; i))rC   r9   r=   r@   N)r   r   )r6   r9   r=   r@   r   s   &&& r   runner+runner_with_spinner_message.<locals>.runner   s8    
 '""g$+ #"""s	   0A	)NNr   )r   r   s   f r   runner_with_spinner_messager      s      Mr   )	FNrO   NNNNTF)"
__future__r   rY   r]   r)   rb   collections.abcr   r   typingr   r   r   r	   pip._vendor.rich.markupr
   pip._internal.cli.spinnersr   r   pip._internal.exceptionsr   pip._internal.utils.loggingr   r   pip._internal.utils.miscr   r   r%   r   r"   r/   r4   r   r   r   r   r   <module>r      s[    "  	   - 0 0 * E @ B /5j)*"PePr   