-
Notifications
You must be signed in to change notification settings - Fork 306
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
Use mypy for static type checking in continuous integration #268
Comments
Probably best to close this one as we hadn't considered mypy and astropy.units clashing? |
I just created a "Snoozed" label to add to this since we could potentially address this in the future, but there doesn't seem to be a viable way to address it now. I'll try to remember to create an issue on Astropy's repository that discusses this problem. |
Re-opening this because there now exists a workaround for |
Mypy uses function annotations to perform static type checking. Mypy has the potential to help us track down bugs without even running a program. Lately we've started to add type hints to functions and methods in a few of our subpackages (including atomic, for example) where we sometimes make use of the typing package as well. It would be great if we can use mypy in our suite of tests with Travis CI which would involve updating
.travis.yml
(which is also being edited in #264).A potential problem is that some return annotations are given as units:
I am not sure how mypy will handle that situation. Some function arguments are going to be annotated with the
Particle
class in order for@particle_input
to know what to do with them. That may also make mypy grumpy. Another thing to worry about is that backwards compatibility is not guaranteed for mypy yet, so we might have to make some further adjustments later on. I personally am inexperienced with mypy, but projects such as zulip have added mypy to their Travis CI tests.Many thanks to whoever ends up working on this! (And also thanks to @Cadair for letting us know about mypy!)
The text was updated successfully, but these errors were encountered: