shabbyrobe / grpc-stubs

gRPC typing stubs for Python
MIT License
35 stars 21 forks source link

Added missing grpc.health.v1 stubs #29

Closed LiamAttClarke closed 2 years ago

LiamAttClarke commented 2 years ago

Was having issues importing grpc_health stubs.

Example:

from grpc_health.v1.health_pb2 import HealthCheckRequest
from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server

All files are generated using mypy-protobuf.

shabbyrobe commented 2 years ago

Thanks for reporting. Can you please provide more info about the issues? Is the snippet you provided a complete reproducer?

LiamAttClarke commented 2 years ago

@shabbyrobe The snippet provided is all that is needed to reproduce.

The files I added provide type definitions for the corresponding files (health_pb2_grpc.py and health_pb2.py) in the grpc-health package.

Without those stubs, the Pylance extension in VSCode produces the following errors:

Import "grpc_health.v1.health_pb2" could not be resolved
Import "grpc_health.v1.health_pb2_grpc" could not be resolved
shabbyrobe commented 2 years ago

Thanks for the additional context and clarifications. LGTM.

shabbyrobe commented 2 years ago

Just a heads-up, I've reverted this due to bug reports. I attempted to fix rather than revert but unfortunately ran out of time.

Feel free to resubmit another version in future, but please note that the acceptance threshold for PRs has been raised (as described in the project README).