| 467 | |
| 468 | |
| 469 | def 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) |