You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: leverage ty 0.0.33 declared-type preference to remove casts
ty 0.0.33 prefers the declared type on annotated assignments when the
RHS returns Any/Unknown, removing the need for cast() workarounds.
- Bump ty minimum to >=0.0.33
- Replace cast() with type annotations where applicable
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@@ -34,7 +34,7 @@ uv sync --frozen --group base --group test --group linters
34
34
### Local commands
35
35
36
36
-**Format**: `uv run poe format` (runs `ruff check --fix` then `ruff format`)
37
-
-**Lint**: `uv run poe lint` (runs `ruff check` then `mypy`)
37
+
-**Lint**: `uv run poe lint` (runs `ruff check` then `ty check`)
38
38
-**Test**: `uv run poe test` (runs `pytest -n auto`)
39
39
-**CI-equivalent**: `uv run poe ci` (commit check + pre-commit hooks via `prek` + test with coverage)
40
40
-**Full local check**: `uv run poe all` (format + lint + check-commit + coverage)
@@ -50,7 +50,7 @@ Always run at least `uv run ruff check --fix . && uv run ruff format .` before p
50
50
### Common CI failure patterns
51
51
52
52
-**"Format Python code...Failed"**: Run `uv run poe format` and commit the result.
53
-
-**mypy `[arg-type]` on TypedDict**: Dynamically-constructed dicts (e.g., from `pytest.mark.parametrize`) passed to TypedDict-typed params need `# type: ignore[arg-type]`.
53
+
-**ty `invalid-argument-type` on TypedDict**: Dynamically-constructed dicts (e.g., from `pytest.mark.parametrize`) passed to TypedDict-typed params need `# type: ignore # noqa: PGH003` or `cast()`.
54
54
-**"pathspec 'vX.Y.Z' did not match"**: `.pre-commit-config.yaml` pins a tag of this repo. Rebase onto master to pick up the tag.
55
55
-**`VersionProtocol` + `issubclass`**: This Protocol has non-method members (properties), so `issubclass()` raises `TypeError`. Use `hasattr` checks for runtime validation.
0 commit comments