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

Function execute

tests/test_execution_mode.py:45–54  ·  view source on GitHub ↗
(colors_pex, extra_env)

Source from the content-addressed store, hash-verified

43def execute_colors_pex(tmpdir):
44 # type: (Any) -> ExecuteColorsPex
45 def execute(colors_pex, extra_env):
46 pex_root = os.path.join(str(tmpdir), "pex_root")
47 env = os.environ.copy()
48 env.update(extra_env)
49 env["PEX_ROOT"] = pex_root
50 args = [colors_pex] if os.path.isfile(colors_pex) else [sys.executable, colors_pex]
51 output = subprocess.check_output(
52 args=args + ["-c", "import colors; print(colors.__file__)"], env=env
53 )
54 return output.strip().decode("utf-8"), pex_root
55
56 return execute
57

Callers

nothing calls this directly

Calls 5

decodeMethod · 0.80
stripMethod · 0.80
joinMethod · 0.45
copyMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected