Skip to content

Commit 555b0c2

Browse files
rustyconoverclaude
andcommitted
Add ty type checker alongside mypy
- Add ty to dev dependencies - Add [tool.ty.environment] config in pyproject.toml - Add ty check step to CI workflow - Fix type error in client.py that ty found but mypy missed: subprocess.Popen.stdout is typed as IO[bytes] but BufferedReader expects RawIOBase, requiring an explicit cast 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 59d839c commit 555b0c2

4 files changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,8 @@ jobs:
4949
- name: Check linting
5050
run: uv run ruff check .
5151

52-
- name: Type check
52+
- name: Type check (mypy)
5353
run: uv run mypy vgi/
54+
55+
- name: Type check (ty)
56+
run: uv run ty check vgi/

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ warn_unused_ignores = true
4242
module = "structlog.*"
4343
ignore_missing_imports = true
4444

45+
[tool.ty.environment]
46+
python-version = "3.12"
47+
4548
[tool.pytest.ini_options]
4649
addopts = "--mypy --ruff"
4750
testpaths = ["tests"]
@@ -50,4 +53,5 @@ testpaths = ["tests"]
5053
dev = [
5154
"lxml>=6.0.2",
5255
"pytest-timeout>=2.4.0",
56+
"ty>=0.0.8",
5357
]

uv.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vgi/client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ def start(self) -> None:
12551255
)
12561256
self._stderr_thread.start()
12571257

1258-
self._stdout_buffered = io.BufferedReader(self._proc.stdout)
1258+
self._stdout_buffered = io.BufferedReader(cast(io.RawIOBase, self._proc.stdout))
12591259
assert self._proc.stdin is not None, "stdin pipe not created for worker"
12601260
self._stdin_sink = pa.PythonFile(cast(io.IOBase, self._proc.stdin))
12611261

0 commit comments

Comments
 (0)