_shared
Shared helpers to remove boilerplate duplicated across package manager backends.
Each manager still performs its own shutil.which(...) / sudo_non_interactive_ok()
checks locally rather than through these helpers, so that unit tests can keep
patching those functions at their own module path; these helpers only centralize
the repetitive result construction that follows such a check.
command_details(res)
¶
Join a finished command's stdout/stderr into a single details blob.
format_failed_command(res)
¶
Render a failed command's argv and output as human-readable details text.
Source code in src/personal_os_setup/tasks/managers/_shared.py
missing_executable_install_result(exe, hint='')
¶
Build the failure InstallResult for an install whose required executable is missing.
Source code in src/personal_os_setup/tasks/managers/_shared.py
missing_executable_task_result(action, exe, hint='')
¶
Build the failure TaskResult for an action whose required executable is missing.
Source code in src/personal_os_setup/tasks/managers/_shared.py
sudo_required_install_result(package)
¶
Build the failure InstallResult for an install that needs passwordless sudo.
Source code in src/personal_os_setup/tasks/managers/_shared.py
sudo_required_task_result(action)
¶
Build the failure TaskResult for an action that needs passwordless sudo.
Source code in src/personal_os_setup/tasks/managers/_shared.py
winget_list_shows_installed(winget, package)
¶
Return whether winget list output indicates package is installed.
Source code in src/personal_os_setup/tasks/managers/_shared.py
winget_path()
¶
Return the path to winget, or None if it's not on PATH.
Shared by the winget and msstore backends, both of which shell out to winget.