fix: persist packaged SEA binaries during extraction

AB
3mo ago
+50-19

Summary

  • copy packaged SEA resources into the persistent cache while the importlib.resources.as_file() context is active
  • return the cached path instead of an extraction path that may already have been removed
  • add a regression test that simulates temporary resource cleanup on context exit

Testing

  • uv run --frozen pytest tests/test_sea_binary.py -q (5 passed)
  • uv run --frozen ruff check .
  • uv run --frozen pyright -p .
  • uv run --frozen mypy --platform linux .
  • full Python 3.9 and 3.14 suites run on Windows; only the pre-existing Windows failures addressed by #355 remained

Fixes #354


Summary by cubic

Persist packaged SEA binaries during extraction so resolve_binary_path returns a stable, cached path. Previously it returned a temporary extraction path that could be deleted when the as_file context exited; now it copies to a versioned cache during that context and returns the cached path. Fixes #354.

  • Persist the resource to the versioned cache inside the extraction context and return the cached path.
  • Keep env override and source checkout fallbacks unchanged.
  • Add a regression test that simulates cleanup on context exit.