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

Function _run_installer_pkg

tests/test_examples.py:300–330  ·  view source on GitHub ↗
(
    installer,
    install_dir,
    example_path=None,
    config_filename="construct.yaml",
    timeout=420,
    check=True,
)

Source from the content-addressed store, hash-verified

298
299
300def _run_installer_pkg(
301 installer,
302 install_dir,
303 example_path=None,
304 config_filename="construct.yaml",
305 timeout=420,
306 check=True,
307):
308 if os.environ.get("CI"):
309 # We want to run it in an arbitrary directory, but the options
310 # are limited here... We can only install to $HOME :shrug:
311 # but that will pollute ~, so we only do it if we are running on CI
312 cmd = [
313 "installer",
314 "-pkg",
315 installer,
316 "-dumplog",
317 "-target",
318 "CurrentUserHomeDirectory",
319 ]
320 if example_path:
321 install_dir = calculate_install_dir(example_path / config_filename)
322 install_dir = Path(os.environ["HOME"]) / install_dir
323 else:
324 # This command only expands the PKG, but does not install
325 warnings.warn(
326 "Not running installer, only expanding the PKG. "
327 "Export CI=1 to run it, but it will pollute your $HOME."
328 )
329 cmd = ["pkgutil", "--expand", installer, install_dir]
330 return _execute(cmd, timeout=timeout, check=check), install_dir
331
332
333def _sentinel_file_checks(example_path, install_dir):

Callers 1

_run_installerFunction · 0.85

Calls 3

calculate_install_dirFunction · 0.90
_executeFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected