Content-Length: 260352 | pFad | https://github.com/googleapis/python-api-common-protos/issues/12

88 gRPC code isn't (re)generated for protos containing service definitions · Issue #12 · googleapis/python-api-common-protos · GitHub
Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

gRPC code isn't (re)generated for protos containing service definitions #12

Closed
boimart1 opened this issue Jun 11, 2020 · 2 comments · Fixed by #13
Closed

gRPC code isn't (re)generated for protos containing service definitions #12

boimart1 opened this issue Jun 11, 2020 · 2 comments · Fixed by #13
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@boimart1
Copy link
Contributor

I found that when trying to implement the LongRunning Operations service, there was no OperationsServicer base class in the generated code, only the OperationsStub class.

I would normally expect this class (and the add_OperationsServicer_to_server() method) to be generated: https://grpc.io/docs/languages/python/generated-code/

What I noticed upon inspection of this repository is that the file google/longrunning/operations_grpc_pb2.py only has the OperationsStub class. Additionally, in noxfile.py, the generate_protos() method never actually regenerates the grpc generated code. A --grpc_python_out argument would be required somewhere in the grpctools.protoc call.

Environment details

  • OS type and version: Windows 10 x64
  • Python version: 3.8.1
  • pip version: 20.0.2
  • googleapis-common-protos version: 1.52.0

Steps to reproduce

Attempt to use the expected OperationsServicer class, as in the following snippet.

Code example

from google.longrunning import operations_pb2
class Servicer(operations_pb2.OperationsServicer):
    pass

Stack trace

(.venv) λ py operation_service.py
Traceback (most recent call last):
  File "operation_service.py", line 3, in <module>
    class Service(operations_pb2.OperationsServicer):
AttributeError: module 'google.longrunning.operations_pb2' has no attribute 'OperationsServicer'
@busunkim96
Copy link
Contributor

@boimart1 Would you mind trying 1.51.0? I'm wondering if this is something I missed as I was moving the library over.

@busunkim96 busunkim96 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jun 11, 2020
@busunkim96 busunkim96 self-assigned this Jun 11, 2020
@boimart1
Copy link
Contributor Author

boimart1 commented Jun 11, 2020

@busunkim96 No change between 1.51 and 1.52. In fact, 1.6.0 (which seems to be the last version before the files were moved here) seems to have the same issue.

I'm currently working on a PR to add a few steps to generate_protos() to address this.

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Sep 9, 2020
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Dec 8, 2020
gcf-merge-on-green bot pushed a commit that referenced this issue Dec 22, 2020
Fixes #12 🦕

(My automatic whitespace formatter removed some trailing whitespace, is this an issue?)

Note that I'm not entirely sure how to work with synthtool, and so I couldn't figure out how to get the license header and formatting fixed before committing the files generated by `nox -s generate_protos`. Someone else is going to have to do that part for me 🙂 Still, the generated grpc file looks good.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/python-api-common-protos/issues/12

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy