Add ty as type checker#1189
Conversation
094a987 to
e4e4133
Compare
- Add ty configuration: python-version 3.10, exclude tests/ and docs/ - All ty rules at default severity (no downgrades) - Add lint CI job (ruff check, ruff format, ty check) - Remove ruff pytest tests (now covered by lint CI job) - Migrate test matrix and API change check jobs from pip to uv - Remove redundant uv-test job (now covered by test matrix) - Keep multiarch job on pip (uv not available on ppc64le) - Move docs from optional dependency to dependency group - Include docs group in test group (tests/test_docs.py needs docutils) - Migrate ReadTheDocs to uv
Fix all errors reported by ty across the codebase.
ryneeverett
left a comment
There was a problem hiding this comment.
* dev dependencies are now defined in a [dependency group](https://packaging.python.org/en/latest/specifications/dependency-groups/#dependency-groups), to avoid including them in the project when it's built
Fine, but it seems like we need to update contributing.rst to include the group --dev for uv and whatever pip needs to adapt.
* I added a CI job for that, as well as for ruff (linter + formatter). `ruff` used to be checked through a test (removed to so tests don't require having ruff anymore), which is not really standard IMO, but I can revert this if needed.
What is the problem with tests requiring ruff and ty? I know it's not standard practice, but from my perspective the more we have in tests and the less in CI the better because (a) less distinction between local/CI to debug (b) the tests are portable and extremely stable whereas CI configuration is vendored and less stable.
* I migrated all CI jobs to use uv instead of pip, for better consistency.
That's fine, but could we copy the old bugwarrior-test to bugwarrior-development-pip-test so we're still testing basic pip functionality (since it's documented as an option). This is in the spirit of what bugwarrior-development-uv-test was doing before, but for pip.
715bec8
into
GothenburgBitFactory:develop
Following #1151, this add
tyas a type checker, and fix all related errors.Some notes:
ruffused to be checked through a test (removed to so tests don't require having ruff anymore), which is not really standard IMO, but I can revert this if needed.