zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
U
H=®dÄ&ã    @súddlmZddlZddlZddlZddlmZddlmZm    Z    ddl
m Z ddl m Z mZddlmZddlmZmZdd    lmZerÀdd
lmZmZmZmZmZmZmZmZeeeefZ d Z!d d „Z"dd„Z#dd„Z$dd„Z%ddd„Z&dd„Z'dS)é)Úabsolute_importN)Ú shlex_quote)ÚSpinnerInterfaceÚ open_spinner)ÚInstallationError)Úconsole_to_strÚstr_to_display)Úsubprocess_logger)Ú
HiddenTextÚpath_to_display)ÚMYPY_CHECK_RUNNING)ÚAnyÚCallableÚIterableÚListÚMappingÚOptionalÚTextÚUnionz(----------------------------------------cGs2g}|D]$}t|tƒr"| |¡q| |¡q|S)z&
    Create a CommandArgs object.
    )Ú
isinstanceÚlistÚextendÚappend)ÚargsÚ command_argsÚarg©rúUD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/utils/subprocess.pyÚ make_commands 
  rcCsd dd„|Dƒ¡S)z/
    Format command arguments for display.
    ú css,|]$}t|tƒrtt|ƒƒnt|ƒVqdS)N)rr
rÚstr©Ú.0rrrrÚ    <genexpr>7sÿz&format_command_args.<locals>.<genexpr>)Újoin©rrrrÚformat_command_args-s
 
þr&cCsdd„|DƒS)z=
    Return the arguments in their raw, unredacted form.
    cSs g|]}t|tƒr|jn|‘qSr)rr
Úsecretr!rrrÚ
<listcomp>Bsz'reveal_command_args.<locals>.<listcomp>rr%rrrÚreveal_command_args=sÿr)c    CsDt|ƒ}t|dd}t|ƒ}d |¡}dj|||t|ƒ|td}|S)z§
    Create and return the error message to use to log a subprocess error
    with command output.
 
    :param lines: A list of lines, each ending with a newline.
    z command bytes)ÚdescÚzŸCommand errored out with exit status {exit_status}:
 command: {command_display}
     cwd: {cwd_display}
Complete output ({line_count} lines):
{output}{divider})Ú exit_statusÚcommand_displayÚ cwd_displayÚ
line_countÚoutputÚdivider)r&rr r$ÚformatÚlenÚ LOG_DIVIDER)    Úcmd_argsÚcwdÚlinesr,Úcommandr-r.r0ÚmsgrrrÚmake_subprocess_output_errorGs  
ü    òr:FÚraiseTc
 
Cs^|dkr g}|dkrg}|r*tj}
tj} n tj}
tj} t ¡| k} | oN|dk    } |dkr`t|ƒ}|
d|ƒtj     
¡}|r‚|  |¡|D]}|  |d¡q†zBt jt|ƒt jt jt j||d}|jsÄt‚|jsÎt‚|j ¡Wn:tk
r}z|    rt d||¡‚W5d}~XYnXg}t|j ¡ƒ}|s2ql| ¡}| |d¡|
|ƒ| r|s`t‚| ¡qz | ¡W5|jrŒ|j ¡X|jož|j|k}| rÌ|s°t‚|rÂ| d¡n
| d¡|rT|dkr| s|    rt ||||jd    }t !|¡d
 "|j|¡}t#|ƒ‚n8|d kr:t $d ||j|¡n|d krFnt%d "|¡ƒ‚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.
    NzRunning command %s)ÚstderrÚstdinÚstdoutr6Úenvz#Error %s while executing command %sÚ
ÚerrorÚdoner;)r5r6r7r,zSCommand errored out with exit status {}: {} Check the logs for full command output.Úwarnz$Command "%s" had error code %s in %sÚignorez!Invalid value: on_returncode={!r}r+)'r    ÚinfoÚloggingÚINFOÚdebugÚDEBUGÚgetEffectiveLevelr&ÚosÚenvironÚcopyÚupdateÚpopÚ
subprocessÚPopenr)ÚSTDOUTÚPIPEr=ÚAssertionErrorr>ÚcloseÚ    ExceptionÚcriticalrÚreadlineÚrstriprÚspinÚwaitÚ
returncodeÚfinishr:rAr2rÚwarningÚ
ValueErrorr$)ÚcmdÚ show_stdoutr6Ú on_returncodeÚextra_ok_returncodesÚ command_descÚ extra_environÚ unset_environÚspinnerÚlog_failed_cmdÚlog_subprocessÚ
used_levelÚshowing_subprocessÚ use_spinnerr?ÚnameÚprocÚexcÚ
all_outputÚlineÚproc_had_errorr9Úexc_msgrrrÚcall_subprocessqs² 
 
 
ü
 
ÿ
   ÿ
 
 
 ü
ÿý
 
ü
ÿrtcsd‡fdd„    }|S)zÜProvide a subprocess_runner that shows a spinner message.
 
    Intended for use with for pep517's Pep517HookCaller. Thus, the runner has
    an API that matches what's expected by Pep517HookCaller.subprocess_runner.
    Nc    s(tˆƒ}t||||dW5QRXdS)N)r6rerg)rrt)r`r6rerg©ÚmessagerrÚrunner
s
üz+runner_with_spinner_message.<locals>.runner)NNr)rvrwrrurÚrunner_with_spinner_messages
ýrx)    FNr;NNNNNT)(Ú
__future__rrFrKrPÚpip._vendor.six.movesrÚpip._internal.cli.spinnersrrÚpip._internal.exceptionsrÚpip._internal.utils.compatrrÚpip._internal.utils.loggingr    Úpip._internal.utils.miscr
r Úpip._internal.utils.typingr Útypingr rrrrrrrr Z CommandArgsr4rr&r)r:rtrxrrrrÚ<module>s<     (
,ö