id#HddlZddlZddlZddlZddlmZmZmZmZm Z m Z m Z m Z ddl mZddlmZmZddlmZddlmZmZddlmZerddlmZe e eefZd e eeefd efd Zd e e eefd efd Zd e e eefd e efd Z d!de e eefdede eddde ee de e eefde eede ede ede eded efdZ!ded edfd Z"dS)"N) TYPE_CHECKINGAnyCallableIterableListMappingOptionalUnion)escape)SpinnerInterface open_spinner)InstallationSubprocessError)VERBOSEsubprocess_logger) HiddenText)Literalargsreturncg}|D]B}t|tr||-||C|S)z& Create a CommandArgs object. ) isinstancelistextendappend)r command_argsargs S/opt/cloudlinux/venv/lib/python3.11/site-packages/pip/_internal/utils/subprocess.py make_commandr sb!#L%% c4  %    $ $ $ $    $ $ $ $ c@dd|DS)z/ Format command arguments for display.  c3K|]N}t|tr!tjt |ntj|VOdS)N)rrshlexquotestr.0rs r z&format_command_args..:sd ",C!z'reveal_command_args..Ds- O O O3*S*55 >CJJ3 O O Orr-r)s rreveal_command_argsr0@s P O$ O O OOrFraiseTcmd show_stdoutcwd on_returncodez"Literal["raise", "warn", "ignore"]extra_ok_returncodes extra_environ unset_environspinnerlog_failed_cmd stdout_only command_descc  |g}|g}|rtj} tj} ntj} t } tj| k} | o|du}| d| tj }|r| ||D]}| |d tj t|tjtj| s tjn tj||d}n+#t"$r}|rtjd|| d}~wwxYwg}| s|j |j}|snN|}||dz| ||r|j ||jr|jn&#|jr|jwwxYwd|}n|\}}|D] }| ||||D] }| ||||}|jo|j|v}|r-|r|d n|d |r|d krtA| |j| s|nd }|rptj!d |tjdtEtG|dditjdtE|pdddi||dkrtj$d| |j|n|dkrntKd||S)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. NzRunning command %sbackslashreplace)stdinstdoutstderrr4enverrorsz#Error %s while executing command %sT errordoner1)command_description exit_code output_linesz[present-rich] %sz*[bold magenta]full command[/]: [blue]%s[/]markup)extraz[bold magenta]cwd[/]: %sz [inherit]warnz$Command "%s" had error code %s in %signorezInvalid value: on_returncode=)&rinfologgingINFOverbosergetEffectiveLevelosenvironcopyupdatepop subprocessPopenr0PIPESTDOUT Exceptioncriticalr?closer@readlinerstriprspinwaitr( communicate splitlines returncodefinishrrFr r*warning ValueError)r2r3r4r5r6r7r8r9r:r;r<log_subprocess used_levelshowing_subprocess use_spinnerrBnameprocexc all_outputlineoutputouterrout_lineerr_lineproc_had_errorrFs rcall_subprocessryGs6#! .?.D\ +2 +<>>*L)(@WD-@KN'666 *//  C" =!!! d  $ $/?,7L:$$Z_%         &5    J #   ,,..D ;;==D   dTk * * * N4     $ IIKKK{ $ !!###{ $ !!#### $$$##%%S(( % %H N8 $ $ $ $#(( % %H N8 $ $ $ $#_T@T)TN#  # NN7 # # # # NN6 " " "P G # #/$0//AKZZtE  !'(;UCCC!)@.s3344#T* ").3-+..#T* K f $ $  %6      h & & N]NNOO O Ms%2AD D/D**D/;G00#Hmessage).Nc  ddttdttdttttfddffd }|S)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. Nr2r4r7rct5}t||||ddddS#1swxYwYdS)N)r<r4r7r9)r ry)r2r4r7r9rzs rrunnerz+runner_with_spinner_message..runners ' " " g $+                       s 377)NN)rr$r rr)rzr}s` rrunner_with_spinner_messager~so"59   #Y  c]  S 12         Mr) FNr1NNNNTF)#rPrTr"rYtypingrrrrrrr r pip._vendor.rich.markupr pip._internal.cli.spinnersr r pip._internal.exceptionsrpip._internal.utils.loggingrrpip._internal.utils.miscrrr$ CommandArgsrr*r0boolintryr~r-rrrs                     +*****EEEEEEEE@@@@@@BBBBBBBB//////5j)* c:{:; " eDI{$:;     PeDI{$:;PS PPPP:A4815-1*.%)"'ee tCy+% &ee #e8 e #8C=1 e GCH-. eHSM*e& 'eTNe$ee eeeeP)1Dr