fix(python): make Windows release paths native
Run the GitHub Windows runtime leg under the runner’s native PowerShell instead of inheriting the POSIX Bash body. POSIX and Windows now own explicit output resolution, virtual-environment setup, environment scrubbing, and keyless/live black-box commands, while portable build commands continue to use each runner’s default shell. Put the pinned uv installation on the GitLab Windows job PATH before either the smoke or release builder invokes it. Reject a runtime executable whose basename does not match the selected platform manifest, and reject Intel macOS at platform selection instead of reporting a misleading missing artifact. Add a complete PowerShell path to the published Python tutorial and record the three-phase shutdown-time bound in the Windows runtime decision. Workflow, Python, and bilingual documentation tests pin the resulting behavior.
This commit is contained in:
1 parent
d4a63abe85
commit
8101a0d097
13 files changed
+270
-67
No files matched your search
@@ -116,7 +116,12 @@ def resolve_bundled_launch_args(mode: str | None = None) -> tuple[str, ...]:
|
||||
def _current_platform_tag() -> str:
|
||||
plat = _PLATFORM_TAGS.get(sys.platform)
|
||||
arch = _ARCH_TAGS.get(platform.machine().lower())
|
||||
if plat is None or arch is None or (plat == "win" and arch != "x64"):
|
||||
if (
|
||||
plat is None
|
||||
or arch is None
|
||||
or (plat == "win" and arch != "x64")
|
||||
or (plat == "macos" and arch != "arm64")
|
||||
):
|
||||
raise FileNotFoundError(
|
||||
"no bundled DeepSeek Harness SDK runtime exists for this platform "
|
||||
f"(sys.platform={sys.platform!r}, machine={platform.machine()!r}); supported: "
|
||||
|
||||
@@ -137,3 +137,16 @@ def test_stage_runtime_copies_platform_payload(
|
||||
assert (destination / "THIRD_PARTY_NOTICES.md").read_bytes() == (
|
||||
ROOT / "THIRD_PARTY_NOTICES.md"
|
||||
).read_bytes()
|
||||
|
||||
|
||||
def test_stage_runtime_rejects_a_noncanonical_executable_name(tmp_path: Path) -> None:
|
||||
executable = tmp_path / "renamed.exe"
|
||||
executable.write_bytes(b"runtime")
|
||||
|
||||
with pytest.raises(ValueError, match="must be named deepseek-harness-sdk-runtime-win-x64.exe"):
|
||||
build_python_release.stage_runtime(
|
||||
tmp_path / "staging",
|
||||
"1.2.3",
|
||||
executable,
|
||||
"deepseek-harness-sdk-runtime-win-x64.exe",
|
||||
)
|
||||
@@ -79,6 +79,14 @@ def test_current_platform_supports_windows_x64_only(monkeypatch: pytest.MonkeyPa
|
||||
runtime._current_platform_tag()
|
||||
|
||||
|
||||
def test_current_platform_rejects_macos_x64(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(runtime.sys, "platform", "darwin")
|
||||
monkeypatch.setattr(runtime.platform, "machine", lambda: "x86_64")
|
||||
|
||||
with pytest.raises(FileNotFoundError, match="macOS arm64"):
|
||||
runtime._current_platform_tag()
|
||||
|
||||
|
||||
def test_runtime_requires_ripgrep_sidecar(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
|
||||
Reference in new issue
Block a user