update dependencies to work with protobuf 5 (#5195)

Closes #5074

Signed-off-by: Mohammad Mazraeh <mazraeh.mohammad@gmail.com>
This commit is contained in:
Mohammad Mazraeh 2025-01-28 22:11:54 -08:00 committed by GitHub
parent 225eb9d0b2
commit 2f1684b698
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 799 additions and 520 deletions

View File

@ -18,7 +18,7 @@ dependencies = [
"pillow>=11.0.0",
"typing-extensions>=4.0.0",
"pydantic<3.0.0,>=2.10.0",
"protobuf~=4.25.1",
"protobuf~=5.29.3",
"opentelemetry-api>=1.27.0",
"jsonref~=1.1.0",
]

View File

@ -1,12 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: serialization_test.proto
# Protobuf Python Version: 4.25.1
# Protobuf Python Version: 5.29.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
5,
29,
0,
'',
'serialization_test.proto'
)
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
@ -19,8 +29,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18serialization_
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'serialization_test_pb2', _globals)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
if not _descriptor._USE_C_DESCRIPTORS:
DESCRIPTOR._loaded_options = None
_globals['_PROTOMESSAGE']._serialized_start=36
_globals['_PROTOMESSAGE']._serialized_end=67
_globals['_NESTINGPROTOMESSAGE']._serialized_start=69

View File

@ -1,4 +1,24 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
GRPC_GENERATED_VERSION = '1.70.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False
try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True
if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in serialization_test_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)

View File

@ -58,7 +58,7 @@ redis = [
]
grpc = [
"grpcio~=1.62.0", # TODO: update this once we have a stable version.
"grpcio~=1.70.0",
]
jupyter-executor = [

View File

@ -1,12 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: agent_worker.proto
# Protobuf Python Version: 4.25.1
# Protobuf Python Version: 5.29.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
5,
29,
0,
'',
'agent_worker.proto'
)
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
@ -21,12 +31,12 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x61gent_worke
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'agent_worker_pb2', _globals)
if _descriptor._USE_C_DESCRIPTORS == False:
_globals['DESCRIPTOR']._options = None
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'\252\002\032Microsoft.AutoGen.Protobuf'
_globals['_RPCREQUEST_METADATAENTRY']._options = None
_globals['_RPCREQUEST_METADATAENTRY']._loaded_options = None
_globals['_RPCREQUEST_METADATAENTRY']._serialized_options = b'8\001'
_globals['_RPCRESPONSE_METADATAENTRY']._options = None
_globals['_RPCRESPONSE_METADATAENTRY']._loaded_options = None
_globals['_RPCRESPONSE_METADATAENTRY']._serialized_options = b'8\001'
_globals['_AGENTID']._serialized_start=75
_globals['_AGENTID']._serialized_end=111

View File

@ -1,9 +1,29 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
from . import agent_worker_pb2 as agent__worker__pb2
GRPC_GENERATED_VERSION = '1.70.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False
try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True
if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in agent_worker_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)
class AgentRpcStub(object):
"""Missing associated documentation comment in .proto file."""
@ -18,37 +38,37 @@ class AgentRpcStub(object):
'/agents.AgentRpc/OpenChannel',
request_serializer=agent__worker__pb2.Message.SerializeToString,
response_deserializer=agent__worker__pb2.Message.FromString,
)
_registered_method=True)
self.GetState = channel.unary_unary(
'/agents.AgentRpc/GetState',
request_serializer=agent__worker__pb2.AgentId.SerializeToString,
response_deserializer=agent__worker__pb2.GetStateResponse.FromString,
)
_registered_method=True)
self.SaveState = channel.unary_unary(
'/agents.AgentRpc/SaveState',
request_serializer=agent__worker__pb2.AgentState.SerializeToString,
response_deserializer=agent__worker__pb2.SaveStateResponse.FromString,
)
_registered_method=True)
self.RegisterAgent = channel.unary_unary(
'/agents.AgentRpc/RegisterAgent',
request_serializer=agent__worker__pb2.RegisterAgentTypeRequest.SerializeToString,
response_deserializer=agent__worker__pb2.RegisterAgentTypeResponse.FromString,
)
_registered_method=True)
self.AddSubscription = channel.unary_unary(
'/agents.AgentRpc/AddSubscription',
request_serializer=agent__worker__pb2.AddSubscriptionRequest.SerializeToString,
response_deserializer=agent__worker__pb2.AddSubscriptionResponse.FromString,
)
_registered_method=True)
self.RemoveSubscription = channel.unary_unary(
'/agents.AgentRpc/RemoveSubscription',
request_serializer=agent__worker__pb2.RemoveSubscriptionRequest.SerializeToString,
response_deserializer=agent__worker__pb2.RemoveSubscriptionResponse.FromString,
)
_registered_method=True)
self.GetSubscriptions = channel.unary_unary(
'/agents.AgentRpc/GetSubscriptions',
request_serializer=agent__worker__pb2.GetSubscriptionsRequest.SerializeToString,
response_deserializer=agent__worker__pb2.GetSubscriptionsResponse.FromString,
)
_registered_method=True)
class AgentRpcServicer(object):
@ -138,6 +158,7 @@ def add_AgentRpcServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'agents.AgentRpc', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('agents.AgentRpc', rpc_method_handlers)
# This class is part of an EXPERIMENTAL API.
@ -155,11 +176,21 @@ class AgentRpc(object):
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.stream_stream(request_iterator, target, '/agents.AgentRpc/OpenChannel',
return grpc.experimental.stream_stream(
request_iterator,
target,
'/agents.AgentRpc/OpenChannel',
agent__worker__pb2.Message.SerializeToString,
agent__worker__pb2.Message.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def GetState(request,
@ -172,11 +203,21 @@ class AgentRpc(object):
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/agents.AgentRpc/GetState',
return grpc.experimental.unary_unary(
request,
target,
'/agents.AgentRpc/GetState',
agent__worker__pb2.AgentId.SerializeToString,
agent__worker__pb2.GetStateResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def SaveState(request,
@ -189,11 +230,21 @@ class AgentRpc(object):
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/agents.AgentRpc/SaveState',
return grpc.experimental.unary_unary(
request,
target,
'/agents.AgentRpc/SaveState',
agent__worker__pb2.AgentState.SerializeToString,
agent__worker__pb2.SaveStateResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def RegisterAgent(request,
@ -206,11 +257,21 @@ class AgentRpc(object):
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/agents.AgentRpc/RegisterAgent',
return grpc.experimental.unary_unary(
request,
target,
'/agents.AgentRpc/RegisterAgent',
agent__worker__pb2.RegisterAgentTypeRequest.SerializeToString,
agent__worker__pb2.RegisterAgentTypeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def AddSubscription(request,
@ -223,11 +284,21 @@ class AgentRpc(object):
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/agents.AgentRpc/AddSubscription',
return grpc.experimental.unary_unary(
request,
target,
'/agents.AgentRpc/AddSubscription',
agent__worker__pb2.AddSubscriptionRequest.SerializeToString,
agent__worker__pb2.AddSubscriptionResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def RemoveSubscription(request,
@ -240,11 +311,21 @@ class AgentRpc(object):
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/agents.AgentRpc/RemoveSubscription',
return grpc.experimental.unary_unary(
request,
target,
'/agents.AgentRpc/RemoveSubscription',
agent__worker__pb2.RemoveSubscriptionRequest.SerializeToString,
agent__worker__pb2.RemoveSubscriptionResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def GetSubscriptions(request,
@ -257,8 +338,18 @@ class AgentRpc(object):
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/agents.AgentRpc/GetSubscriptions',
return grpc.experimental.unary_unary(
request,
target,
'/agents.AgentRpc/GetSubscriptions',
agent__worker__pb2.GetSubscriptionsRequest.SerializeToString,
agent__worker__pb2.GetSubscriptionsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)

View File

@ -1,12 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: cloudevent.proto
# Protobuf Python Version: 4.25.1
# Protobuf Python Version: 5.29.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
5,
29,
0,
'',
'cloudevent.proto'
)
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
@ -21,10 +31,10 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x63loudevent.
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'cloudevent_pb2', _globals)
if _descriptor._USE_C_DESCRIPTORS == False:
_globals['DESCRIPTOR']._options = None
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'\252\002\033Microsoft.AutoGen.Contracts'
_globals['_CLOUDEVENT_ATTRIBUTESENTRY']._options = None
_globals['_CLOUDEVENT_ATTRIBUTESENTRY']._loaded_options = None
_globals['_CLOUDEVENT_ATTRIBUTESENTRY']._serialized_options = b'8\001'
_globals['_CLOUDEVENT']._serialized_start=100
_globals['_CLOUDEVENT']._serialized_end=660

View File

@ -1,4 +1,24 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
GRPC_GENERATED_VERSION = '1.70.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False
try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True
if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in cloudevent_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)

View File

@ -1,13 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: serialization_test.proto
# Protobuf Python Version: 4.25.1
# Protobuf Python Version: 5.29.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
5,
29,
0,
'',
'serialization_test.proto'
)
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
@ -15,15 +24,15 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18serialization_test.proto\x12\x06\x61gents"\x1f\n\x0cProtoMessage\x12\x0f\n\x07message\x18\x01 \x01(\t"L\n\x13NestingProtoMessage\x12\x0f\n\x07message\x18\x01 \x01(\t\x12$\n\x06nested\x18\x02 \x01(\x0b\x32\x14.agents.ProtoMessageb\x06proto3')
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18serialization_test.proto\x12\x06\x61gents\"\x1f\n\x0cProtoMessage\x12\x0f\n\x07message\x18\x01 \x01(\t\"L\n\x13NestingProtoMessage\x12\x0f\n\x07message\x18\x01 \x01(\t\x12$\n\x06nested\x18\x02 \x01(\x0b\x32\x14.agents.ProtoMessageb\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "serialization_test_pb2", _globals)
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
_globals["_PROTOMESSAGE"]._serialized_start=36
_globals["_PROTOMESSAGE"]._serialized_end=67
_globals["_NESTINGPROTOMESSAGE"]._serialized_start=69
_globals["_NESTINGPROTOMESSAGE"]._serialized_end=145
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'serialization_test_pb2', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
DESCRIPTOR._loaded_options = None
_globals['_PROTOMESSAGE']._serialized_start=36
_globals['_PROTOMESSAGE']._serialized_end=67
_globals['_NESTINGPROTOMESSAGE']._serialized_start=69
_globals['_NESTINGPROTOMESSAGE']._serialized_end=145
# @@protoc_insertion_point(module_scope)

View File

@ -1,4 +1,24 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
GRPC_GENERATED_VERSION = '1.70.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False
try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True
if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in serialization_test_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)

View File

@ -1,12 +1,6 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
*
CloudEvent Protobuf Format
- Required context attributes are explicitly represented.
- Optional and Extension context attributes are carried in a map structure.
- Data may be represented as binary, text, or protobuf messages.
"""
import abc

View File

@ -13,7 +13,7 @@ dev = [
"pytest_mock",
"poethepoet",
"packaging",
"grpcio-tools~=1.62.0",
"grpcio-tools~=1.70.0",
"mypy-protobuf",
"cookiecutter",
"poethepoet",

View File

@ -1,12 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: agent_events.proto
# Protobuf Python Version: 4.25.1
# Protobuf Python Version: 5.29.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
5,
29,
0,
'',
'agent_events.proto'
)
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
@ -19,8 +29,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x61gent_event
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'agent_events_pb2', _globals)
if _descriptor._USE_C_DESCRIPTORS == False:
_globals['DESCRIPTOR']._options = None
if not _descriptor._USE_C_DESCRIPTORS:
_globals['DESCRIPTOR']._loaded_options = None
_globals['DESCRIPTOR']._serialized_options = b'\252\002\033Microsoft.AutoGen.Contracts'
_globals['_TEXTMESSAGE']._serialized_start=30
_globals['_TEXTMESSAGE']._serialized_end=80

View File

@ -1,4 +1,24 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
GRPC_GENERATED_VERSION = '1.70.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False
try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True
if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in agent_events_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)

File diff suppressed because it is too large Load Diff