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

Type (almost) all the things #122

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

Type (almost) all the things #122

wants to merge 14 commits into from

Conversation

PeterJCLaw
Copy link
Contributor

@PeterJCLaw PeterJCLaw commented Sep 24, 2022

This applies the result of running the tests under MonkeyType to the source code, resulting in a lot of the remaining type annotations being added.

It also makes mypy slightly stricter in now requiring that all ignores have error codes, that they do ignore something and fixes the cases that this found.

This does leave one typing issue unresolved as it is highlighting a potential bug -- if a label's metadata isn't a dict then there can be issues when merging in new metadata.

The old circleci/python images are deprecated.
The majority of these were added via MonkeyType from running the
tests, with some manual adjustment afterwards. This also includes
some minor refactors where doing so made the types clearer.

This does leave one typing issue unresolved as it is highlighting
a potential bug.
I'm guessing these relate to older versions of mypy which didn't
know how to read the code, however it seems reasonable to assume
a newer enough version of mypy now.
These were needed in very old versions of flake8, which didn't
support reading quoted type annotations.
Ideally we probably wouldn't do this, however that would require
a fairly substantial re-working of where various types are defined
and/or introducing rather a lot of protocols. We maybe should do
that at some point, however until then it seems reasonable to
allow type checking imports to specifically sidestep the layering
constraints.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 99.345% when pulling 7048fea on more-types into 6c69148 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants