chore: Migrate to ty type checking - #278
Open
toby-coleman wants to merge 11 commits into
Open
Conversation
# Conflicts: # uv.lock
|
Benchmark comparison for |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…-type-checking # Conflicts: # uv.lock
|
Benchmark comparison for |
There was a problem hiding this comment.
Pull request overview
Migrates project type checking from mypy to ty across tooling, CI, documentation, and source annotations.
Changes:
- Replaces
mypydependencies and commands withty. - Updates annotations, tests, documentation, and development configuration.
- Fixes the
.pre-commit-config.yamlhook configuration before approval.
Reviewed changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Summary |
|---|---|
uv.lock |
Updates locked type-checking dependencies. |
tests/unit/test_schemas.py |
Adds explicit test fixture typing. |
tests/unit/test_llm.py |
Narrows structured response typing. |
tests/integration/test_tuner.py |
Adds result assertions and safe callable-name access. |
tests/integration/test_job_id_wiring.py |
Narrows the built process type. |
tests/integration/test_component_decorator.py |
Adds process type narrowing. |
README.md |
Documents ty usage. |
pyproject.toml |
Replaces mypy configuration and dependency. |
plugboard/utils/ray.py |
Makes callable-name access type-safe. |
plugboard/utils/logging.py |
Improves IPython detection. |
plugboard/state/state_backend.py |
Adds state serialization annotations. |
plugboard/library/sql_io.py |
Refines SQL and async reflection typing. |
plugboard/library/llm.py |
Validates structured response payloads. |
plugboard/events/event_handlers.py |
Safely resolves method qualified names. |
plugboard/connector/ray_channel.py |
Updates channel signatures and annotations. |
plugboard/connector/asyncio_channel.py |
Updates channel message parameter naming. |
plugboard/component/utils.py |
Adds callable protocol typing and narrowing. |
plugboard/component/component.py |
Adds event-list type casts. |
plugboard/__init__.py |
Makes package version lookup robust. |
plugboard-schemas/pyproject.toml |
Removes obsolete mypy configuration. |
plugboard-schemas/plugboard_schemas/_validator_registry.py |
Safely formats callable names. |
plugboard-schemas/plugboard_schemas/__init__.py |
Makes version lookup robust. |
Makefile |
Runs ty during linting. |
CONTRIBUTING.md |
Documents ty and lint commands. |
AGENTS.md |
Updates type-checking guidance. |
.pre-commit-config.yaml |
Critical: the configured ty hook repository, revision, and ID cannot be resolved; use the matching ty-check metadata. |
.gitignore |
Removes mypy cache entries. |
.github/workflows/lint-test.yaml |
Uses ty in CI. |
.github/agents/lint.agent.md |
Updates lint-agent instructions. |
.devcontainer/devcontainer.json |
Adds the ty editor extension. |
Suppressed comments (1)
plugboard/connector/ray_channel.py:56
RayChannelis a public channel and does not callChannel.__init__, so this method is exposed directly. Renaming its parameter fromitemtomsgmakes existing keyword calls such asawait channel.send(item=value)fail withTypeError; this is an API break unrelated to the type-check migration. Preserve the old keyword (or explicitly support both names) while keeping the base-method typing consistent.
async def send(self, msg: _t.Any) -> None:
"""Sends an item through the `RayChannel`."""
await self._actor.send.remote(msg) # type: ignore
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+15
to
+17
| rev: v0.0.73 | ||
| hooks: | ||
| - id: mypy | ||
| additional_dependencies: | ||
| - types-PyYAML | ||
| - types-requests | ||
| - pydantic | ||
| - msgspec[yaml] | ||
| - id: ty |
Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Migrate from
mypytotyfor type-checking. Significantly faster lint checks.Changes
mypyand replaces withty.