lchenn / py-grpc-prometheus

Python gRPC Prometheus
Apache License 2.0
48 stars 25 forks source link

Recompile test protos #39

Closed popart closed 6 months ago

popart commented 6 months ago

Fix a failing test by recompiling protos with protoc==4.25.2. A test is failing with this message:

 ImportError while loading conftest '/home/runner/work/py-grpc-prometheus/py-grpc-prometheus/tests/conftest.py'.
tests/conftest.py:10: in <module>
    from tests.integration.hello_world import hello_world_pb2_grpc as hello_world_grpc
tests/integration/hello_world/hello_world_pb2_grpc.py:5: in <module>
    import tests.integration.hello_world.hello_world_pb2 as hello__world__pb2
tests/integration/hello_world/hello_world_pb2.py:36: in <module>
    _descriptor.FieldDescriptor(
/opt/hostedtoolcache/Python/3.11.8/x64/lib/python3.11/site-packages/google/protobuf/descriptor.py:553: in __new__
    _message.Message._CheckCalledFromGeneratedFile()
E   TypeError: Descriptors cannot be created directly.
E   If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
E   If you cannot immediately regenerate your protos, some other possible workarounds are:
E    1. Downgrade the protobuf package to 3.20.x or lower.
E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

Note: please do not merge until CI checks are passing.