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

Function execute_sys_path_dump_pex

tests/integration/test_issue_1825.py:48–65  ·  view source on GitHub ↗
(
    pex,  # type: str
    *additional_args,  # type: str
    **additional_env  # type: Any
)

Source from the content-addressed store, hash-verified

46
47
48def execute_sys_path_dump_pex(
49 pex, # type: str
50 *additional_args, # type: str
51 **additional_env # type: Any
52):
53 # type: (...) -> OrderedSet[str]
54
55 interpreter = PythonInterpreter.get()
56 if PY2:
57 # Under Python 2 venvs (created by Pex via Virtualenv 16.7.12), the venv interpreter
58 # can fail to resolve stdlib weakref internals. We side-step by just resolving out
59 # of the venv since this test is aimed squarely at PYTHONPATH isolation.
60 interpreter = interpreter.resolve_base_interpreter()
61
62 _, stdout, _ = interpreter.execute(
63 args=[pex] + list(additional_args), env=make_env(**additional_env)
64 )
65 return OrderedSet(os.path.realpath(entry) for entry in cast("List[str]", json.loads(stdout)))
66
67
68def read_additional_sys_path(

Callers 1

read_additional_sys_pathFunction · 0.85

Calls 6

make_envFunction · 0.90
OrderedSetClass · 0.90
castFunction · 0.90
getMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected