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

Use mypy to test typing #1284

Merged
merged 8 commits into from Dec 1, 2020
Merged

Use mypy to test typing #1284

merged 8 commits into from Dec 1, 2020

Conversation

bjgill
Copy link
Contributor

@bjgill bjgill commented Nov 27, 2020

This PR adds mypy static type checking to the checks performed on make test and on Travis CI (but not on commit).

I've also fixed/ignored the issues mypy picked up as appropriate.

I copied the approach from dmrunner, which we did first.

Copy link
Contributor

@lfdebrux lfdebrux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@bjgill
Copy link
Contributor Author

bjgill commented Dec 1, 2020

Oh dear. We've hit python/mypy#9656.

@lfdebrux
Copy link
Contributor

lfdebrux commented Dec 1, 2020

Oh dear. We've hit python/mypy#9656.

Maybe we should just pin to the older version of mypy and hope they find a way around this issue?

@bjgill
Copy link
Contributor Author

bjgill commented Dec 1, 2020

Agreed. There is a workaround (assign the lambda to a variable), but it's a bit silly.

We will use this to test our type hints
Also internal libraries that don't yet have type hints.
There were lots of typing errors, and I don't want to fix them all now.
As picked up by mypy
Fix what errors I could. I ignored the errors that are due to the slightly weird thing we do with attributes.
The will mean that it gets run by CI.
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.

None yet

2 participants