Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1dbf21f

Browse files
authored
Bump protobuf to 5.27.* (#12197)
1 parent eff4ca1 commit 1dbf21f

3 files changed

Lines changed: 87 additions & 18 deletions

File tree

scripts/generate_proto_stubs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set -ex -o pipefail
1212
#
1313
# Whenever you update PROTOBUF_VERSION here, version should be updated
1414
# in stubs/protobuf/METADATA.toml and vice-versa.
15-
PROTOBUF_VERSION=26.1
15+
PROTOBUF_VERSION=27.1
1616
MYPY_PROTOBUF_VERSION=3.6.0
1717

1818
# brew install coreutils wget

stubs/protobuf/METADATA.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Whenever you update version here, PROTOBUF_VERSION should be updated
22
# in scripts/generate_proto_stubs.sh and vice-versa.
3-
version = "5.26.*"
3+
version = "5.27.*"
44
upstream_repository = "https://github.com/protocolbuffers/protobuf"
5-
extra_description = "Generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 25.1 on [protobuf v26.1](https://github.com/protocolbuffers/protobuf/releases/tag/v26.1) (python protobuf==5.26.1)"
5+
extra_description = "Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 26.1 on [protobuf v27.1](https://github.com/protocolbuffers/protobuf/releases/tag/v27.1) (python protobuf==5.27.1)."
66
partial_stub = true
77

88
[tool.stubtest]

stubs/protobuf/google/protobuf/descriptor_pb2.pyi

Lines changed: 84 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ class _EditionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTy
3535
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
3636
EDITION_UNKNOWN: _Edition.ValueType # 0
3737
"""A placeholder for an unknown edition value."""
38+
EDITION_LEGACY: _Edition.ValueType # 900
39+
"""A placeholder edition for specifying default behaviors *before* a feature
40+
was first introduced. This is effectively an "infinite past".
41+
"""
3842
EDITION_PROTO2: _Edition.ValueType # 998
3943
"""Legacy syntax "editions". These pre-date editions, but behave much like
4044
distinct editions. These can't be used to specify the edition of proto
@@ -67,6 +71,10 @@ class Edition(_Edition, metaclass=_EditionEnumTypeWrapper):
6771

6872
EDITION_UNKNOWN: Edition.ValueType # 0
6973
"""A placeholder for an unknown edition value."""
74+
EDITION_LEGACY: Edition.ValueType # 900
75+
"""A placeholder edition for specifying default behaviors *before* a feature
76+
was first introduced. This is effectively an "infinite past".
77+
"""
7078
EDITION_PROTO2: Edition.ValueType # 998
7179
"""Legacy syntax "editions". These pre-date editions, but behave much like
7280
distinct editions. These can't be used to specify the edition of proto
@@ -898,12 +906,16 @@ class FileOptions(google.protobuf.message.Message):
898906
java_generate_equals_and_hash: builtins.bool
899907
"""This option does nothing."""
900908
java_string_check_utf8: builtins.bool
901-
"""If set true, then the Java2 code generator will generate code that
902-
throws an exception whenever an attempt is made to assign a non-UTF-8
903-
byte sequence to a string field.
904-
Message reflection will do the same.
905-
However, an extension field still accepts non-UTF-8 byte sequences.
906-
This option has no effect on when used with the lite runtime.
909+
"""A proto2 file can set this to true to opt in to UTF-8 checking for Java,
910+
which will throw an exception if invalid UTF-8 is parsed from the wire or
911+
assigned to a string field.
912+
913+
TODO: clarify exactly what kinds of field types this option
914+
applies to, and update these docs accordingly.
915+
916+
Proto3 files already perform these checks. Setting the option explicitly to
917+
false has no effect: it cannot be used to opt proto3 files out of UTF-8
918+
checks.
907919
"""
908920
optimize_for: global___FileOptions.OptimizeMode.ValueType
909921
go_package: builtins.str
@@ -1238,6 +1250,45 @@ class FieldOptions(google.protobuf.message.Message):
12381250
def HasField(self, field_name: typing.Literal["edition", b"edition", "value", b"value"]) -> builtins.bool: ...
12391251
def ClearField(self, field_name: typing.Literal["edition", b"edition", "value", b"value"]) -> None: ...
12401252

1253+
@typing.final
1254+
class FeatureSupport(google.protobuf.message.Message):
1255+
"""Information about the support window of a feature."""
1256+
1257+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
1258+
1259+
EDITION_INTRODUCED_FIELD_NUMBER: builtins.int
1260+
EDITION_DEPRECATED_FIELD_NUMBER: builtins.int
1261+
DEPRECATION_WARNING_FIELD_NUMBER: builtins.int
1262+
EDITION_REMOVED_FIELD_NUMBER: builtins.int
1263+
edition_introduced: global___Edition.ValueType
1264+
"""The edition that this feature was first available in. In editions
1265+
earlier than this one, the default assigned to EDITION_LEGACY will be
1266+
used, and proto files will not be able to override it.
1267+
"""
1268+
edition_deprecated: global___Edition.ValueType
1269+
"""The edition this feature becomes deprecated in. Using this after this
1270+
edition may trigger warnings.
1271+
"""
1272+
deprecation_warning: builtins.str
1273+
"""The deprecation warning text if this feature is used after the edition it
1274+
was marked deprecated in.
1275+
"""
1276+
edition_removed: global___Edition.ValueType
1277+
"""The edition this feature is no longer available in. In editions after
1278+
this one, the last default assigned will be used, and proto files will
1279+
not be able to override it.
1280+
"""
1281+
def __init__(
1282+
self,
1283+
*,
1284+
edition_introduced: global___Edition.ValueType | None = ...,
1285+
edition_deprecated: global___Edition.ValueType | None = ...,
1286+
deprecation_warning: builtins.str | None = ...,
1287+
edition_removed: global___Edition.ValueType | None = ...,
1288+
) -> None: ...
1289+
def HasField(self, field_name: typing.Literal["deprecation_warning", b"deprecation_warning", "edition_deprecated", b"edition_deprecated", "edition_introduced", b"edition_introduced", "edition_removed", b"edition_removed"]) -> builtins.bool: ...
1290+
def ClearField(self, field_name: typing.Literal["deprecation_warning", b"deprecation_warning", "edition_deprecated", b"edition_deprecated", "edition_introduced", b"edition_introduced", "edition_removed", b"edition_removed"]) -> None: ...
1291+
12411292
CTYPE_FIELD_NUMBER: builtins.int
12421293
PACKED_FIELD_NUMBER: builtins.int
12431294
JSTYPE_FIELD_NUMBER: builtins.int
@@ -1250,6 +1301,7 @@ class FieldOptions(google.protobuf.message.Message):
12501301
TARGETS_FIELD_NUMBER: builtins.int
12511302
EDITION_DEFAULTS_FIELD_NUMBER: builtins.int
12521303
FEATURES_FIELD_NUMBER: builtins.int
1304+
FEATURE_SUPPORT_FIELD_NUMBER: builtins.int
12531305
UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int
12541306
ctype: global___FieldOptions.CType.ValueType
12551307
"""The ctype option instructs the C++ code generator to use a different
@@ -1331,6 +1383,8 @@ class FieldOptions(google.protobuf.message.Message):
13311383
def features(self) -> global___FeatureSet:
13321384
"""Any features defined in the specific edition."""
13331385

1386+
@property
1387+
def feature_support(self) -> global___FieldOptions.FeatureSupport: ...
13341388
@property
13351389
def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]:
13361390
"""The parser stores options it doesn't recognize here. See above."""
@@ -1350,10 +1404,11 @@ class FieldOptions(google.protobuf.message.Message):
13501404
targets: collections.abc.Iterable[global___FieldOptions.OptionTargetType.ValueType] | None = ...,
13511405
edition_defaults: collections.abc.Iterable[global___FieldOptions.EditionDefault] | None = ...,
13521406
features: global___FeatureSet | None = ...,
1407+
feature_support: global___FieldOptions.FeatureSupport | None = ...,
13531408
uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ...,
13541409
) -> None: ...
1355-
def HasField(self, field_name: typing.Literal["ctype", b"ctype", "debug_redact", b"debug_redact", "deprecated", b"deprecated", "features", b"features", "jstype", b"jstype", "lazy", b"lazy", "packed", b"packed", "retention", b"retention", "unverified_lazy", b"unverified_lazy", "weak", b"weak"]) -> builtins.bool: ...
1356-
def ClearField(self, field_name: typing.Literal["ctype", b"ctype", "debug_redact", b"debug_redact", "deprecated", b"deprecated", "edition_defaults", b"edition_defaults", "features", b"features", "jstype", b"jstype", "lazy", b"lazy", "packed", b"packed", "retention", b"retention", "targets", b"targets", "uninterpreted_option", b"uninterpreted_option", "unverified_lazy", b"unverified_lazy", "weak", b"weak"]) -> None: ...
1410+
def HasField(self, field_name: typing.Literal["ctype", b"ctype", "debug_redact", b"debug_redact", "deprecated", b"deprecated", "feature_support", b"feature_support", "features", b"features", "jstype", b"jstype", "lazy", b"lazy", "packed", b"packed", "retention", b"retention", "unverified_lazy", b"unverified_lazy", "weak", b"weak"]) -> builtins.bool: ...
1411+
def ClearField(self, field_name: typing.Literal["ctype", b"ctype", "debug_redact", b"debug_redact", "deprecated", b"deprecated", "edition_defaults", b"edition_defaults", "feature_support", b"feature_support", "features", b"features", "jstype", b"jstype", "lazy", b"lazy", "packed", b"packed", "retention", b"retention", "targets", b"targets", "uninterpreted_option", b"uninterpreted_option", "unverified_lazy", b"unverified_lazy", "weak", b"weak"]) -> None: ...
13571412

13581413
global___FieldOptions = FieldOptions
13591414

@@ -1438,6 +1493,7 @@ class EnumValueOptions(google.protobuf.message.Message):
14381493
DEPRECATED_FIELD_NUMBER: builtins.int
14391494
FEATURES_FIELD_NUMBER: builtins.int
14401495
DEBUG_REDACT_FIELD_NUMBER: builtins.int
1496+
FEATURE_SUPPORT_FIELD_NUMBER: builtins.int
14411497
UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int
14421498
deprecated: builtins.bool
14431499
"""Is this enum value deprecated?
@@ -1454,6 +1510,10 @@ class EnumValueOptions(google.protobuf.message.Message):
14541510
def features(self) -> global___FeatureSet:
14551511
"""Any features defined in the specific edition."""
14561512

1513+
@property
1514+
def feature_support(self) -> global___FieldOptions.FeatureSupport:
1515+
"""Information about the support window of a feature value."""
1516+
14571517
@property
14581518
def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]:
14591519
"""The parser stores options it doesn't recognize here. See above."""
@@ -1464,10 +1524,11 @@ class EnumValueOptions(google.protobuf.message.Message):
14641524
deprecated: builtins.bool | None = ...,
14651525
features: global___FeatureSet | None = ...,
14661526
debug_redact: builtins.bool | None = ...,
1527+
feature_support: global___FieldOptions.FeatureSupport | None = ...,
14671528
uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ...,
14681529
) -> None: ...
1469-
def HasField(self, field_name: typing.Literal["debug_redact", b"debug_redact", "deprecated", b"deprecated", "features", b"features"]) -> builtins.bool: ...
1470-
def ClearField(self, field_name: typing.Literal["debug_redact", b"debug_redact", "deprecated", b"deprecated", "features", b"features", "uninterpreted_option", b"uninterpreted_option"]) -> None: ...
1530+
def HasField(self, field_name: typing.Literal["debug_redact", b"debug_redact", "deprecated", b"deprecated", "feature_support", b"feature_support", "features", b"features"]) -> builtins.bool: ...
1531+
def ClearField(self, field_name: typing.Literal["debug_redact", b"debug_redact", "deprecated", b"deprecated", "feature_support", b"feature_support", "features", b"features", "uninterpreted_option", b"uninterpreted_option"]) -> None: ...
14711532

14721533
global___EnumValueOptions = EnumValueOptions
14731534

@@ -1799,18 +1860,26 @@ class FeatureSetDefaults(google.protobuf.message.Message):
17991860
DESCRIPTOR: google.protobuf.descriptor.Descriptor
18001861

18011862
EDITION_FIELD_NUMBER: builtins.int
1802-
FEATURES_FIELD_NUMBER: builtins.int
1863+
OVERRIDABLE_FEATURES_FIELD_NUMBER: builtins.int
1864+
FIXED_FEATURES_FIELD_NUMBER: builtins.int
18031865
edition: global___Edition.ValueType
18041866
@property
1805-
def features(self) -> global___FeatureSet: ...
1867+
def overridable_features(self) -> global___FeatureSet:
1868+
"""Defaults of features that can be overridden in this edition."""
1869+
1870+
@property
1871+
def fixed_features(self) -> global___FeatureSet:
1872+
"""Defaults of features that can't be overridden in this edition."""
1873+
18061874
def __init__(
18071875
self,
18081876
*,
18091877
edition: global___Edition.ValueType | None = ...,
1810-
features: global___FeatureSet | None = ...,
1878+
overridable_features: global___FeatureSet | None = ...,
1879+
fixed_features: global___FeatureSet | None = ...,
18111880
) -> None: ...
1812-
def HasField(self, field_name: typing.Literal["edition", b"edition", "features", b"features"]) -> builtins.bool: ...
1813-
def ClearField(self, field_name: typing.Literal["edition", b"edition", "features", b"features"]) -> None: ...
1881+
def HasField(self, field_name: typing.Literal["edition", b"edition", "fixed_features", b"fixed_features", "overridable_features", b"overridable_features"]) -> builtins.bool: ...
1882+
def ClearField(self, field_name: typing.Literal["edition", b"edition", "fixed_features", b"fixed_features", "overridable_features", b"overridable_features"]) -> None: ...
18141883

18151884
DEFAULTS_FIELD_NUMBER: builtins.int
18161885
MINIMUM_EDITION_FIELD_NUMBER: builtins.int

0 commit comments

Comments
 (0)