Skip to content

Add GitHub workflow#1

Merged
kaapstorm merged 10 commits into
mainfrom
nh/gha
May 9, 2026
Merged

Add GitHub workflow#1
kaapstorm merged 10 commits into
mainfrom
nh/gha

Conversation

@kaapstorm
Copy link
Copy Markdown
Owner

No description provided.

kaapstorm and others added 10 commits May 7, 2026 13:38
The new GitHub Actions workflow runs ruff check and ruff format
--check, which surfaced four unused imports and one unformatted
file pre-existing on main.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
test_path_containment: on macOS, tempfile dirs live under /var which
is a symlink to /private/var, so resolve_under returns a resolved
path that doesn't equal the unresolved root. Match the sibling
deeply-nested test by calling root.resolve() in the assertion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous f'file://{profile}' produced a well-formed URL only on
POSIX, where the path starts with '/' and yields 'file:///tmp/...'.
On Windows the same expression produced 'file://D:\\a\\...', which
soffice parses as a host of 'D:' followed by a backslash-laden
path — never resolves, so soffice hangs waiting for a profile that
will never exist.

pathlib's Path.as_uri() emits the platform-correct form:
  POSIX:   file:///tmp/foo
  Windows: file:///D:/a/foo

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
On Windows, unlinking an open file fails with WinError 32 ("The
process cannot access the file because it is being used by another
process"). On POSIX it silently succeeds, so leaks went unnoticed.
TemporaryDirectory cleanup walks the tree and unlinks, so any
unclosed handle within propagates as a PermissionError.

Production fixes:
- LibreOfficeEngine._read_calculated: close the workbook in a
  finally block. read_only=True keeps the underlying zip handle
  open until close() is called, so the soffice tempdir could not be
  cleaned up on Windows. Cascade fix for ~10 downstream tests
  (recalc, snapshot, testing.Model, mcp tools, end-to-end).
- safe_load_workbook: close the workbook if _stream_cell_count
  raises, so XlsxTooLargeError doesn't leak the handle.

Test fixes:
- test_safe_load_workbook streaming_cell_count_passes_under_cap:
  close the wb before exiting the tempdir context.
- test_bulk build_loads_csv_into_sqlite: close the sqlite
  connection before exiting the tempdir context.
- test_mcp_cmd._read_one_response: replace select.select() with a
  thread + queue. select.select() on Windows only works on sockets,
  not on subprocess stdout pipes (WinError 10038).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kaapstorm kaapstorm merged commit ebacb05 into main May 9, 2026
3 checks passed
@kaapstorm kaapstorm deleted the nh/gha branch May 9, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant