-
Notifications
You must be signed in to change notification settings - Fork 1
[codex] Fix Windows SIGALRM markdown indexing #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+134
−38
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ab2bafc
Fix Windows SIGALRM markdown indexing
jottakka 5931e64
Unify safe_read timeout paths behind a context manager
jottakka 3a26599
ci: run tests on Windows to catch POSIX-only regressions
jottakka 4fee34d
ci: add macOS to the test matrix
jottakka fb7515b
ci: use uv-managed Python so sqlite-vec loads on macOS
jottakka 4420171
ci: force uv to use python-build-standalone for sqlite-vec
jottakka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| """Tests for CLI behavior.""" | ||
|
|
||
| from pathlib import Path | ||
| from typing import Any | ||
|
|
||
| import pytest | ||
| from typer.testing import CliRunner | ||
|
|
||
| from librarian import cli | ||
|
|
||
|
|
||
| def test_add_directory_exits_nonzero_when_indexing_errors( | ||
| tmp_path: Path, monkeypatch: pytest.MonkeyPatch | ||
| ) -> None: | ||
| """Directory add should fail automation when indexing reports errors.""" | ||
| docs_dir = tmp_path / "docs" | ||
| docs_dir.mkdir() | ||
| fixture = docs_dir / "fixture.md" | ||
| fixture.write_text("# Synthetic Markdown Fixture\n\nContent.", encoding="utf-8") | ||
|
|
||
| config_dir = tmp_path / "config" | ||
| monkeypatch.setattr(cli, "CONFIG_DIR", config_dir) | ||
| monkeypatch.setattr(cli, "SOURCES_FILE", config_dir / "sources.json") | ||
| monkeypatch.setattr(cli, "SETTINGS_FILE", config_dir / "settings.json") | ||
| monkeypatch.setattr(cli, "_get_config", lambda: {"ensure_directories": lambda: None}) | ||
|
|
||
| async def fake_server_ingest(context: Any, directory: str) -> dict[str, Any]: | ||
| return { | ||
| "directory": directory, | ||
| "total_files": 1, | ||
| "indexed": 0, | ||
| "updated": 0, | ||
| "skipped": 0, | ||
| "errors": [{"path": str(fixture), "error": "parser exploded"}], | ||
| "files": [], | ||
| } | ||
|
|
||
| monkeypatch.setattr("librarian.server.index_directory_to_library", fake_server_ingest) | ||
|
|
||
| # Force a wide terminal so Rich does not wrap the error message off-screen. | ||
| monkeypatch.setenv("COLUMNS", "500") | ||
| result = CliRunner().invoke(cli.app, ["add", str(docs_dir), "--verbose"]) | ||
|
|
||
| assert result.exit_code == 1 | ||
| assert "Errors:" in result.output | ||
| assert "parser exploded" in result.output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 3.11 here?