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'
I found that when trying to implement the LongRunning Operations service, there was no
OperationsServicerbase class in the generated code, only theOperationsStubclass.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.pyonly has theOperationsStubclass. Additionally, innoxfile.py, thegenerate_protos()method never actually regenerates the grpc generated code. A--grpc_python_outargument would be required somewhere in thegrpctools.protoccall.Environment details
googleapis-common-protosversion: 1.52.0Steps to reproduce
Attempt to use the expected
OperationsServicerclass, as in the following snippet.Code example
Stack trace