Skip to content

Conversation

@eliasecchig
Copy link
Collaborator

Summary

  • Replace mypy with ty (Astral's Rust-based type checker) for 10-100x faster type checking
  • Update all configuration, CI/CD, and documentation to use ty
  • Remove SKIP_MYPY workaround from testing workflow

Changes

Configuration

  • Replace mypy with ty in [project.optional-dependencies].lint
  • Migrate [tool.mypy][tool.ty] config in pyproject.toml files
  • Add .ty/ cache directory to .gitignore files

Build & CI

  • Update make lint to use ty check instead of mypy
  • Update .cloudbuild/ci/lint.yaml for CI lint step

Tests

  • Remove SKIP_MYPY workaround from test_template_linting.py
  • Regenerate all makefile snapshots with ty commands
  • Update lock files

Cleanup

  • Remove obsolete # mypy: file-level directives (14 files)
  • Remove types-pyyaml and types-requests stub dependencies from generated projects

Documentation

  • Update CONTRIBUTING.md, GEMINI.md, base_template/README.md

Benefits

  • Performance: ty is 10-100x faster than mypy (Rust-based, like ruff)
  • Unified tooling: Same Astral team as ruff/uv
  • Simpler dependencies: No more type stub packages needed

Test Plan

  • make lint passes
  • Template linting passes for multiple combinations:
    • adk_base + cloud_run
    • adk_base + agent_engine
    • adk_live + cloud_run
    • langgraph_base + agent_engine

Replace mypy with ty (Astral's Rust-based type checker) for significantly
faster type checking in both the ASP CLI and generated templates.

- Replace mypy with ty in lint dependencies
- Migrate [tool.mypy] config to [tool.ty] in pyproject.toml files
- Update Makefiles to use `ty check` instead of `mypy`
- Update CI/CD lint configuration (.cloudbuild/ci/lint.yaml)
- Remove SKIP_MYPY workaround from test_template_linting.py
- Remove obsolete `# mypy:` comments from source files
- Add .ty/ to .gitignore files
- Regenerate makefile snapshots and lock files
- Update documentation (CONTRIBUTING.md, GEMINI.md, README.md)

Benefits:
- 10-100x faster than mypy (Rust-based)
- Unified tooling with ruff/uv (same Astral team)
- Simplified dependencies (removed types-* stub packages)
@gemini-code-assist
Copy link
Contributor

Note

The number of changes in this pull request is too large for Gemini Code Assist to generate a summary.

Add missing ty rule configurations to ignore errors that mypy was
configured to suppress:
- unresolved-attribute: for dynamic attribute access on A2A types
- invalid-assignment: for dynamic dict subscript assignments
- invalid-return-type: for generator functions with None annotations

Remove possibly-missing-attribute (not a valid ty rule name).
@eliasecchig eliasecchig merged commit 7185c74 into main Dec 22, 2025
32 checks passed
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