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

Method create

pex/targets.py:250–265  ·  view source on GitHub ↗
(cls, interpreter=None)

Source from the content-addressed store, hash-verified

248class LocalInterpreter(Target):
249 @classmethod
250 def create(cls, interpreter=None):
251 # type: (Optional[Union[str, PythonInterpreter]]) -> LocalInterpreter
252
253 if not interpreter:
254 python_interpreter = PythonInterpreter.get()
255 elif isinstance(interpreter, PythonInterpreter):
256 python_interpreter = interpreter
257 else:
258 python_interpreter = PythonInterpreter.from_binary(interpreter)
259
260 return cls(
261 id=python_interpreter.binary.replace(os.sep, ".").lstrip("."),
262 platform=python_interpreter.platform,
263 marker_environment=python_interpreter.identity.env_markers,
264 interpreter=python_interpreter,
265 )
266
267 interpreter = attr.ib() # type: PythonInterpreter
268

Callers 3

currentFunction · 0.45
from_interpreterMethod · 0.45
iter_targetsMethod · 0.45

Calls 2

from_binaryMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected