Closed macro1 closed 8 months ago
Thanks for the report. After giving up on the gRPC documentation and just searching on Github a bit, I see a lot of examples that just use import grpc.aio
to accomplish this. Please provide some citations or better MREs if you still think this should be merged. Closing for now.
Hi @shabbyrobe. I don't know what you mean by better MREs. The code will execute correctly in the example I provided, but type-checking will fail. I view that as a gap in grpc-stubs.
Although, I can appreciate not caring if the convention is to use the library in a way that avoids the issue. Honestly, I only ran into it because I was working on cross-compatible code with sync and async.
The code in the grpc
package that causes the gap between grpc
and grpc-stubs
is here:
https://github.com/grpc/grpc/blob/b25a382b602aabbd99439261f88cf05728988207/src/python/grpcio/grpc/__init__.py#L2307
Edit: Apologies. I just realized I'm on my work account at the moment haha.
The citation is sufficient.
Description of change
Minimum Reproducible Example
main.py
```py # Full python code to reproduce if __name__ == "__main__": import grpc grpc.aio.Channel ```run.sh
```sh #!/usr/bin/env bash set -o errexit -o nounset -o pipefail python -m venv venv source ./venv/bin/activate pip install grpcio python main.py ```Checklist:
typesafety/test_grpc.yml
for all APIs added or changed by this PRmypy-protobuf
.