protobuf 5.29.0rc3__py3-none-any.whl → 6.33.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of protobuf might be problematic. Click here for more details.
- google/protobuf/__init__.py +1 -1
- google/protobuf/any.py +15 -1
- google/protobuf/any_pb2.py +5 -5
- google/protobuf/api_pb2.py +15 -11
- google/protobuf/compiler/plugin_pb2.py +5 -5
- google/protobuf/descriptor.py +413 -248
- google/protobuf/descriptor_database.py +22 -4
- google/protobuf/descriptor_pb2.py +320 -120
- google/protobuf/descriptor_pool.py +31 -13
- google/protobuf/duration_pb2.py +5 -5
- google/protobuf/empty_pb2.py +5 -5
- google/protobuf/field_mask_pb2.py +5 -5
- google/protobuf/internal/api_implementation.py +0 -6
- google/protobuf/internal/builder.py +4 -3
- google/protobuf/internal/containers.py +13 -0
- google/protobuf/internal/decoder.py +163 -133
- google/protobuf/internal/extension_dict.py +3 -3
- google/protobuf/internal/field_mask.py +6 -4
- google/protobuf/internal/python_edition_defaults.py +1 -1
- google/protobuf/internal/python_message.py +86 -70
- google/protobuf/internal/testing_refleaks.py +11 -2
- google/protobuf/internal/type_checkers.py +52 -5
- google/protobuf/internal/well_known_types.py +63 -46
- google/protobuf/json_format.py +113 -71
- google/protobuf/message.py +26 -0
- google/protobuf/message_factory.py +16 -63
- google/protobuf/proto.py +38 -1
- google/protobuf/proto_text.py +129 -0
- google/protobuf/reflection.py +0 -49
- google/protobuf/runtime_version.py +9 -29
- google/protobuf/source_context_pb2.py +5 -5
- google/protobuf/struct_pb2.py +5 -5
- google/protobuf/symbol_database.py +0 -18
- google/protobuf/text_format.py +49 -29
- google/protobuf/timestamp_pb2.py +5 -5
- google/protobuf/type_pb2.py +5 -5
- google/protobuf/unknown_fields.py +3 -4
- google/protobuf/wrappers_pb2.py +5 -5
- {protobuf-5.29.0rc3.dist-info → protobuf-6.33.3.dist-info}/METADATA +3 -3
- protobuf-6.33.3.dist-info/RECORD +58 -0
- google/protobuf/internal/_parameterized.py +0 -420
- google/protobuf/service.py +0 -213
- protobuf-5.29.0rc3.dist-info/RECORD +0 -59
- {protobuf-5.29.0rc3.dist-info → protobuf-6.33.3.dist-info}/LICENSE +0 -0
- {protobuf-5.29.0rc3.dist-info → protobuf-6.33.3.dist-info}/WHEEL +0 -0
|
@@ -75,7 +75,8 @@ def _IsMessageSetExtension(field):
|
|
|
75
75
|
field.containing_type.has_options and
|
|
76
76
|
field.containing_type.GetOptions().message_set_wire_format and
|
|
77
77
|
field.type == descriptor.FieldDescriptor.TYPE_MESSAGE and
|
|
78
|
-
field.
|
|
78
|
+
not field.is_required and
|
|
79
|
+
not field.is_repeated)
|
|
79
80
|
|
|
80
81
|
_edition_defaults_lock = threading.Lock()
|
|
81
82
|
|
|
@@ -85,9 +86,9 @@ class DescriptorPool(object):
|
|
|
85
86
|
|
|
86
87
|
if _USE_C_DESCRIPTORS:
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
def __new__(cls, descriptor_db=None):
|
|
90
|
+
# pylint: disable=protected-access
|
|
91
|
+
return descriptor._message.DescriptorPool(descriptor_db)
|
|
91
92
|
|
|
92
93
|
def __init__(
|
|
93
94
|
self, descriptor_db=None, use_deprecated_legacy_json_field_conflicts=False
|
|
@@ -580,11 +581,21 @@ class DescriptorPool(object):
|
|
|
580
581
|
if self._descriptor_db and hasattr(
|
|
581
582
|
self._descriptor_db, 'FindAllExtensionNumbers'):
|
|
582
583
|
full_name = message_descriptor.full_name
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
584
|
+
try:
|
|
585
|
+
all_numbers = self._descriptor_db.FindAllExtensionNumbers(full_name)
|
|
586
|
+
except:
|
|
587
|
+
pass
|
|
588
|
+
else:
|
|
589
|
+
if isinstance(all_numbers, list):
|
|
590
|
+
for number in all_numbers:
|
|
591
|
+
if number in self._extensions_by_number[message_descriptor]:
|
|
592
|
+
continue
|
|
593
|
+
self._TryLoadExtensionFromDB(message_descriptor, number)
|
|
594
|
+
else:
|
|
595
|
+
warnings.warn(
|
|
596
|
+
'FindAllExtensionNumbers() on fall back DB must return a list,'
|
|
597
|
+
' not {0}'.format(type(all_numbers))
|
|
598
|
+
)
|
|
588
599
|
|
|
589
600
|
return list(self._extensions_by_number[message_descriptor].values())
|
|
590
601
|
|
|
@@ -603,8 +614,13 @@ class DescriptorPool(object):
|
|
|
603
614
|
return
|
|
604
615
|
|
|
605
616
|
full_name = message_descriptor.full_name
|
|
606
|
-
file_proto =
|
|
607
|
-
|
|
617
|
+
file_proto = None
|
|
618
|
+
try:
|
|
619
|
+
file_proto = self._descriptor_db.FindFileContainingExtension(
|
|
620
|
+
full_name, number
|
|
621
|
+
)
|
|
622
|
+
except:
|
|
623
|
+
return
|
|
608
624
|
|
|
609
625
|
if file_proto is None:
|
|
610
626
|
return
|
|
@@ -668,7 +684,6 @@ class DescriptorPool(object):
|
|
|
668
684
|
if not isinstance(defaults, descriptor_pb2.FeatureSetDefaults):
|
|
669
685
|
raise TypeError('SetFeatureSetDefaults called with invalid type')
|
|
670
686
|
|
|
671
|
-
|
|
672
687
|
if defaults.minimum_edition > defaults.maximum_edition:
|
|
673
688
|
raise ValueError(
|
|
674
689
|
'Invalid edition range %s to %s'
|
|
@@ -723,7 +738,10 @@ class DescriptorPool(object):
|
|
|
723
738
|
),
|
|
724
739
|
)
|
|
725
740
|
)
|
|
726
|
-
if
|
|
741
|
+
if (
|
|
742
|
+
edition > self._edition_defaults.maximum_edition
|
|
743
|
+
and edition != descriptor_pb2.EDITION_UNSTABLE
|
|
744
|
+
):
|
|
727
745
|
raise TypeError(
|
|
728
746
|
'Edition %s is later than the maximum supported edition %s!'
|
|
729
747
|
% (
|
google/protobuf/duration_pb2.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: google/protobuf/duration.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 6.33.3
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,10 +11,10 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'
|
|
14
|
+
6,
|
|
15
|
+
33,
|
|
16
|
+
3,
|
|
17
|
+
'',
|
|
18
18
|
'google/protobuf/duration.proto'
|
|
19
19
|
)
|
|
20
20
|
# @@protoc_insertion_point(imports)
|
google/protobuf/empty_pb2.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: google/protobuf/empty.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 6.33.3
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,10 +11,10 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'
|
|
14
|
+
6,
|
|
15
|
+
33,
|
|
16
|
+
3,
|
|
17
|
+
'',
|
|
18
18
|
'google/protobuf/empty.proto'
|
|
19
19
|
)
|
|
20
20
|
# @@protoc_insertion_point(imports)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: google/protobuf/field_mask.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 6.33.3
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,10 +11,10 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'
|
|
14
|
+
6,
|
|
15
|
+
33,
|
|
16
|
+
3,
|
|
17
|
+
'',
|
|
18
18
|
'google/protobuf/field_mask.proto'
|
|
19
19
|
)
|
|
20
20
|
# @@protoc_insertion_point(imports)
|
|
@@ -131,12 +131,6 @@ def Type():
|
|
|
131
131
|
return _implementation_type
|
|
132
132
|
|
|
133
133
|
|
|
134
|
-
# See comment on 'Type' above.
|
|
135
|
-
# TODO: Remove the API, it returns a constant. b/228102101
|
|
136
|
-
def Version():
|
|
137
|
-
return 2
|
|
138
|
-
|
|
139
|
-
|
|
140
134
|
# For internal use only
|
|
141
135
|
def IsPythonDefaultSerializationDeterministic():
|
|
142
136
|
return _python_deterministic_proto_serialization
|
|
@@ -54,12 +54,13 @@ def BuildTopDescriptorsAndMessages(file_des, module_name, module):
|
|
|
54
54
|
module: Generated _pb2 module
|
|
55
55
|
"""
|
|
56
56
|
|
|
57
|
-
def BuildMessage(msg_des):
|
|
57
|
+
def BuildMessage(msg_des, prefix):
|
|
58
58
|
create_dict = {}
|
|
59
59
|
for (name, nested_msg) in msg_des.nested_types_by_name.items():
|
|
60
|
-
create_dict[name] = BuildMessage(nested_msg)
|
|
60
|
+
create_dict[name] = BuildMessage(nested_msg, prefix + msg_des.name + '.')
|
|
61
61
|
create_dict['DESCRIPTOR'] = msg_des
|
|
62
62
|
create_dict['__module__'] = module_name
|
|
63
|
+
create_dict['__qualname__'] = prefix + msg_des.name
|
|
63
64
|
message_class = _reflection.GeneratedProtocolMessageType(
|
|
64
65
|
msg_des.name, (_message.Message,), create_dict)
|
|
65
66
|
_sym_db.RegisterMessage(message_class)
|
|
@@ -83,7 +84,7 @@ def BuildTopDescriptorsAndMessages(file_des, module_name, module):
|
|
|
83
84
|
|
|
84
85
|
# Build messages.
|
|
85
86
|
for (name, msg_des) in file_des.message_types_by_name.items():
|
|
86
|
-
module[name] = BuildMessage(msg_des)
|
|
87
|
+
module[name] = BuildMessage(msg_des, '')
|
|
87
88
|
|
|
88
89
|
|
|
89
90
|
def AddHelpersToExtensions(file_des):
|
|
@@ -412,6 +412,13 @@ class ScalarMap(MutableMapping[_K, _V]):
|
|
|
412
412
|
def __repr__(self) -> str:
|
|
413
413
|
return repr(self._values)
|
|
414
414
|
|
|
415
|
+
def setdefault(self, key: _K, value: Optional[_V] = None) -> _V:
|
|
416
|
+
if value == None:
|
|
417
|
+
raise ValueError('The value for scalar map setdefault must be set.')
|
|
418
|
+
if key not in self._values:
|
|
419
|
+
self.__setitem__(key, value)
|
|
420
|
+
return self[key]
|
|
421
|
+
|
|
415
422
|
def MergeFrom(self, other: 'ScalarMap[_K, _V]') -> None:
|
|
416
423
|
self._values.update(other._values)
|
|
417
424
|
self._message_listener.Modified()
|
|
@@ -526,6 +533,12 @@ class MessageMap(MutableMapping[_K, _V]):
|
|
|
526
533
|
def __repr__(self) -> str:
|
|
527
534
|
return repr(self._values)
|
|
528
535
|
|
|
536
|
+
def setdefault(self, key: _K, value: Optional[_V] = None) -> _V:
|
|
537
|
+
raise NotImplementedError(
|
|
538
|
+
'Set message map value directly is not supported, call'
|
|
539
|
+
' my_map[key].foo = 5'
|
|
540
|
+
)
|
|
541
|
+
|
|
529
542
|
def MergeFrom(self, other: 'MessageMap[_K, _V]') -> None:
|
|
530
543
|
# pylint: disable=protected-access
|
|
531
544
|
for key in other._values:
|