| 620 | |
| 621 | |
| 622 | def run_simple_pex_test( |
| 623 | body, # type: str |
| 624 | args=(), # type: Iterable[str] |
| 625 | env=None, # type: Optional[Mapping[str, str]] |
| 626 | dists=None, # type: Optional[Iterable[Distribution]] |
| 627 | coverage=False, # type: bool |
| 628 | interpreter=None, # type: Optional[PythonInterpreter] |
| 629 | ): |
| 630 | # type: (...) -> Tuple[bytes, int] |
| 631 | with temporary_dir() as td1, temporary_dir() as td2: |
| 632 | pb = write_simple_pex(td1, body, dists=dists, coverage=coverage, interpreter=interpreter) |
| 633 | pex = os.path.join(td2, "app.pex") |
| 634 | pb.build(pex) |
| 635 | return run_simple_pex(pex, args=args, env=env, interpreter=interpreter) |
| 636 | |
| 637 | |
| 638 | PYENV_GIT_URL = "https://github.com/{pyenv}".format( |