-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
mypy: add --disallow-incomplete-defs option #2616
mypy: add --disallow-incomplete-defs option #2616
Conversation
b71b791
to
ed8f641
Compare
I rebased that over master and it passes the 3.13 mypy check as well! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a constant battle to keep the docs clean, with only the type annotations or hints in the :param:
declarations, but not both.
While you go through and look for those (I didn't annotate every one, especially since many are outside where GH will allow line notes), also double check that merging #2285 didn't introduce any new wrinkles for this mypy option? 🙏
I fixed the functions I touched, and then fixed some for good measure!
That would require a rebase first, so you tell me if it's OK and I'll do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of good stuff in here, but I do have a few questions (the same one in multiple places, actually) about the choice of type annotation syntax. Overall very impressed with how thorough you were with cleaning up the docstrings!
double check that merging #2285 didn't introduce any new wrinkles for this mypy option? 🙏
That would require a rebase first, so you tell me if it's OK and I'll do.
Now that I think about it, your fixups were tested against the latest master
, including the merged changes from #2285. It passed, so you can just squash out the fixups after we settle the syntax question.
bc7b2b5
to
dcb9467
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned history all good.
I'll have to check other open PRs against this after merging, or make them re-run CI somehow. That's a future-me problem, for later in the week. 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had some remarks, but if the type checker is happy then so am I!
0690270
to
5cf930d
Compare
Description
Tin, with the necessary type definition fix. Related to #2603 for Sopel 8.0.1.
Note: I used
Any
in several places, in particular insopel.tools.identifiers
. I'm not really happy about it. However, the best fix is to properly type annotate instances, i.e. doing something likeusers: dict[str, User] = SopelIdentifierMemory()
as it should properly type check theusers
sopel memory object.Checklist
make qa
(runsmake lint
andmake test
)