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

Function create_pex_command

testing/__init__.py:469–487  ·  view source on GitHub ↗
(
    args=None,  # type: Optional[Iterable[str]]
    python=None,  # type: Optional[str]
    quiet=None,  # type: Optional[bool]
    pex_module="pex",  # type: str
    use_pex_whl_venv=True,  # type: bool
)

Source from the content-addressed store, hash-verified

467
468
469def create_pex_command(
470 args=None, # type: Optional[Iterable[str]]
471 python=None, # type: Optional[str]
472 quiet=None, # type: Optional[bool]
473 pex_module="pex", # type: str
474 use_pex_whl_venv=True, # type: bool
475):
476 # type: (...) -> List[str]
477 python_exe = python or sys.executable
478 cmd = [
479 installed_pex_wheel_venv_python(python_exe) if use_pex_whl_venv else python_exe,
480 "-m",
481 pex_module,
482 ]
483 if pex_module == "pex" and not quiet:
484 cmd.append("-v")
485 if args:
486 cmd.extend(args)
487 return cmd
488
489
490@attr.s(frozen=True)

Callers 2

run_pex_commandFunction · 0.85

Calls 3

appendMethod · 0.80
extendMethod · 0.80

Tested by 1