Skip to content

Commit 35064a7

Browse files
authored
Bump to mypy-protobuf 3.2.0 (#7013)
1 parent dc176d7 commit 35064a7

14 files changed

+614
-603
lines changed

scripts/generate_proto_stubs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ set -ex -o pipefail
1111
# followed by committing the changes to typeshed
1212
#
1313
# Update these two variables when rerunning script
14-
PROTOBUF_VERSION=3.19.2
15-
MYPY_PROTOBUF_VERSION=v3.0.0
14+
PROTOBUF_VERSION=3.19.3
15+
MYPY_PROTOBUF_VERSION=v3.2.0
1616

1717
if uname -a | grep Darwin; then
1818
# brew install coreutils wget

stubs/protobuf/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
version = "3.19.*"
22
python2 = true
33
requires = ["types-futures"]
4-
extra_description = "Generated with aid from mypy-protobuf v3.0.0"
4+
extra_description = "Generated with aid from mypy-protobuf v3.2.0"

stubs/protobuf/google/protobuf/any_pb2.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import google.protobuf.message
99
import typing
1010
import typing_extensions
1111

12-
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
12+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
1313

1414
class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Any):
1515
"""`Any` contains an arbitrary serialized protocol buffer message along with a
@@ -95,10 +95,10 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t
9595
"value": "1.212s"
9696
}
9797
"""
98-
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
98+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
9999
TYPE_URL_FIELD_NUMBER: builtins.int
100100
VALUE_FIELD_NUMBER: builtins.int
101-
type_url: typing.Text = ...
101+
type_url: typing.Text
102102
"""A URL/resource name that uniquely identifies the type of the serialized
103103
protocol buffer message. This string must contain at least
104104
one "/" character. The last segment of the URL's path must represent
@@ -128,13 +128,13 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t
128128
used with implementation specific semantics.
129129
"""
130130

131-
value: builtins.bytes = ...
131+
value: builtins.bytes
132132
"""Must be a valid serialized protocol buffer of the above specified type."""
133133

134134
def __init__(self,
135135
*,
136-
type_url : typing.Text = ...,
137-
value : builtins.bytes = ...,
136+
type_url: typing.Text = ...,
137+
value: builtins.bytes = ...,
138138
) -> None: ...
139139
def ClearField(self, field_name: typing_extensions.Literal["type_url",b"type_url","value",b"value"]) -> None: ...
140140
global___Any = Any

stubs/protobuf/google/protobuf/api_pb2.pyi

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import google.protobuf.type_pb2
1111
import typing
1212
import typing_extensions
1313

14-
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
14+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
1515

1616
class Api(google.protobuf.message.Message):
1717
"""Api is a light-weight descriptor for an API Interface.
@@ -24,15 +24,15 @@ class Api(google.protobuf.message.Message):
2424
this message itself. See https://cloud.google.com/apis/design/glossary for
2525
detailed terminology.
2626
"""
27-
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
27+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
2828
NAME_FIELD_NUMBER: builtins.int
2929
METHODS_FIELD_NUMBER: builtins.int
3030
OPTIONS_FIELD_NUMBER: builtins.int
3131
VERSION_FIELD_NUMBER: builtins.int
3232
SOURCE_CONTEXT_FIELD_NUMBER: builtins.int
3333
MIXINS_FIELD_NUMBER: builtins.int
3434
SYNTAX_FIELD_NUMBER: builtins.int
35-
name: typing.Text = ...
35+
name: typing.Text
3636
"""The fully qualified name of this interface, including package name
3737
followed by the interface's simple name.
3838
"""
@@ -45,7 +45,7 @@ class Api(google.protobuf.message.Message):
4545
def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]:
4646
"""Any metadata attached to the interface."""
4747
pass
48-
version: typing.Text = ...
48+
version: typing.Text
4949
"""A version string for this interface. If specified, must have the form
5050
`major-version.minor-version`, as in `1.10`. If the minor version is
5151
omitted, it defaults to zero. If the entire version field is empty, the
@@ -77,64 +77,64 @@ class Api(google.protobuf.message.Message):
7777
def mixins(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Mixin]:
7878
"""Included interfaces. See [Mixin][]."""
7979
pass
80-
syntax: google.protobuf.type_pb2.Syntax.V = ...
80+
syntax: google.protobuf.type_pb2.Syntax.ValueType
8181
"""The source syntax of the service."""
8282

8383
def __init__(self,
8484
*,
85-
name : typing.Text = ...,
86-
methods : typing.Optional[typing.Iterable[global___Method]] = ...,
87-
options : typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ...,
88-
version : typing.Text = ...,
89-
source_context : typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ...,
90-
mixins : typing.Optional[typing.Iterable[global___Mixin]] = ...,
91-
syntax : google.protobuf.type_pb2.Syntax.V = ...,
85+
name: typing.Text = ...,
86+
methods: typing.Optional[typing.Iterable[global___Method]] = ...,
87+
options: typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ...,
88+
version: typing.Text = ...,
89+
source_context: typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ...,
90+
mixins: typing.Optional[typing.Iterable[global___Mixin]] = ...,
91+
syntax: google.protobuf.type_pb2.Syntax.ValueType = ...,
9292
) -> None: ...
9393
def HasField(self, field_name: typing_extensions.Literal["source_context",b"source_context"]) -> builtins.bool: ...
9494
def ClearField(self, field_name: typing_extensions.Literal["methods",b"methods","mixins",b"mixins","name",b"name","options",b"options","source_context",b"source_context","syntax",b"syntax","version",b"version"]) -> None: ...
9595
global___Api = Api
9696

9797
class Method(google.protobuf.message.Message):
9898
"""Method represents a method of an API interface."""
99-
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
99+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
100100
NAME_FIELD_NUMBER: builtins.int
101101
REQUEST_TYPE_URL_FIELD_NUMBER: builtins.int
102102
REQUEST_STREAMING_FIELD_NUMBER: builtins.int
103103
RESPONSE_TYPE_URL_FIELD_NUMBER: builtins.int
104104
RESPONSE_STREAMING_FIELD_NUMBER: builtins.int
105105
OPTIONS_FIELD_NUMBER: builtins.int
106106
SYNTAX_FIELD_NUMBER: builtins.int
107-
name: typing.Text = ...
107+
name: typing.Text
108108
"""The simple name of this method."""
109109

110-
request_type_url: typing.Text = ...
110+
request_type_url: typing.Text
111111
"""A URL of the input message type."""
112112

113-
request_streaming: builtins.bool = ...
113+
request_streaming: builtins.bool
114114
"""If true, the request is streamed."""
115115

116-
response_type_url: typing.Text = ...
116+
response_type_url: typing.Text
117117
"""The URL of the output message type."""
118118

119-
response_streaming: builtins.bool = ...
119+
response_streaming: builtins.bool
120120
"""If true, the response is streamed."""
121121

122122
@property
123123
def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]:
124124
"""Any metadata attached to the method."""
125125
pass
126-
syntax: google.protobuf.type_pb2.Syntax.V = ...
126+
syntax: google.protobuf.type_pb2.Syntax.ValueType
127127
"""The source syntax of this method."""
128128

129129
def __init__(self,
130130
*,
131-
name : typing.Text = ...,
132-
request_type_url : typing.Text = ...,
133-
request_streaming : builtins.bool = ...,
134-
response_type_url : typing.Text = ...,
135-
response_streaming : builtins.bool = ...,
136-
options : typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ...,
137-
syntax : google.protobuf.type_pb2.Syntax.V = ...,
131+
name: typing.Text = ...,
132+
request_type_url: typing.Text = ...,
133+
request_streaming: builtins.bool = ...,
134+
response_type_url: typing.Text = ...,
135+
response_streaming: builtins.bool = ...,
136+
options: typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ...,
137+
syntax: google.protobuf.type_pb2.Syntax.ValueType = ...,
138138
) -> None: ...
139139
def ClearField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options","request_streaming",b"request_streaming","request_type_url",b"request_type_url","response_streaming",b"response_streaming","response_type_url",b"response_type_url","syntax",b"syntax"]) -> None: ...
140140
global___Method = Method
@@ -219,21 +219,21 @@ class Mixin(google.protobuf.message.Message):
219219
...
220220
}
221221
"""
222-
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
222+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
223223
NAME_FIELD_NUMBER: builtins.int
224224
ROOT_FIELD_NUMBER: builtins.int
225-
name: typing.Text = ...
225+
name: typing.Text
226226
"""The fully qualified name of the interface which is included."""
227227

228-
root: typing.Text = ...
228+
root: typing.Text
229229
"""If non-empty specifies a path under which inherited HTTP paths
230230
are rooted.
231231
"""
232232

233233
def __init__(self,
234234
*,
235-
name : typing.Text = ...,
236-
root : typing.Text = ...,
235+
name: typing.Text = ...,
236+
root: typing.Text = ...,
237237
) -> None: ...
238238
def ClearField(self, field_name: typing_extensions.Literal["name",b"name","root",b"root"]) -> None: ...
239239
global___Mixin = Mixin

stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,37 @@ import google.protobuf.message
1111
import typing
1212
import typing_extensions
1313

14-
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
14+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
1515

1616
class Version(google.protobuf.message.Message):
1717
"""The version number of protocol compiler."""
18-
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
18+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
1919
MAJOR_FIELD_NUMBER: builtins.int
2020
MINOR_FIELD_NUMBER: builtins.int
2121
PATCH_FIELD_NUMBER: builtins.int
2222
SUFFIX_FIELD_NUMBER: builtins.int
23-
major: builtins.int = ...
24-
minor: builtins.int = ...
25-
patch: builtins.int = ...
26-
suffix: typing.Text = ...
23+
major: builtins.int
24+
minor: builtins.int
25+
patch: builtins.int
26+
suffix: typing.Text
2727
"""A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
2828
be empty for mainline stable releases.
2929
"""
3030

3131
def __init__(self,
3232
*,
33-
major : typing.Optional[builtins.int] = ...,
34-
minor : typing.Optional[builtins.int] = ...,
35-
patch : typing.Optional[builtins.int] = ...,
36-
suffix : typing.Optional[typing.Text] = ...,
33+
major: typing.Optional[builtins.int] = ...,
34+
minor: typing.Optional[builtins.int] = ...,
35+
patch: typing.Optional[builtins.int] = ...,
36+
suffix: typing.Optional[typing.Text] = ...,
3737
) -> None: ...
3838
def HasField(self, field_name: typing_extensions.Literal["major",b"major","minor",b"minor","patch",b"patch","suffix",b"suffix"]) -> builtins.bool: ...
3939
def ClearField(self, field_name: typing_extensions.Literal["major",b"major","minor",b"minor","patch",b"patch","suffix",b"suffix"]) -> None: ...
4040
global___Version = Version
4141

4242
class CodeGeneratorRequest(google.protobuf.message.Message):
4343
"""An encoded CodeGeneratorRequest is written to the plugin's stdin."""
44-
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
44+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
4545
FILE_TO_GENERATE_FIELD_NUMBER: builtins.int
4646
PARAMETER_FIELD_NUMBER: builtins.int
4747
PROTO_FILE_FIELD_NUMBER: builtins.int
@@ -53,7 +53,7 @@ class CodeGeneratorRequest(google.protobuf.message.Message):
5353
descriptor will be included in proto_file, below.
5454
"""
5555
pass
56-
parameter: typing.Text = ...
56+
parameter: typing.Text
5757
"""The generator parameter passed on the command-line."""
5858

5959
@property
@@ -80,39 +80,40 @@ class CodeGeneratorRequest(google.protobuf.message.Message):
8080
pass
8181
def __init__(self,
8282
*,
83-
file_to_generate : typing.Optional[typing.Iterable[typing.Text]] = ...,
84-
parameter : typing.Optional[typing.Text] = ...,
85-
proto_file : typing.Optional[typing.Iterable[google.protobuf.descriptor_pb2.FileDescriptorProto]] = ...,
86-
compiler_version : typing.Optional[global___Version] = ...,
83+
file_to_generate: typing.Optional[typing.Iterable[typing.Text]] = ...,
84+
parameter: typing.Optional[typing.Text] = ...,
85+
proto_file: typing.Optional[typing.Iterable[google.protobuf.descriptor_pb2.FileDescriptorProto]] = ...,
86+
compiler_version: typing.Optional[global___Version] = ...,
8787
) -> None: ...
8888
def HasField(self, field_name: typing_extensions.Literal["compiler_version",b"compiler_version","parameter",b"parameter"]) -> builtins.bool: ...
8989
def ClearField(self, field_name: typing_extensions.Literal["compiler_version",b"compiler_version","file_to_generate",b"file_to_generate","parameter",b"parameter","proto_file",b"proto_file"]) -> None: ...
9090
global___CodeGeneratorRequest = CodeGeneratorRequest
9191

9292
class CodeGeneratorResponse(google.protobuf.message.Message):
9393
"""The plugin writes an encoded CodeGeneratorResponse to stdout."""
94-
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
94+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
95+
class _Feature:
96+
ValueType = typing.NewType('ValueType', builtins.int)
97+
V: typing_extensions.TypeAlias = ValueType
98+
class _FeatureEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[CodeGeneratorResponse._Feature.ValueType], builtins.type):
99+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
100+
FEATURE_NONE: CodeGeneratorResponse._Feature.ValueType # 0
101+
FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse._Feature.ValueType # 1
95102
class Feature(_Feature, metaclass=_FeatureEnumTypeWrapper):
96103
"""Sync with code_generator.h."""
97104
pass
98-
class _Feature:
99-
V = typing.NewType('V', builtins.int)
100-
class _FeatureEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Feature.V], builtins.type):
101-
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
102-
FEATURE_NONE = CodeGeneratorResponse.Feature.V(0)
103-
FEATURE_PROTO3_OPTIONAL = CodeGeneratorResponse.Feature.V(1)
104105

105-
FEATURE_NONE = CodeGeneratorResponse.Feature.V(0)
106-
FEATURE_PROTO3_OPTIONAL = CodeGeneratorResponse.Feature.V(1)
106+
FEATURE_NONE: CodeGeneratorResponse.Feature.ValueType # 0
107+
FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse.Feature.ValueType # 1
107108

108109
class File(google.protobuf.message.Message):
109110
"""Represents a single generated file."""
110-
DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
111+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
111112
NAME_FIELD_NUMBER: builtins.int
112113
INSERTION_POINT_FIELD_NUMBER: builtins.int
113114
CONTENT_FIELD_NUMBER: builtins.int
114115
GENERATED_CODE_INFO_FIELD_NUMBER: builtins.int
115-
name: typing.Text = ...
116+
name: typing.Text
116117
"""The file name, relative to the output directory. The name must not
117118
contain "." or ".." components and must be relative, not be absolute (so,
118119
the file cannot lie outside the output directory). "/" must be used as
@@ -126,7 +127,7 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
126127
CodeGeneratorResponse before writing files to disk.
127128
"""
128129

129-
insertion_point: typing.Text = ...
130+
insertion_point: typing.Text
130131
"""If non-empty, indicates that the named file should already exist, and the
131132
content here is to be inserted into that file at a defined insertion
132133
point. This feature allows a code generator to extend the output
@@ -166,7 +167,7 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
166167
If |insertion_point| is present, |name| must also be present.
167168
"""
168169

169-
content: typing.Text = ...
170+
content: typing.Text
170171
"""The file contents."""
171172

172173
@property
@@ -178,18 +179,18 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
178179
pass
179180
def __init__(self,
180181
*,
181-
name : typing.Optional[typing.Text] = ...,
182-
insertion_point : typing.Optional[typing.Text] = ...,
183-
content : typing.Optional[typing.Text] = ...,
184-
generated_code_info : typing.Optional[google.protobuf.descriptor_pb2.GeneratedCodeInfo] = ...,
182+
name: typing.Optional[typing.Text] = ...,
183+
insertion_point: typing.Optional[typing.Text] = ...,
184+
content: typing.Optional[typing.Text] = ...,
185+
generated_code_info: typing.Optional[google.protobuf.descriptor_pb2.GeneratedCodeInfo] = ...,
185186
) -> None: ...
186187
def HasField(self, field_name: typing_extensions.Literal["content",b"content","generated_code_info",b"generated_code_info","insertion_point",b"insertion_point","name",b"name"]) -> builtins.bool: ...
187188
def ClearField(self, field_name: typing_extensions.Literal["content",b"content","generated_code_info",b"generated_code_info","insertion_point",b"insertion_point","name",b"name"]) -> None: ...
188189

189190
ERROR_FIELD_NUMBER: builtins.int
190191
SUPPORTED_FEATURES_FIELD_NUMBER: builtins.int
191192
FILE_FIELD_NUMBER: builtins.int
192-
error: typing.Text = ...
193+
error: typing.Text
193194
"""Error message. If non-empty, code generation failed. The plugin process
194195
should exit with status code zero even if it reports an error in this way.
195196
@@ -200,7 +201,7 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
200201
exiting with a non-zero status code.
201202
"""
202203

203-
supported_features: builtins.int = ...
204+
supported_features: builtins.int
204205
"""A bitmask of supported features that the code generator supports.
205206
This is a bitwise "or" of values from the Feature enum.
206207
"""
@@ -209,9 +210,9 @@ class CodeGeneratorResponse(google.protobuf.message.Message):
209210
def file(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CodeGeneratorResponse.File]: ...
210211
def __init__(self,
211212
*,
212-
error : typing.Optional[typing.Text] = ...,
213-
supported_features : typing.Optional[builtins.int] = ...,
214-
file : typing.Optional[typing.Iterable[global___CodeGeneratorResponse.File]] = ...,
213+
error: typing.Optional[typing.Text] = ...,
214+
supported_features: typing.Optional[builtins.int] = ...,
215+
file: typing.Optional[typing.Iterable[global___CodeGeneratorResponse.File]] = ...,
215216
) -> None: ...
216217
def HasField(self, field_name: typing_extensions.Literal["error",b"error","supported_features",b"supported_features"]) -> builtins.bool: ...
217218
def ClearField(self, field_name: typing_extensions.Literal["error",b"error","file",b"file","supported_features",b"supported_features"]) -> None: ...

0 commit comments

Comments
 (0)