MCPcopy Index your code
hub / github.com/pex-tool/pex / minimum_sys

Method minimum_sys

pex/pex.py:452–465  ·  view source on GitHub ↗

Return the minimum sys necessary to run this interpreter, a la python -S. :returns: (sys.path, sys.path_importer_cache, sys.modules) tuple of a bare python installation.

(self, inherit_path)

Source from the content-addressed store, hash-verified

450 return scrubbed_sys_path, scrubbed_importer_cache
451
452 def minimum_sys(self, inherit_path):
453 # type: (InheritPath.Value) -> Tuple[List[str], Mapping[str, Any], Mapping[str, ModuleType]]
454 """Return the minimum sys necessary to run this interpreter, a la python -S.
455
456 :returns: (sys.path, sys.path_importer_cache, sys.modules) tuple of a
457 bare python installation.
458 """
459 isolated_sys_path = IsolatedSysPath.for_pex(
460 interpreter=self._interpreter, pex=self._pex, pex_pex=self._vars.PEX
461 )
462 sys_path, sys_path_importer_cache = self.minimum_sys_path(isolated_sys_path, inherit_path)
463 sys_modules = self.minimum_sys_modules(isolated_sys_path)
464
465 return sys_path, sys_path_importer_cache, sys_modules
466
467 # Thar be dragons -- when this function exits, the interpreter is potentially in a wonky state
468 # since the patches here (minimum_sys_modules for example) actually mutate global state.

Callers 1

patch_sysMethod · 0.95

Calls 3

minimum_sys_pathMethod · 0.95
minimum_sys_modulesMethod · 0.95
for_pexMethod · 0.80

Tested by

no test coverage detected