Skip to content

Commit ab0339a

Browse files
Update protobuf to ~=6.32.1 (#14707)
1 parent 29c69fe commit ab0339a

File tree

5 files changed

+174
-12
lines changed

5 files changed

+174
-12
lines changed

stubs/protobuf/METADATA.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Using an exact number in the specifier for scripts/sync_protobuf/google_protobuf.py
22
# When updating, also re-run the script
3-
version = "~=6.30.2"
3+
version = "~=6.32.1"
44
upstream_repository = "https://github.com/protocolbuffers/protobuf"
5-
extra_description = "Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 29.0 on [protobuf v30.2](https://github.com/protocolbuffers/protobuf/releases/tag/v30.2) (python `protobuf==6.30.2`)."
5+
extra_description = "Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 31.1 on [protobuf v32.1](https://github.com/protocolbuffers/protobuf/releases/tag/v32.1) (python `protobuf==6.32.1`)."
66
partial_stub = true
77

88
[tool.stubtest]

stubs/protobuf/google/protobuf/api_pb2.pyi

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ class Api(google.protobuf.message.Message):
5555
sometimes simply referred to as "APIs" in other contexts, such as the name of
5656
this message itself. See https://cloud.google.com/apis/design/glossary for
5757
detailed terminology.
58+
59+
New usages of this message as an alternative to ServiceDescriptorProto are
60+
strongly discouraged. This message does not reliability preserve all
61+
information necessary to model the schema and preserve semantics. Instead
62+
make use of FileDescriptorSet which preserves the necessary information.
5863
"""
5964

6065
DESCRIPTOR: google.protobuf.descriptor.Descriptor
@@ -66,6 +71,7 @@ class Api(google.protobuf.message.Message):
6671
SOURCE_CONTEXT_FIELD_NUMBER: builtins.int
6772
MIXINS_FIELD_NUMBER: builtins.int
6873
SYNTAX_FIELD_NUMBER: builtins.int
74+
EDITION_FIELD_NUMBER: builtins.int
6975
name: builtins.str
7076
"""The fully qualified name of this interface, including package name
7177
followed by the interface's simple name.
@@ -93,6 +99,8 @@ class Api(google.protobuf.message.Message):
9399
"""
94100
syntax: google.protobuf.type_pb2.Syntax.ValueType
95101
"""The source syntax of the service."""
102+
edition: builtins.str
103+
"""The source edition string, only valid when syntax is SYNTAX_EDITIONS."""
96104
@property
97105
def methods(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Method]:
98106
"""The methods of this interface, in unspecified order."""
@@ -121,11 +129,14 @@ class Api(google.protobuf.message.Message):
121129
source_context: google.protobuf.source_context_pb2.SourceContext | None = ...,
122130
mixins: collections.abc.Iterable[global___Mixin] | None = ...,
123131
syntax: google.protobuf.type_pb2.Syntax.ValueType | None = ...,
132+
edition: builtins.str | None = ...,
124133
) -> None: ...
125134
def HasField(self, field_name: typing.Literal["source_context", b"source_context"]) -> builtins.bool: ...
126135
def ClearField(
127136
self,
128137
field_name: typing.Literal[
138+
"edition",
139+
b"edition",
129140
"methods",
130141
b"methods",
131142
"mixins",
@@ -147,7 +158,13 @@ global___Api = Api
147158

148159
@typing.final
149160
class Method(google.protobuf.message.Message):
150-
"""Method represents a method of an API interface."""
161+
"""Method represents a method of an API interface.
162+
163+
New usages of this message as an alternative to MethodDescriptorProto are
164+
strongly discouraged. This message does not reliability preserve all
165+
information necessary to model the schema and preserve semantics. Instead
166+
make use of FileDescriptorSet which preserves the necessary information.
167+
"""
151168

152169
DESCRIPTOR: google.protobuf.descriptor.Descriptor
153170

@@ -158,6 +175,7 @@ class Method(google.protobuf.message.Message):
158175
RESPONSE_STREAMING_FIELD_NUMBER: builtins.int
159176
OPTIONS_FIELD_NUMBER: builtins.int
160177
SYNTAX_FIELD_NUMBER: builtins.int
178+
EDITION_FIELD_NUMBER: builtins.int
161179
name: builtins.str
162180
"""The simple name of this method."""
163181
request_type_url: builtins.str
@@ -169,7 +187,17 @@ class Method(google.protobuf.message.Message):
169187
response_streaming: builtins.bool
170188
"""If true, the response is streamed."""
171189
syntax: google.protobuf.type_pb2.Syntax.ValueType
172-
"""The source syntax of this method."""
190+
"""The source syntax of this method.
191+
192+
This field should be ignored, instead the syntax should be inherited from
193+
Api. This is similar to Field and EnumValue.
194+
"""
195+
edition: builtins.str
196+
"""The source edition string, only valid when syntax is SYNTAX_EDITIONS.
197+
198+
This field should be ignored, instead the edition should be inherited from
199+
Api. This is similar to Field and EnumValue.
200+
"""
173201
@property
174202
def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]:
175203
"""Any metadata attached to the method."""
@@ -184,10 +212,13 @@ class Method(google.protobuf.message.Message):
184212
response_streaming: builtins.bool | None = ...,
185213
options: collections.abc.Iterable[google.protobuf.type_pb2.Option] | None = ...,
186214
syntax: google.protobuf.type_pb2.Syntax.ValueType | None = ...,
215+
edition: builtins.str | None = ...,
187216
) -> None: ...
188217
def ClearField(
189218
self,
190219
field_name: typing.Literal[
220+
"edition",
221+
b"edition",
191222
"name",
192223
b"name",
193224
"options",

stubs/protobuf/google/protobuf/descriptor_pb2.pyi

Lines changed: 107 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,31 @@ support a new edition.
103103
"""
104104
global___Edition = Edition
105105

106+
class _SymbolVisibility:
107+
ValueType = typing.NewType("ValueType", builtins.int)
108+
V: typing_extensions.TypeAlias = ValueType
109+
110+
class _SymbolVisibilityEnumTypeWrapper(
111+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SymbolVisibility.ValueType], builtins.type
112+
):
113+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
114+
VISIBILITY_UNSET: _SymbolVisibility.ValueType # 0
115+
VISIBILITY_LOCAL: _SymbolVisibility.ValueType # 1
116+
VISIBILITY_EXPORT: _SymbolVisibility.ValueType # 2
117+
118+
class SymbolVisibility(_SymbolVisibility, metaclass=_SymbolVisibilityEnumTypeWrapper):
119+
"""Describes the 'visibility' of a symbol with respect to the proto import
120+
system. Symbols can only be imported when the visibility rules do not prevent
121+
it (ex: local symbols cannot be imported). Visibility modifiers can only set
122+
on `message` and `enum` as they are the only types available to be referenced
123+
from other files.
124+
"""
125+
126+
VISIBILITY_UNSET: SymbolVisibility.ValueType # 0
127+
VISIBILITY_LOCAL: SymbolVisibility.ValueType # 1
128+
VISIBILITY_EXPORT: SymbolVisibility.ValueType # 2
129+
global___SymbolVisibility = SymbolVisibility
130+
106131
@typing.final
107132
class FileDescriptorSet(google.protobuf.message.Message):
108133
"""The protocol compiler can output a FileDescriptorSet containing the .proto
@@ -130,6 +155,7 @@ class FileDescriptorProto(google.protobuf.message.Message):
130155
DEPENDENCY_FIELD_NUMBER: builtins.int
131156
PUBLIC_DEPENDENCY_FIELD_NUMBER: builtins.int
132157
WEAK_DEPENDENCY_FIELD_NUMBER: builtins.int
158+
OPTION_DEPENDENCY_FIELD_NUMBER: builtins.int
133159
MESSAGE_TYPE_FIELD_NUMBER: builtins.int
134160
ENUM_TYPE_FIELD_NUMBER: builtins.int
135161
SERVICE_FIELD_NUMBER: builtins.int
@@ -171,6 +197,12 @@ class FileDescriptorProto(google.protobuf.message.Message):
171197
For Google-internal migration only. Do not use.
172198
"""
173199

200+
@property
201+
def option_dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
202+
"""Names of files imported by this file purely for the purpose of providing
203+
option extensions. These are excluded from the dependency list above.
204+
"""
205+
174206
@property
175207
def message_type(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DescriptorProto]:
176208
"""All top-level definitions in this file."""
@@ -199,6 +231,7 @@ class FileDescriptorProto(google.protobuf.message.Message):
199231
dependency: collections.abc.Iterable[builtins.str] | None = ...,
200232
public_dependency: collections.abc.Iterable[builtins.int] | None = ...,
201233
weak_dependency: collections.abc.Iterable[builtins.int] | None = ...,
234+
option_dependency: collections.abc.Iterable[builtins.str] | None = ...,
202235
message_type: collections.abc.Iterable[global___DescriptorProto] | None = ...,
203236
enum_type: collections.abc.Iterable[global___EnumDescriptorProto] | None = ...,
204237
service: collections.abc.Iterable[global___ServiceDescriptorProto] | None = ...,
@@ -240,6 +273,8 @@ class FileDescriptorProto(google.protobuf.message.Message):
240273
b"message_type",
241274
"name",
242275
b"name",
276+
"option_dependency",
277+
b"option_dependency",
243278
"options",
244279
b"options",
245280
"package",
@@ -319,7 +354,10 @@ class DescriptorProto(google.protobuf.message.Message):
319354
OPTIONS_FIELD_NUMBER: builtins.int
320355
RESERVED_RANGE_FIELD_NUMBER: builtins.int
321356
RESERVED_NAME_FIELD_NUMBER: builtins.int
357+
VISIBILITY_FIELD_NUMBER: builtins.int
322358
name: builtins.str
359+
visibility: global___SymbolVisibility.ValueType
360+
"""Support for `export` and `local` keywords on enums."""
323361
@property
324362
def field(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FieldDescriptorProto]: ...
325363
@property
@@ -361,8 +399,11 @@ class DescriptorProto(google.protobuf.message.Message):
361399
options: global___MessageOptions | None = ...,
362400
reserved_range: collections.abc.Iterable[global___DescriptorProto.ReservedRange] | None = ...,
363401
reserved_name: collections.abc.Iterable[builtins.str] | None = ...,
402+
visibility: global___SymbolVisibility.ValueType | None = ...,
364403
) -> None: ...
365-
def HasField(self, field_name: typing.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ...
404+
def HasField(
405+
self, field_name: typing.Literal["name", b"name", "options", b"options", "visibility", b"visibility"]
406+
) -> builtins.bool: ...
366407
def ClearField(
367408
self,
368409
field_name: typing.Literal[
@@ -386,6 +427,8 @@ class DescriptorProto(google.protobuf.message.Message):
386427
b"reserved_name",
387428
"reserved_range",
388429
b"reserved_range",
430+
"visibility",
431+
b"visibility",
389432
],
390433
) -> None: ...
391434

@@ -829,7 +872,10 @@ class EnumDescriptorProto(google.protobuf.message.Message):
829872
OPTIONS_FIELD_NUMBER: builtins.int
830873
RESERVED_RANGE_FIELD_NUMBER: builtins.int
831874
RESERVED_NAME_FIELD_NUMBER: builtins.int
875+
VISIBILITY_FIELD_NUMBER: builtins.int
832876
name: builtins.str
877+
visibility: global___SymbolVisibility.ValueType
878+
"""Support for `export` and `local` keywords on enums."""
833879
@property
834880
def value(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumValueDescriptorProto]: ...
835881
@property
@@ -857,8 +903,11 @@ class EnumDescriptorProto(google.protobuf.message.Message):
857903
options: global___EnumOptions | None = ...,
858904
reserved_range: collections.abc.Iterable[global___EnumDescriptorProto.EnumReservedRange] | None = ...,
859905
reserved_name: collections.abc.Iterable[builtins.str] | None = ...,
906+
visibility: global___SymbolVisibility.ValueType | None = ...,
860907
) -> None: ...
861-
def HasField(self, field_name: typing.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ...
908+
def HasField(
909+
self, field_name: typing.Literal["name", b"name", "options", b"options", "visibility", b"visibility"]
910+
) -> builtins.bool: ...
862911
def ClearField(
863912
self,
864913
field_name: typing.Literal[
@@ -872,6 +921,8 @@ class EnumDescriptorProto(google.protobuf.message.Message):
872921
b"reserved_range",
873922
"value",
874923
b"value",
924+
"visibility",
925+
b"visibility",
875926
],
876927
) -> None: ...
877928

@@ -1732,7 +1783,9 @@ class FieldOptions(google.protobuf.message.Message):
17321783
is a formalization for deprecating fields.
17331784
"""
17341785
weak: builtins.bool
1735-
"""For Google-internal migration only. Do not use."""
1786+
"""DEPRECATED. DO NOT USE!
1787+
For Google-internal migration only. Do not use.
1788+
"""
17361789
debug_redact: builtins.bool
17371790
"""Indicate that the field value should not be printed out when using debug
17381791
formats, e.g. when the field contains sensitive credentials.
@@ -2413,20 +2466,66 @@ class FeatureSet(google.protobuf.message.Message):
24132466
STYLE2024: FeatureSet.EnforceNamingStyle.ValueType # 1
24142467
STYLE_LEGACY: FeatureSet.EnforceNamingStyle.ValueType # 2
24152468

2469+
@typing.final
2470+
class VisibilityFeature(google.protobuf.message.Message):
2471+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
2472+
2473+
class _DefaultSymbolVisibility:
2474+
ValueType = typing.NewType("ValueType", builtins.int)
2475+
V: typing_extensions.TypeAlias = ValueType
2476+
2477+
class _DefaultSymbolVisibilityEnumTypeWrapper(
2478+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
2479+
FeatureSet.VisibilityFeature._DefaultSymbolVisibility.ValueType
2480+
],
2481+
builtins.type,
2482+
):
2483+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
2484+
DEFAULT_SYMBOL_VISIBILITY_UNKNOWN: FeatureSet.VisibilityFeature._DefaultSymbolVisibility.ValueType # 0
2485+
EXPORT_ALL: FeatureSet.VisibilityFeature._DefaultSymbolVisibility.ValueType # 1
2486+
"""Default pre-EDITION_2024, all UNSET visibility are export."""
2487+
EXPORT_TOP_LEVEL: FeatureSet.VisibilityFeature._DefaultSymbolVisibility.ValueType # 2
2488+
"""All top-level symbols default to export, nested default to local."""
2489+
LOCAL_ALL: FeatureSet.VisibilityFeature._DefaultSymbolVisibility.ValueType # 3
2490+
"""All symbols default to local."""
2491+
STRICT: FeatureSet.VisibilityFeature._DefaultSymbolVisibility.ValueType # 4
2492+
"""All symbols local by default. Nested types cannot be exported.
2493+
With special case caveat for message { enum {} reserved 1 to max; }
2494+
This is the recommended setting for new protos.
2495+
"""
2496+
2497+
class DefaultSymbolVisibility(_DefaultSymbolVisibility, metaclass=_DefaultSymbolVisibilityEnumTypeWrapper): ...
2498+
DEFAULT_SYMBOL_VISIBILITY_UNKNOWN: FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType # 0
2499+
EXPORT_ALL: FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType # 1
2500+
"""Default pre-EDITION_2024, all UNSET visibility are export."""
2501+
EXPORT_TOP_LEVEL: FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType # 2
2502+
"""All top-level symbols default to export, nested default to local."""
2503+
LOCAL_ALL: FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType # 3
2504+
"""All symbols default to local."""
2505+
STRICT: FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType # 4
2506+
"""All symbols local by default. Nested types cannot be exported.
2507+
With special case caveat for message { enum {} reserved 1 to max; }
2508+
This is the recommended setting for new protos.
2509+
"""
2510+
2511+
def __init__(self) -> None: ...
2512+
24162513
FIELD_PRESENCE_FIELD_NUMBER: builtins.int
24172514
ENUM_TYPE_FIELD_NUMBER: builtins.int
24182515
REPEATED_FIELD_ENCODING_FIELD_NUMBER: builtins.int
24192516
UTF8_VALIDATION_FIELD_NUMBER: builtins.int
24202517
MESSAGE_ENCODING_FIELD_NUMBER: builtins.int
24212518
JSON_FORMAT_FIELD_NUMBER: builtins.int
24222519
ENFORCE_NAMING_STYLE_FIELD_NUMBER: builtins.int
2520+
DEFAULT_SYMBOL_VISIBILITY_FIELD_NUMBER: builtins.int
24232521
field_presence: global___FeatureSet.FieldPresence.ValueType
24242522
enum_type: global___FeatureSet.EnumType.ValueType
24252523
repeated_field_encoding: global___FeatureSet.RepeatedFieldEncoding.ValueType
24262524
utf8_validation: global___FeatureSet.Utf8Validation.ValueType
24272525
message_encoding: global___FeatureSet.MessageEncoding.ValueType
24282526
json_format: global___FeatureSet.JsonFormat.ValueType
24292527
enforce_naming_style: global___FeatureSet.EnforceNamingStyle.ValueType
2528+
default_symbol_visibility: global___FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType
24302529
def __init__(
24312530
self,
24322531
*,
@@ -2437,10 +2536,13 @@ class FeatureSet(google.protobuf.message.Message):
24372536
message_encoding: global___FeatureSet.MessageEncoding.ValueType | None = ...,
24382537
json_format: global___FeatureSet.JsonFormat.ValueType | None = ...,
24392538
enforce_naming_style: global___FeatureSet.EnforceNamingStyle.ValueType | None = ...,
2539+
default_symbol_visibility: global___FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType | None = ...,
24402540
) -> None: ...
24412541
def HasField(
24422542
self,
24432543
field_name: typing.Literal[
2544+
"default_symbol_visibility",
2545+
b"default_symbol_visibility",
24442546
"enforce_naming_style",
24452547
b"enforce_naming_style",
24462548
"enum_type",
@@ -2460,6 +2562,8 @@ class FeatureSet(google.protobuf.message.Message):
24602562
def ClearField(
24612563
self,
24622564
field_name: typing.Literal[
2565+
"default_symbol_visibility",
2566+
b"default_symbol_visibility",
24632567
"enforce_naming_style",
24642568
b"enforce_naming_style",
24652569
"enum_type",
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
def Type() -> str: ...
2-
def Version() -> int: ...
32
def IsPythonDefaultSerializationDeterministic() -> bool: ...

0 commit comments

Comments
 (0)