Exemplo n.º 1
0
 def _create_base_env(base_dir: Path, pip_install_args: Tuple[str, ...]):
     try:
         create_virtual_env(str(base_dir), [], sys.executable, True)
         with open(base_dir / "testrun.uid", mode="w") as f:
             f.write(testrun_uid)
         if pip_install_args:
             shell_tools.run_cmd(f"{base_dir}/bin/pip", "install", *pip_install_args)
     except BaseException as ex:
         # cleanup on failure
         if base_dir.is_dir():
             print(f"Removing {base_dir}, due to error: {ex}")
             shutil.rmtree(base_dir)
         raise
Exemplo n.º 2
0
def _create_base_env(proto_dir):
    create_virtual_env(str(proto_dir), [], sys.executable, True)
    pip_path = str(proto_dir / "bin" / "pip")
    shell_tools.run_cmd(pip_path, "install", *PACKAGES)