feat(update): install system deps (transmission-daemon/p7zip) on upgrade

Add _install_system_deps() called by _run_upgrade() after a successful
git pull. Installs transmission-daemon (Linux) or transmission-cli brew
formula (macOS) so users who upgrade don't need to re-run make install
manually. Also corrects _run_upgrade to exit 1 on failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Justin Bollinger
2026-04-25 19:14:53 -04:00
co-authored by Claude Sonnet 4.6
parent f43b0742a1
commit e238c9bb66
2 changed files with 29 additions and 6 deletions
+5 -3
View File
@@ -153,7 +153,7 @@ class TestCheckForUpdates:
"subprocess.run", side_effect=[git_root_proc, make_proc]
) as mock_run, patch("shutil.which", return_value="/usr/local/bin/uv"), patch(
"os.path.isfile", return_value=True
), pytest.raises(
), patch.object(hc_module, "_install_system_deps"), pytest.raises(
SystemExit
):
mock_requests.get.return_value = mock_resp
@@ -236,7 +236,9 @@ class TestRunUpgrade:
make_proc = MagicMock()
make_proc.returncode = 0
with patch("subprocess.run", side_effect=[git_root_proc, make_proc]) as mock_run, pytest.raises(SystemExit) as exc:
with patch("subprocess.run", side_effect=[git_root_proc, make_proc]) as mock_run, \
patch.object(hc_module, "_install_system_deps"), \
pytest.raises(SystemExit) as exc:
hc_module._run_upgrade()
assert exc.value.code == 0
@@ -259,7 +261,7 @@ class TestRunUpgrade:
with patch("subprocess.run", side_effect=[git_root_proc, make_proc]), pytest.raises(SystemExit) as exc:
hc_module._run_upgrade()
assert exc.value.code == 0
assert exc.value.code == 1
output = capsys.readouterr().out
assert "Upgrade failed" in output