+
     h#  c                   s    ^ RI t ^ RIt^ RIt^ RIt^ RIHtHtHtHt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# )i    N)AnyCallableIterableListLiteralMappingOptionalUnion)escape)SpinnerInterfaceopen_spinner)InstallationSubprocessError)VERBOSEsubprocess_logger)
HiddenTextc                s\    V ^8  d   QhR\         \        \        \        3,          R\        /#    argsreturn)r   strr   CommandArgsZformat   "C/usr/lib/python3.14/site-packages/pip/_internal/utils/subprocess.py__annotate__r      s&      c:{:;      c                 s    . pV  F=  p\        V\        4      '       d   VP                  V4       K,  VP                  V4       K?  	  V# )z
Create a CommandArgs object.
)
isinstanceZlistZextendappend)r   Zcommand_argsargs   *  r   make_commandr      sH     !#L c4  $ $  r   c                sh    V ^8  d   QhR\         \        \        ,          \        3,          R\        /# r   r   r   r   r   r   r   r   r   r   "   s(      eDI{$:;  r   c                s2    RP                  R V  4       4      # )z'
Format command arguments for display.
Z c              3   s   "   T FP  p\        V\        4      '       d    \        P                  ! \	        V4      4      M\        P                  ! V4      x  KR  	  R # 5i)N)r   r   shlexZquoter   )Z.0r      & r   Z	<genexpr>Z&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                s~    V ^8  d   QhR\         \        \        ,          \        3,          R\        \        ,          /# r   r   r   r   r   r   r   1   s0     P PeDI{$:; PS	 Pr   c                st    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   Zsecret)r   r   r    r   reveal_command_argsr#   1   s3     KOO$3*S*55CJJ3>$OOOs   -5c                s   V ^8  d   QhR\         \        \        ,          \        3,          R\        R\
        \        ,          RRR\
        \        \        ,          ,          R\
        \        \        \        3,          ,          R\
        \        \        ,          ,          R	\
        \        ,          R
\
        \        ,          R\
        \        ,          R\        R\        /# )r   cmdshow_stdoutcwdon_returncodez"Literal["raise", "warn", "ignore"]extra_ok_returncodesextra_environunset_environspinnerlog_failed_cmdstdout_onlycommand_descr   )r   r   r   r   Zboolr   r   Zintr   r    r	   r   r   r   r   r   8   s     e e	tCy+%	&ee 
#e 8	e
 #8C=1e GCH-.e HSM*e &'e TNe $e e 	er   c
          
     s	   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 %sZbackslashreplace)stdinstdoutZstderrr&   envZerrorsz#Error %s while executing command %sTZ
Z errorZdoneraise)Zcommand_descriptionZ	exit_codeZoutput_linesz%sZrich)Zextraz*[bold magenta]full command[/]: [blue]%s[/]Zmarkupz[bold magenta]cwd[/]: %sz	[inherit]Zwarnz$Command "%s" had error code %s in %sZignorezInvalid value: on_returncode=)&r   ZinfologgingZINFOZverboser   ZgetEffectiveLevelosZenvironZcopyZupdateZpop
subprocessZPopenr#   ZPIPEZSTDOUTZ	ExceptionZcriticalr0   r/   ZcloseZreadlineZrstripr   ZspinZwaitr!   ZcommunicateZ
splitlinesZ
returncodeZfinishr   r2   r   r"   ZwarningZ
ValueError)r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   Zlog_subprocessZ
used_levelZshowing_subprocessZuse_spinnerr1   ZnameZprocZexcZ
all_outputZlineZoutputZoutZerrZout_lineZerr_lineZproc_had_errorr2   s   &&&&&&&&&&$                 r   call_subprocessr7   8   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                s>    V ^8  d   QhR\         R\        R,          /# )r   messager   ).N)r   r   r   r   r   r   r      s       )1D r   c                s   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          	      s    V ^8  d   QhR\         \        ,          R\        \        ,          R\        \        \        \        3,          ,          RR/# )r   r$   r&   r)   r   N)r   r   r   r   r    r   r   r   r   Z1runner_with_spinner_message.<locals>.__annotate__   sF      #Yc]  S 12 
	r   c           
      s   < \        S4      ;_uu_ 4       p\        V SVVVR 7       RRR4       R#   + '       g   i     R# ; i))r.   r&   r)   r+   N)r
   r7   )r$   r&   r)   r+   r8   s   &&& r   runnerZ+runner_with_spinner_message.<locals>.runner   s8    
 '""g$+ #"""s	   0A	)NN )r8   r9   s   f r   runner_with_spinner_messager;      s      Mr   )	FNr3   NNNNTF) r4   r5   r   r6   Ztypingr    r   r   r   r   r   r   r   Zpip._vendor.rich.markupr   Zpip._internal.cli.spinnersr	   r
   Zpip._internal.exceptionsr   Zpip._internal.utils.loggingr   r   Zpip._internal.utils.miscr   r   r   r   r"   r#   r7   r;   r:   r   r   <module>r<      sX     	   S S S * E @ B /5j)*"PePr   