Skip to content

Regenerate google.protobuf stubs using mypy-protobuf #4341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 39 additions & 7 deletions third_party/2and3/google/protobuf/any_pb2.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
from typing import Optional, Text
# @generated by mypy-protobuf. Do not edit manually!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)

from google.protobuf.internal import well_known_types
from google.protobuf.message import Message
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)

class Any(Message, well_known_types.Any_):
type_url: Text
value: bytes
def __init__(self, type_url: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ...
from typing import (
Optional as typing___Optional,
Text as typing___Text,
)

from typing_extensions import (
Literal as typing_extensions___Literal,
)


builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int


DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...

class Any(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
type_url: typing___Text = ...
value: builtin___bytes = ...

def __init__(self,
*,
type_url : typing___Optional[typing___Text] = None,
value : typing___Optional[builtin___bytes] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"type_url",b"type_url",u"value",b"value"]) -> None: ...
type___Any = Any
63 changes: 52 additions & 11 deletions third_party/2and3/google/protobuf/any_test_pb2.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,56 @@
from typing import Iterable, Optional
# @generated by mypy-protobuf. Do not edit manually!
import sys
from google.protobuf.any_pb2 import (
Any as google___protobuf___any_pb2___Any,
)

from google.protobuf.any_pb2 import Any
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
from google.protobuf.message import Message
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)

from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer,
)

from google.protobuf.message import (
Message as google___protobuf___message___Message,
)

from typing import (
Iterable as typing___Iterable,
Optional as typing___Optional,
)

from typing_extensions import (
Literal as typing_extensions___Literal,
)


builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int


DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...

class TestAny(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
int32_value: builtin___int = ...

class TestAny(Message):
int32_value: int
@property
def any_value(self) -> Any: ...
def any_value(self) -> google___protobuf___any_pb2___Any: ...

@property
def repeated_any_value(self) -> RepeatedCompositeFieldContainer[Any]: ...
def __init__(
self, int32_value: Optional[int] = ..., any_value: Optional[Any] = ..., repeated_any_value: Optional[Iterable[Any]] = ...
) -> None: ...
def repeated_any_value(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___any_pb2___Any]: ...

def __init__(self,
*,
int32_value : typing___Optional[builtin___int] = None,
any_value : typing___Optional[google___protobuf___any_pb2___Any] = None,
repeated_any_value : typing___Optional[typing___Iterable[google___protobuf___any_pb2___Any]] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"any_value",b"any_value"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"any_value",b"any_value",u"int32_value",b"int32_value",u"repeated_any_value",b"repeated_any_value"]) -> None: ...
type___TestAny = TestAny
152 changes: 105 additions & 47 deletions third_party/2and3/google/protobuf/api_pb2.pyi
Original file line number Diff line number Diff line change
@@ -1,54 +1,112 @@
from typing import Iterable, Optional, Text
# @generated by mypy-protobuf. Do not edit manually!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)

from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
from google.protobuf.message import Message
from google.protobuf.source_context_pb2 import SourceContext
from google.protobuf.type_pb2 import Option, Syntax
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer,
)

from google.protobuf.message import (
Message as google___protobuf___message___Message,
)

from google.protobuf.source_context_pb2 import (
SourceContext as google___protobuf___source_context_pb2___SourceContext,
)

from google.protobuf.type_pb2 import (
Option as google___protobuf___type_pb2___Option,
SyntaxValue as google___protobuf___type_pb2___SyntaxValue,
)

from typing import (
Iterable as typing___Iterable,
Optional as typing___Optional,
Text as typing___Text,
)

from typing_extensions import (
Literal as typing_extensions___Literal,
)


builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int


DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...

class Api(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
version: typing___Text = ...
syntax: google___protobuf___type_pb2___SyntaxValue = ...

class Api(Message):
name: Text
version: Text
syntax: Syntax
@property
def methods(self) -> RepeatedCompositeFieldContainer[Method]: ...
def methods(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Method]: ...

@property
def options(self) -> RepeatedCompositeFieldContainer[Option]: ...
def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___type_pb2___Option]: ...

@property
def source_context(self) -> SourceContext: ...
def source_context(self) -> google___protobuf___source_context_pb2___SourceContext: ...

@property
def mixins(self) -> RepeatedCompositeFieldContainer[Mixin]: ...
def __init__(
self,
name: Optional[Text] = ...,
methods: Optional[Iterable[Method]] = ...,
options: Optional[Iterable[Option]] = ...,
version: Optional[Text] = ...,
source_context: Optional[SourceContext] = ...,
mixins: Optional[Iterable[Mixin]] = ...,
syntax: Optional[Syntax] = ...,
) -> None: ...

class Method(Message):
name: Text
request_type_url: Text
request_streaming: bool
response_type_url: Text
response_streaming: bool
syntax: Syntax
def mixins(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Mixin]: ...

def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
methods : typing___Optional[typing___Iterable[type___Method]] = None,
options : typing___Optional[typing___Iterable[google___protobuf___type_pb2___Option]] = None,
version : typing___Optional[typing___Text] = None,
source_context : typing___Optional[google___protobuf___source_context_pb2___SourceContext] = None,
mixins : typing___Optional[typing___Iterable[type___Mixin]] = None,
syntax : typing___Optional[google___protobuf___type_pb2___SyntaxValue] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"source_context",b"source_context"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"methods",b"methods",u"mixins",b"mixins",u"name",b"name",u"options",b"options",u"source_context",b"source_context",u"syntax",b"syntax",u"version",b"version"]) -> None: ...
type___Api = Api

class Method(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
request_type_url: typing___Text = ...
request_streaming: builtin___bool = ...
response_type_url: typing___Text = ...
response_streaming: builtin___bool = ...
syntax: google___protobuf___type_pb2___SyntaxValue = ...

@property
def options(self) -> RepeatedCompositeFieldContainer[Option]: ...
def __init__(
self,
name: Optional[Text] = ...,
request_type_url: Optional[Text] = ...,
request_streaming: Optional[bool] = ...,
response_type_url: Optional[Text] = ...,
response_streaming: Optional[bool] = ...,
options: Optional[Iterable[Option]] = ...,
syntax: Optional[Syntax] = ...,
) -> None: ...

class Mixin(Message):
name: Text
root: Text
def __init__(self, name: Optional[Text] = ..., root: Optional[Text] = ...) -> None: ...
def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___type_pb2___Option]: ...

def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
request_type_url : typing___Optional[typing___Text] = None,
request_streaming : typing___Optional[builtin___bool] = None,
response_type_url : typing___Optional[typing___Text] = None,
response_streaming : typing___Optional[builtin___bool] = None,
options : typing___Optional[typing___Iterable[google___protobuf___type_pb2___Option]] = None,
syntax : typing___Optional[google___protobuf___type_pb2___SyntaxValue] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"options",b"options",u"request_streaming",b"request_streaming",u"request_type_url",b"request_type_url",u"response_streaming",b"response_streaming",u"response_type_url",b"response_type_url",u"syntax",b"syntax"]) -> None: ...
type___Method = Method

class Mixin(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
root: typing___Text = ...

def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
root : typing___Optional[typing___Text] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"root",b"root"]) -> None: ...
type___Mixin = Mixin
Loading