
    q"h#                        S SK r S SKrS SKrS SKrS SKJrJrJrJrJ	r	J
r
JrJr  S SKJr  S SKJrJr  S SKJr  S SKJrJr  S SKJr  \\\\4      rS\\\\4   S	\4S
 jrS\\\   \4   S	\4S jrS\\\   \4   S	\\   4S jr         SS\\\   \4   S\S\\   SSS\\\      S\\
\\4      S\\\      S\\   S\\   S\\   S\S	\4S jjr S\S	\S   4S jr!g)    N)AnyCallableIterableListLiteralMappingOptionalUnion)escape)SpinnerInterfaceopen_spinner)InstallationSubprocessError)VERBOSEsubprocess_logger)
HiddenTextargsreturnc                      / nU  H<  n[        U[        5      (       a  UR                  U5        M+  UR                  U5        M>     U$ )z
Create a CommandArgs object.
)
isinstancelistextendappend)r   command_argsargs      P/var/www/html/env/lib/python3.13/site-packages/pip/_internal/utils/subprocess.pymake_commandr      sH     !#L c4  $ $      c                 2    SR                  S U  5       5      $ )z'
Format command arguments for display.
 c              3      #    U  HO  n[        U[        5      (       a  [        R                  " [	        U5      5      O[        R                  " U5      v   MQ     g 7f)N)r   r   shlexquotestr).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                 t    U  Vs/ s H&  n[        U[        5      (       a  UR                  OUPM(     sn$ s  snf )z5
Return the arguments in their raw, unredacted form.
)r   r   secret)r   r   s     r   reveal_command_argsr+   1   s3     KOO$3*S*55CJJ3>$OOOs   -5cmdshow_stdoutcwdon_returncodez"Literal["raise", "warn", "ignore"]extra_ok_returncodesextra_environunset_environspinnerlog_failed_cmdstdout_onlycommand_descc
          
         Uc  / nUc  / nU(       a!  [         R                  n[        R                  nO[         R                  n[
        n[         R                  " 5       U:*  nU(       + =(       a    USLnU" SU
5        [        R                  R                  5       nU(       a  UR                  U5        U H  nUR                  US5        M      [        R                  " [        U 5      [        R                  [        R                  U	(       d  [        R                   O[        R                  UUSS9n/ nU	(       d  UR&                  (       d   eUR(                  (       d   eUR(                  R+                  5          UR&                  R-                  5       nU(       d  ONUR/                  5       nUR1                  US-   5        U" U5        U(       a  U(       d   eUR3                  5         Mp   UR5                  5         UR&                  (       a  UR&                  R+                  5         SR7                  U5      nOuUR9                  5       u  nnUR;                  5        H  nU" U5        M     UR1                  U5        UR;                  5        H  nU" U5        M     UR1                  U5        UnUR<                  =(       a    UR<                  U;  nU(       a3  U(       d   eU(       a  UR?                  S	5        OUR?                  S
5        U(       a  US:X  a  [A        U
UR<                  U(       d  UOSS9nU(       al  [         RB                  " SUSS0S9  [         R                  " S[E        [G        U 5      5      SS0S9  [         R                  " S[E        U=(       d    S5      SS0S9  UeUS:X  a%  [         RH                  " SU
UR<                  U5        U$ US:X  a   U$ [K        SU< 35      eU$ ! ["         a%  nU(       a  [         R$                  " SUU
5        e SnAff = f! UR&                  (       a  UR&                  R+                  5         f f = f)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stderrr.   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Popenr+   PIPESTDOUT	Exceptioncriticalr:   r9   closereadlinerstripr   spinwaitr'   communicate
splitlines
returncodefinishr   r@   r   r(   warning
ValueError)r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   log_subprocess
used_levelshowing_subprocessuse_spinnerr<   nameprocexc
all_outputlineoutputouterrout_lineerr_lineproc_had_errorr@   s                               r   call_subprocessru   8   s   6 #!  .?.D.D\\
 +22
 +<<>*L )(@WD-@K'6
**//
C

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

,,.D;;=DdTk* 4 w 	$IIK{{!!#$ ##%S(H8$ )#(H8$ )#__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$O0 -P" 0
P: PP".Qmessage).Nc           
         ^    SS[         [           S[        [           S[        [        [        [        4      SS4U 4S jjjnU$ )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.
Nr,   r.   r1   r   c           	      j   > [        T5       n[        U TUUUS9  S S S 5        g ! , (       d  f       g = f)N)r6   r.   r1   r3   )r   ru   )r,   r.   r1   r3   rv   s       r   runner+runner_with_spinner_message.<locals>.runner   s2    
 '"g$+ #""s   $
2)NN)r   r#   r	   r   r   )rv   ry   s   ` r   runner_with_spinner_messager{      sV     "59#Yc]  S 12 
	  Mr   )	FNrB   NNNNTF)"rL   rP   r!   rU   typingr   r   r   r   r   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#   CommandArgsr   r(   r+   boolintru   r{    r   r   <module>r      s    	   S S S * E @ B /5j)*c:{:;  "eDI{$:;  PeDI{$:; PS	 P :A4815-1*.%)"'e	tCy+%	&ee 
#e 8	e
 #8C=1e GCH-.e HSM*e &'e TNe $e e 	eP )1D r   