MCPcopy
hub / github.com/pex-tool/pex / run_pex3

Function run_pex3

testing/cli.py:16–41  ·  view source on GitHub ↗
(
    *args,  # type: Text
    **kwargs  # type: Any
)

Source from the content-addressed store, hash-verified

14
15
16def run_pex3(
17 *args, # type: Text
18 **kwargs # type: Any
19):
20 # type: (...) -> IntegResults
21
22 python_exe = kwargs.pop("python", None)
23 if isinstance(python_exe, UvPython):
24 python = ensure_uv_python(python_exe)
25 elif python_exe:
26 python = python_exe
27 else:
28 python = sys.executable
29
30 python = (
31 installed_pex_wheel_venv_python(python) if kwargs.pop("use_pex_whl_venv", True) else python
32 )
33 cmd = [python, "-mpex.cli"] + list(map(str, args))
34 process = subprocess.Popen(args=cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
35 stdout, stderr = process.communicate()
36 return IntegResults(
37 cmd=tuple(cmd),
38 output=stdout.decode("utf-8"),
39 error=stderr.decode("utf-8"),
40 return_code=process.returncode,
41 )

Calls 6

ensure_uv_pythonFunction · 0.90
IntegResultsClass · 0.90
communicateMethod · 0.80
decodeMethod · 0.80
popMethod · 0.45