-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fix mypy under rustworkx 0.13.0 #245
Conversation
After opening this, I learned that rustworkx 0.13.0 introduced type annotations, but they are currently incomplete. Since this fixes CI, I am in favor of merging it in its current form. |
@@ -27,7 +27,7 @@ | |||
from collections.abc import Sequence, Iterable, Hashable, MutableMapping | |||
from typing import NamedTuple | |||
|
|||
from rustworkx import PyGraph, connected_components | |||
from rustworkx import PyGraph, connected_components # type: ignore[attr-defined] |
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.
I like this. I wonder how we can know when to remove it? Should we make an issue to keep up with this?
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.
I wasn't planning to make an issue because I don't think it is worth a strong reminder to fix it. If we notice that rustworkx has more complete type annotations once day and want to revert it, that's fine, but if we don't remember to, it's not really a big deal either.
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.
ok sounds good!
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.
Looks good, thanks! We'll just check in on this when rustworkx has fully fleshed out their type hints
This fixes mypy when run with the most recent rustworkx release, 0.13.0. Without this, mypy errors with
It's not clear to me, though, why these annotations are necessary. I expect there is a better solution.