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

Method _resolve_pyenv_shim

pex/interpreter.py:1073–1091  ·  view source on GitHub ↗
(
        cls,
        binary,  # type: str
        pyenv=None,  # type: Optional[Pyenv]
        cwd=None,  # type: Optional[str]
    )

Source from the content-addressed store, hash-verified

1071
1072 @classmethod
1073 def _resolve_pyenv_shim(
1074 cls,
1075 binary, # type: str
1076 pyenv=None, # type: Optional[Pyenv]
1077 cwd=None, # type: Optional[str]
1078 ):
1079 # type: (...) -> Optional[str]
1080
1081 pyenv = pyenv or cls._pyenv()
1082 if pyenv is not None:
1083 shim = pyenv.as_shim(binary)
1084 if shim is not None:
1085 python = shim.select_version(search_dir=cwd)
1086 if python is None:
1087 TRACER.log("Detected inactive pyenv shim: {}.".format(shim), V=3)
1088 else:
1089 TRACER.log("Detected pyenv shim activated to {}: {}.".format(python, shim), V=3)
1090 return python
1091 return binary
1092
1093 @classmethod
1094 def _spawn_from_binary_external(

Callers 2

from_binaryMethod · 0.80
iter_candidatesMethod · 0.80

Calls 4

_pyenvMethod · 0.80
as_shimMethod · 0.80
select_versionMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected