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

Add mypy type check linting #437

Closed
d33bs opened this issue Sep 13, 2024 · 3 comments · Fixed by #439
Closed

Add mypy type check linting #437

d33bs opened this issue Sep 13, 2024 · 3 comments · Fixed by #439
Labels
enhancement New feature or request

Comments

@d33bs
Copy link
Member

d33bs commented Sep 13, 2024

Type hints can oftentimes provide helpful static analysis and developer understanding for project maintenance. We could add mypy as a pre-commit check to help ensure changes reach a certain standard.

@d33bs d33bs added the enhancement New feature or request label Sep 13, 2024
@kenibrewer
Copy link
Member

I like mypy checking in github actions but typically not precommit hooks because of the long runtime. Would be glad to see us move towards typed python though!

@d33bs
Copy link
Member Author

d33bs commented Sep 14, 2024

Thanks Ken, good point! Do you have any feelings about Mypy alternatives? I was looking at https://mtshiba.github.io/pylyzer/ just now and wondered if that'd be fast enough to run through pre-commit. Generally I like having the checks prior to CI to help with development iterations, but completely agree that Mypy is relatively slow to run (and also sometimes difficult to decipher).

@kenibrewer
Copy link
Member

pylyzer looks super exciting! But it's not feature-complete enough to use as mypy alternative with pydantic in the mix. The TypedDict, TypeAlias and Annotated types are pretty important for that. I'd suggest we start with mypy and plan on switching to pylyzer once it's more feature complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants