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.
Experimenting with https://astral.sh/blog/ty
Merge #2024 first, which sets up uv.
Run checks by performing
Note that our docker setup doesn't install dev dependencies, so I'm just doing it locally. We could make some updates to have a dev-specific environment if we want to be able to run the checks there.
Initially I found about 600-700 errors, but applied some easy fixes and have it down to about 500 now. I've not added any pre-commit or actions to check this yet as the number of warnings is still quite high.
We could consider enabling it only for a few packages (e.g. sounds or forums or accounts), or just slowly work down the list until we're happy with it.
Eventually it'd be good to also move our types from our docstrings to the function definitions, we were using docstrings because we were still using python 2.7 at the time that we started.
Some quick fixes surfaced by the ty type checker and django-stubs