-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Description
I'm using mypy-protobuf to generate types for the envoy protos and getting the following error:
envoy/config/core/v3/config_source_pb2.pyi:109: error: Duplicate argument "self" in function definition
This is due to the original protobuf having an oneof field with a self as a value:
oneof config_source_specifier {
option (validate.required) = true;
string path = 1 [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
PathConfigSource path_config_source = 8;
ApiConfigSource api_config_source = 2;
AggregatedConfigSource ads = 3;
SelfConfigSource self = 5;
}
A snippet from the generated pyi:
class ConfigSource(_message.Message):
__slots__ = ("authorities", "path", "path_config_source", "api_config_source", "ads", "self", "initial_fetch_timeout", "resource_api_version")
...
path_config_source: PathConfigSource
api_config_source: ApiConfigSource
ads: AggregatedConfigSource
self: SelfConfigSource
...
def __init__(self, authorities: _Optional[_Iterable[_Union[_authority_pb2.Authority, _Mapping]]] = ..., path: _Optional[str] = ..., path_config_source: _Optional[_Union[PathConfigSource, _Mapping]] = ..., api_config_source: _Optional[_Union[ApiConfigSource, _Mapping]] = ..., ads: _Optional[_Union[AggregatedConfigSource, _Mapping]] = ..., self: _Optional[_Union[SelfConfigSource, _Mapping]] = ..., initial_fetch_timeout: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., resource_api_version: _Optional[_Union[ApiVersion, str]] = ...) -> None: ...
I'm using the mypy-protobuf from the buf.build sdk:
python3 -m pip install envoyproxy-envoy-community-nipunn1313-mypy==3.6.0.1.20240722201322+b1787804afc0 --extra-index-url https://buf.build/gen/python
Metadata
Metadata
Assignees
Labels
No labels