[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-06-15 06:16:39 +00:00
commit 4a02cedf60
3 changed files with 23 additions and 12 deletions

View file

@ -329,7 +329,9 @@ def test_status_lemonade_marker_compares_against_fork(monkeypatch, tmp_path):
source = "lemonade",
)
monkeypatch.setattr(upd, "_find_binary", lambda: binary)
monkeypatch.setattr(freshness, "_fetch_latest_release_tag", lambda repo, timeout = 5.0: "b9632-mix-2d6bd50")
monkeypatch.setattr(
freshness, "_fetch_latest_release_tag", lambda repo, timeout = 5.0: "b9632-mix-2d6bd50"
)
st = upd.get_update_status(force_refresh = True)
assert st["update_available"] is True
assert st["published_repo"] == "unslothai/llama.cpp" # not the recorded ggml-org
@ -349,7 +351,9 @@ def test_start_update_lemonade_marker_targets_fork(monkeypatch, tmp_path):
)
monkeypatch.setattr(upd, "_find_binary", lambda: binary)
monkeypatch.setattr(upd, "_installer_script", lambda: tmp_path / "install_llama_prebuilt.py")
monkeypatch.setattr(freshness, "_fetch_latest_release_tag", lambda repo, timeout = 5.0: "b9632-mix-2d6bd50")
monkeypatch.setattr(
freshness, "_fetch_latest_release_tag", lambda repo, timeout = 5.0: "b9632-mix-2d6bd50"
)
captured = {}
_patch_installer_popen(monkeypatch, on_start = lambda cmd: captured.update(cmd = cmd))
res = upd.start_update()

View file

@ -1612,7 +1612,10 @@ def _lemonade_release_api_for(llama_tag: str) -> str:
def resolve_lemonade_rocm_choice(
host: HostInfo, os_prefix: str, install_kind: str, llama_tag: str = "latest"
host: HostInfo,
os_prefix: str,
install_kind: str,
llama_tag: str = "latest",
) -> AssetChoice | None:
"""Lemonade ROCm bundle for a data-center AMD GPU (gfx908/gfx90a) the fork
does not ship. None for any other arch or on a fetch/asset/host miss.
@ -1652,9 +1655,7 @@ def resolve_lemonade_rocm_choice(
)
def _lemonade_release_plans(
llama_tag: str, host: HostInfo
) -> tuple[str, list[InstallReleasePlan]]:
def _lemonade_release_plans(llama_tag: str, host: HostInfo) -> tuple[str, list[InstallReleasePlan]]:
"""Single-attempt plan for a data-center AMD GPU, sourced from lemonade.
release_tag is lemonade's own counter so updates compare against lemonade;
llama_tag is a real upstream tag because the source tree is hydrated from

View file

@ -390,17 +390,23 @@ class TestDataCenterLemonadeRouting:
assert prebuilt_mod.resolve_lemonade_rocm_choice(host, "ubuntu", "linux-rocm") is None
sentinel = ("forkpath", [])
monkeypatch.setattr(prebuilt_mod, "_fork_manifest_release_plans", lambda *a, **k: sentinel)
assert prebuilt_mod.resolve_simple_install_release_plans(
"latest", host, prebuilt_mod.DEFAULT_PUBLISHED_REPO, ""
) == sentinel
assert (
prebuilt_mod.resolve_simple_install_release_plans(
"latest", host, prebuilt_mod.DEFAULT_PUBLISHED_REPO, ""
)
== sentinel
)
def test_nvidia_with_stray_gfx_not_routed_to_lemonade(self, monkeypatch):
host = nvidia_host(has_rocm = True, rocm_gfx_target = "gfx908")
sentinel = ("forkpath", [])
monkeypatch.setattr(prebuilt_mod, "_fork_manifest_release_plans", lambda *a, **k: sentinel)
assert prebuilt_mod.resolve_simple_install_release_plans(
"latest", host, prebuilt_mod.DEFAULT_PUBLISHED_REPO, ""
) == sentinel
assert (
prebuilt_mod.resolve_simple_install_release_plans(
"latest", host, prebuilt_mod.DEFAULT_PUBLISHED_REPO, ""
)
== sentinel
)
@patch.object(prebuilt_mod, "fetch_json")
def test_untrusted_asset_url_skipped(self, mock_fetch):