(
example_path: Path,
installer: Path,
install_dir: Path,
installer_input: str | None = None,
config_filename="construct.yaml",
check_sentinels=True,
check_subprocess=True,
request=None,
uninstall=True,
timeout=420,
options: list | None = None,
)
| 543 | |
| 544 | |
| 545 | def _run_installer( |
| 546 | example_path: Path, |
| 547 | installer: Path, |
| 548 | install_dir: Path, |
| 549 | installer_input: str | None = None, |
| 550 | config_filename="construct.yaml", |
| 551 | check_sentinels=True, |
| 552 | check_subprocess=True, |
| 553 | request=None, |
| 554 | uninstall=True, |
| 555 | timeout=420, |
| 556 | options: list | None = None, |
| 557 | ) -> subprocess.CompletedProcess: |
| 558 | if installer.suffix == ".exe": |
| 559 | process = _run_installer_exe( |
| 560 | installer, |
| 561 | install_dir, |
| 562 | installer_input=installer_input, |
| 563 | timeout=timeout, |
| 564 | check=check_subprocess, |
| 565 | options=options, |
| 566 | ) |
| 567 | elif installer.suffix == ".sh": |
| 568 | process = _run_installer_sh( |
| 569 | installer, |
| 570 | install_dir, |
| 571 | installer_input=installer_input, |
| 572 | timeout=timeout, |
| 573 | check=check_subprocess, |
| 574 | options=options, |
| 575 | ) |
| 576 | if request and ON_CI: |
| 577 | # GitHub runners run out of disk space if installation directories are not cleaned up |
| 578 | request.addfinalizer(lambda: shutil.rmtree(str(install_dir), ignore_errors=True)) |
| 579 | elif installer.suffix == ".pkg": |
| 580 | if request and ON_CI: |
| 581 | request.addfinalizer(lambda: shutil.rmtree(str(install_dir), ignore_errors=True)) |
| 582 | process, _ = _run_installer_pkg( |
| 583 | installer, |
| 584 | install_dir, |
| 585 | example_path=example_path, |
| 586 | config_filename=config_filename, |
| 587 | timeout=timeout, |
| 588 | check=check_subprocess, |
| 589 | ) |
| 590 | elif installer.suffix == ".msi": |
| 591 | process = _run_installer_msi( |
| 592 | installer, |
| 593 | install_dir, |
| 594 | installer_input=installer_input, |
| 595 | timeout=timeout, |
| 596 | check=check_subprocess, |
| 597 | options=options, |
| 598 | ) |
| 599 | else: |
| 600 | raise ValueError(f"Unknown installer type: {installer.suffix}") |
| 601 | |
| 602 | if installer.suffix == ".msi": |
no test coverage detected