fix(python-sdk): satisfy runtime packaging gates

This commit is contained in:
fz
2026-08-14 14:00:42 +08:00
parent e20f560992
commit acd8dd43fa
11 changed files with 114 additions and 46 deletions
+17 -1
View File
@@ -51,7 +51,10 @@ def test_runtime_requires_spawn_helper_only_on_macos(
runtime_dir.mkdir()
linux = runtime_dir / "dsh-jsonrpc-agent-pkg-linux-x64"
linux.touch()
(runtime_dir / "dsh-jsonrpc-agent-pkg-macos-arm64").touch()
Path(f"{linux}-rg").touch()
macos = runtime_dir / "dsh-jsonrpc-agent-pkg-macos-arm64"
macos.touch()
Path(f"{macos}-rg").touch()
monkeypatch.setattr(runtime, "bundled_package_dir", lambda: tmp_path)
monkeypatch.setattr(runtime, "_current_platform_tag", lambda: "macos-arm64")
@@ -59,3 +62,16 @@ def test_runtime_requires_spawn_helper_only_on_macos(
runtime.bundled_runtime_path()
monkeypatch.setattr(runtime, "_current_platform_tag", lambda: "linux-x64")
assert runtime.bundled_runtime_path() == linux
def test_runtime_requires_ripgrep_sidecar(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
runtime_dir = tmp_path / "runtime"
runtime_dir.mkdir()
(runtime_dir / "dsh-jsonrpc-agent-pkg-linux-x64").touch()
monkeypatch.setattr(runtime, "bundled_package_dir", lambda: tmp_path)
monkeypatch.setattr(runtime, "_current_platform_tag", lambda: "linux-x64")
with pytest.raises(FileNotFoundError, match="ripgrep sidecar"):
runtime.bundled_runtime_path()