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
No stubs for client stubs? #26
Comments
You have to generate type hints for your stubs: https://github.com/nipunn1313/mypy-protobuf |
So the thing is that I did generate the the type hints, and they are all there for the protobufs themselves. But there are no type hints for the stubs on the client side. The version of mypy-protobuf that I'm using is 3.2.0. |
Did you add I may be misunderstanding you, though. |
So what I mean is that I generate my protos with this command:
When I then typecheck my project, there are no issues whatsoever with the proto-objects (e.g. I can instantiate them, assign values etc, wrong value types raise type errors etc). But when instantiating the client stub as per my code snippet above (when implementing a gRPC client), type checking produces the error I'm currently silencing this error ( |
Hmm. Maybe try adding |
Hey, thanks a ton for these stubs :)
I have recently added some client implementation to my server code (it's a gRPC server that queries another gRPC server), meaning that it makes use of the client stub of that other server.
Now mypy started complaining about
This error is happening on the line in which I instantiate my client:
I had a quick look into this repo to check if I was simply missing something, but I did indeed not find any stubs for the client stubs.
Are they missing? Is there a good way for me to get rid of that error other than ignoring it?
The text was updated successfully, but these errors were encountered: