HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_internal/utils/__pycache__/subprocess.cpython-310.pyc
o

��h#�@s�ddlmZddlZddlZddlZddlZddlmZmZddl	m
Z
mZmZm
Z
ddlmZddlmZmZddlmZddlmZmZdd	lmZee
eefZd3dd�Zd4dd�Zd5dd�Z									d6d7d-d.�Z d8d1d2�Z!dS)9�)�annotationsN)�Iterable�Mapping)�Any�Callable�Literal�Union)�escape)�SpinnerInterface�open_spinner)�InstallationSubprocessError)�VERBOSE�subprocess_logger)�
HiddenText�args�str | HiddenText | CommandArgs�return�CommandArgscGs2g}|D]}t|t�r|�|�q|�|�q|S)z&
    Create a CommandArgs object.
    )�
isinstance�list�extend�append)r�command_args�arg�r�I/usr/local/lib/python3.10/dist-packages/pip/_internal/utils/subprocess.py�make_commands
r�list[str] | CommandArgs�strcCsd�dd�|D��S)z/
    Format command arguments for display.
    � css2�|]}t|t�rt�t|��nt�|�VqdS)N)rr�shlex�quoter��.0rrrr�	<genexpr>.s
� �
�z&format_command_args.<locals>.<genexpr>)�join�rrrr�format_command_args%s
	�r'�	list[str]cCsdd�|D�S)z=
    Return the arguments in their raw, unredacted form.
    cSs g|]}t|t�r|jn|�qSr)rr�secretr"rrr�
<listcomp>8s z'reveal_command_args.<locals>.<listcomp>rr&rrr�reveal_command_args4sr+F�raiseT�cmd�show_stdout�bool�cwd�
str | None�
on_returncode�"Literal['raise', 'warn', 'ignore']�extra_ok_returncodes�Iterable[int] | None�
extra_environ�Mapping[str, Any] | None�
unset_environ�Iterable[str] | None�spinner�SpinnerInterface | None�log_failed_cmd�bool | None�stdout_only�command_descc

Cs�|durg}|durg}|rtj}tj}ntj}t}t��|k}
|
o&|du}|d|
�tj�	�}|r8|�
|�|D]}|�|d�q:ztj
t|�tjtj|	sRtjntj||dd�}Wntyq}z
|rlt�d||
��d}~wwg}|	s�|js{J�|js�J�|j��	|j��}|s�n|��}|�|d�||�|r�|s�J�|��q�z|��W|jr�|j��n
|jr�|j��wwd�|�}n(|��\}}|��D]}||�q�|�|�|��D]}||�q�|�|�|}|jo�|j|v}|�r|s�J�|�r|�d	�n|�d
�|�rl|dk�rMt |
|j|
�s|ndd�}|�rKtj!d
|ddid�tjdt"t#|��ddid�tjdt"|�pDd�ddid�|�|dk�r]t�$d|
|j|�|S|dk�re	|St%d|����|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 %s�backslashreplace)�stdin�stdout�stderrr0�env�errorsz#Error %s while executing command %sT�
��error�doner,)�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�ignorezInvalid value: on_returncode=)&r�info�logging�INFO�verboser
�getEffectiveLevel�os�environ�copy�update�pop�
subprocess�Popenr+�PIPE�STDOUT�	Exception�criticalrBrA�close�readline�rstripr�spin�waitr%�communicate�
splitlines�
returncode�finishrrHr	r'�warning�
ValueError)r-r.r0r2r4r6r8r:r<r>r?�log_subprocess�
used_level�showing_subprocess�use_spinnerrD�name�proc�exc�
all_output�line�output�out�err�out_line�err_line�proc_had_errorrHrrr�call_subprocess;s�



�
���



�

���





�
��
�

��r|�message�Callable[..., None]cs		dd
�fd
d�
}|S)z�Provide 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(r0r1r6r7r�Nonecs@t���}t|�|||d�Wd�dS1swYdS)N)r?r0r6r:)rr|)r-r0r6r:�r}rr�runner�s
�"�z+runner_with_spinner_message.<locals>.runner)NN)r-r(r0r1r6r7rrr)r}r�rr�r�runner_with_spinner_message�s	�r�)rrrr)rrrr)rrrr()	FNr,NNNNTF)r-rr.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r=r?rrr)r}rrr~)"�
__future__rrSrWr r\�collections.abcrr�typingrrrr�pip._vendor.rich.markupr	�pip._internal.cli.spinnersr
r�pip._internal.exceptionsr�pip._internal.utils.loggingr
r�pip._internal.utils.miscrrrrrr'r+r|r�rrrr�<module>s8


	�)