Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add typechecking using mypy #2897

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

jderuiter
Copy link
Contributor

  • Add mypy checks to the test script
  • Add mypy checks to CI
  • Add type annotations

Fixes #2722

@mouse-reeve
Copy link
Member

I merged in main to fix the failing Prettier workflow which wasn't related to your work. And thank you for opening this PR!

@jderuiter
Copy link
Contributor Author

Thank you! I've been adding type annotations to the code, but I'm wondering what the best way forward is. I'm not familiar enough with the code base and Django internals to always know the intent of the code to add the correct types. For now I just added questions I had in TODOs. What do you think would be the best way to do this?

@mouse-reeve
Copy link
Member

I think it may be a good idea to break this into a series of pull requests, doing one module at a time. That way there's less risk of merge conflicts, and we can address any fixes in more manageable chunks. I'm on my phone right now but when I'm back at my computer I can take a closer look at the custom types. But I think starting with one or two relatively simple files might be a nice way to get going

@jderuiter
Copy link
Contributor Author

Sounds good. I created a smaller pull request with just the mypy tooling and some first annotations ( #2916). Once that is merged we can start looking at the other annotations I already added.

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.

Consider adding types via mypy
2 participants