googleapis / packman

Google API package creator
https://npmjs.com/package/googleapis-packman
Apache License 2.0
13 stars 18 forks source link

[Python] Safe LRO imports for both gRPC and non-gRPC clients #112

Closed bjwatson closed 7 years ago

bjwatson commented 8 years ago

What

The import of operations_pb2.py from googleapi-common-protos should work with or without gRPC. If the gRPC dependency is present, then it should include the long-running operations (LRO) service methods. This is currently working in googleapi-common-protos 1.3.4, but it was done manually. We want packman to handle this automatically for future releases.

Why

Google App Engine Standard for Python does not currently support gRPC, and needs to use the HTTP/JSON mode of https://github.com/GoogleCloudPlatform/gcloud-python/. There may be other use cases that would also prefer or require HTTP/JSON. googleapi-common-protos now has a soft dependency on gRPC to support the LRO service methods, and we need to make sure that operations_pb2.py can be imported with or without gRPC.

How

See what I manually did with generated/python/googleapis-common-protos/google/longrunning/operations_pb2.py in https://github.com/googleapis/api-client-staging/pull/1 for version 1.3.4 of googleapi-common-protos.

bjwatson commented 8 years ago

FYI @nathanielmanistaatgoogle. I can close this issue if you end up solving this problem in grpc-python.

nathanielmanistaatgoogle commented 8 years ago

I've opened grpc issue 8056 for the discussion.

bjwatson commented 8 years ago

Thanks @nathanielmanistaatgoogle.

bjwatson commented 7 years ago

This is fixed by gRPC 1.0.2