MCPcopy Create free account
hub / github.com/conda/constructor / _run_installer

Function _run_installer

tests/test_examples.py:545–611  ·  view source on GitHub ↗
(
    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,
)

Source from the content-addressed store, hash-verified

543
544
545def _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":

Callers 15

test_example_extra_envsFunction · 0.85
test_example_extra_filesFunction · 0.85
test_example_miniforgeFunction · 0.85
test_example_nocondaFunction · 0.85
test_example_osxpkgFunction · 0.85
test_example_scriptsFunction · 0.85
test_example_shortcutsFunction · 0.85
test_example_signingFunction · 0.85

Calls 7

_run_installer_exeFunction · 0.85
_run_installer_shFunction · 0.85
_run_installer_pkgFunction · 0.85
_run_installer_msiFunction · 0.85
_sentinel_file_checksFunction · 0.85
_run_uninstaller_msiFunction · 0.85
_run_uninstaller_exeFunction · 0.85

Tested by

no test coverage detected