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.

Files changed (45) hide show
  1. google/protobuf/__init__.py +1 -1
  2. google/protobuf/any.py +15 -1
  3. google/protobuf/any_pb2.py +5 -5
  4. google/protobuf/api_pb2.py +15 -11
  5. google/protobuf/compiler/plugin_pb2.py +5 -5
  6. google/protobuf/descriptor.py +413 -248
  7. google/protobuf/descriptor_database.py +22 -4
  8. google/protobuf/descriptor_pb2.py +320 -120
  9. google/protobuf/descriptor_pool.py +31 -13
  10. google/protobuf/duration_pb2.py +5 -5
  11. google/protobuf/empty_pb2.py +5 -5
  12. google/protobuf/field_mask_pb2.py +5 -5
  13. google/protobuf/internal/api_implementation.py +0 -6
  14. google/protobuf/internal/builder.py +4 -3
  15. google/protobuf/internal/containers.py +13 -0
  16. google/protobuf/internal/decoder.py +163 -133
  17. google/protobuf/internal/extension_dict.py +3 -3
  18. google/protobuf/internal/field_mask.py +6 -4
  19. google/protobuf/internal/python_edition_defaults.py +1 -1
  20. google/protobuf/internal/python_message.py +86 -70
  21. google/protobuf/internal/testing_refleaks.py +11 -2
  22. google/protobuf/internal/type_checkers.py +52 -5
  23. google/protobuf/internal/well_known_types.py +63 -46
  24. google/protobuf/json_format.py +113 -71
  25. google/protobuf/message.py +26 -0
  26. google/protobuf/message_factory.py +16 -63
  27. google/protobuf/proto.py +38 -1
  28. google/protobuf/proto_text.py +129 -0
  29. google/protobuf/reflection.py +0 -49
  30. google/protobuf/runtime_version.py +9 -29
  31. google/protobuf/source_context_pb2.py +5 -5
  32. google/protobuf/struct_pb2.py +5 -5
  33. google/protobuf/symbol_database.py +0 -18
  34. google/protobuf/text_format.py +49 -29
  35. google/protobuf/timestamp_pb2.py +5 -5
  36. google/protobuf/type_pb2.py +5 -5
  37. google/protobuf/unknown_fields.py +3 -4
  38. google/protobuf/wrappers_pb2.py +5 -5
  39. {protobuf-5.29.0rc3.dist-info → protobuf-6.33.3.dist-info}/METADATA +3 -3
  40. protobuf-6.33.3.dist-info/RECORD +58 -0
  41. google/protobuf/internal/_parameterized.py +0 -420
  42. google/protobuf/service.py +0 -213
  43. protobuf-5.29.0rc3.dist-info/RECORD +0 -59
  44. {protobuf-5.29.0rc3.dist-info → protobuf-6.33.3.dist-info}/LICENSE +0 -0
  45. {protobuf-5.29.0rc3.dist-info → protobuf-6.33.3.dist-info}/WHEEL +0 -0
@@ -7,4 +7,4 @@
7
7
 
8
8
  # Copyright 2007 Google Inc. All Rights Reserved.
9
9
 
10
- __version__ = '5.29.0rc3'
10
+ __version__ = '6.33.3'
google/protobuf/any.py CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  """Contains the Any helper APIs."""
9
9
 
10
- from typing import Optional
10
+ from typing import Optional, TypeVar
11
11
 
12
12
  from google.protobuf import descriptor
13
13
  from google.protobuf.message import Message
@@ -15,6 +15,9 @@ from google.protobuf.message import Message
15
15
  from google.protobuf.any_pb2 import Any
16
16
 
17
17
 
18
+ _MessageT = TypeVar('_MessageT', bound=Message)
19
+
20
+
18
21
  def pack(
19
22
  msg: Message,
20
23
  type_url_prefix: Optional[str] = 'type.googleapis.com/',
@@ -31,6 +34,17 @@ def unpack(any_msg: Any, msg: Message) -> bool:
31
34
  return any_msg.Unpack(msg=msg)
32
35
 
33
36
 
37
+ def unpack_as(any_msg: Any, message_type: type[_MessageT]) -> _MessageT:
38
+ unpacked = message_type()
39
+ if unpack(any_msg, unpacked):
40
+ return unpacked
41
+ else:
42
+ raise TypeError(
43
+ f'Attempted to unpack {type_name(any_msg)} to'
44
+ f' {message_type.__qualname__}'
45
+ )
46
+
47
+
34
48
  def type_name(any_msg: Any) -> str:
35
49
  return any_msg.TypeName()
36
50
 
@@ -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/any.proto
5
- # Protobuf Python Version: 5.29.0-rc3
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
- 5,
15
- 29,
16
- 0,
17
- '-rc3',
14
+ 6,
15
+ 33,
16
+ 3,
17
+ '',
18
18
  'google/protobuf/any.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/api.proto
5
- # Protobuf Python Version: 5.29.0-rc3
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
- 5,
15
- 29,
16
- 0,
17
- '-rc3',
14
+ 6,
15
+ 33,
16
+ 3,
17
+ '',
18
18
  'google/protobuf/api.proto'
19
19
  )
20
20
  # @@protoc_insertion_point(imports)
@@ -26,7 +26,7 @@ from google.protobuf import source_context_pb2 as google_dot_protobuf_dot_source
26
26
  from google.protobuf import type_pb2 as google_dot_protobuf_dot_type__pb2
27
27
 
28
28
 
29
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19google/protobuf/api.proto\x12\x0fgoogle.protobuf\x1a$google/protobuf/source_context.proto\x1a\x1agoogle/protobuf/type.proto\"\xc1\x02\n\x03\x41pi\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x31\n\x07methods\x18\x02 \x03(\x0b\x32\x17.google.protobuf.MethodR\x07methods\x12\x31\n\x07options\x18\x03 \x03(\x0b\x32\x17.google.protobuf.OptionR\x07options\x12\x18\n\x07version\x18\x04 \x01(\tR\x07version\x12\x45\n\x0esource_context\x18\x05 \x01(\x0b\x32\x1e.google.protobuf.SourceContextR\rsourceContext\x12.\n\x06mixins\x18\x06 \x03(\x0b\x32\x16.google.protobuf.MixinR\x06mixins\x12/\n\x06syntax\x18\x07 \x01(\x0e\x32\x17.google.protobuf.SyntaxR\x06syntax\"\xb2\x02\n\x06Method\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12(\n\x10request_type_url\x18\x02 \x01(\tR\x0erequestTypeUrl\x12+\n\x11request_streaming\x18\x03 \x01(\x08R\x10requestStreaming\x12*\n\x11response_type_url\x18\x04 \x01(\tR\x0fresponseTypeUrl\x12-\n\x12response_streaming\x18\x05 \x01(\x08R\x11responseStreaming\x12\x31\n\x07options\x18\x06 \x03(\x0b\x32\x17.google.protobuf.OptionR\x07options\x12/\n\x06syntax\x18\x07 \x01(\x0e\x32\x17.google.protobuf.SyntaxR\x06syntax\"/\n\x05Mixin\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n\x04root\x18\x02 \x01(\tR\x04rootBv\n\x13\x63om.google.protobufB\x08\x41piProtoP\x01Z,google.golang.org/protobuf/types/known/apipb\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3')
29
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19google/protobuf/api.proto\x12\x0fgoogle.protobuf\x1a$google/protobuf/source_context.proto\x1a\x1agoogle/protobuf/type.proto\"\xdb\x02\n\x03\x41pi\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x31\n\x07methods\x18\x02 \x03(\x0b\x32\x17.google.protobuf.MethodR\x07methods\x12\x31\n\x07options\x18\x03 \x03(\x0b\x32\x17.google.protobuf.OptionR\x07options\x12\x18\n\x07version\x18\x04 \x01(\tR\x07version\x12\x45\n\x0esource_context\x18\x05 \x01(\x0b\x32\x1e.google.protobuf.SourceContextR\rsourceContext\x12.\n\x06mixins\x18\x06 \x03(\x0b\x32\x16.google.protobuf.MixinR\x06mixins\x12/\n\x06syntax\x18\x07 \x01(\x0e\x32\x17.google.protobuf.SyntaxR\x06syntax\x12\x18\n\x07\x65\x64ition\x18\x08 \x01(\tR\x07\x65\x64ition\"\xd4\x02\n\x06Method\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12(\n\x10request_type_url\x18\x02 \x01(\tR\x0erequestTypeUrl\x12+\n\x11request_streaming\x18\x03 \x01(\x08R\x10requestStreaming\x12*\n\x11response_type_url\x18\x04 \x01(\tR\x0fresponseTypeUrl\x12-\n\x12response_streaming\x18\x05 \x01(\x08R\x11responseStreaming\x12\x31\n\x07options\x18\x06 \x03(\x0b\x32\x17.google.protobuf.OptionR\x07options\x12\x33\n\x06syntax\x18\x07 \x01(\x0e\x32\x17.google.protobuf.SyntaxB\x02\x18\x01R\x06syntax\x12\x1c\n\x07\x65\x64ition\x18\x08 \x01(\tB\x02\x18\x01R\x07\x65\x64ition\"/\n\x05Mixin\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n\x04root\x18\x02 \x01(\tR\x04rootBv\n\x13\x63om.google.protobufB\x08\x41piProtoP\x01Z,google.golang.org/protobuf/types/known/apipb\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3')
30
30
 
31
31
  _globals = globals()
32
32
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -34,10 +34,14 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.protobuf.api_pb2', _
34
34
  if not _descriptor._USE_C_DESCRIPTORS:
35
35
  _globals['DESCRIPTOR']._loaded_options = None
36
36
  _globals['DESCRIPTOR']._serialized_options = b'\n\023com.google.protobufB\010ApiProtoP\001Z,google.golang.org/protobuf/types/known/apipb\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTypes'
37
+ _globals['_METHOD'].fields_by_name['syntax']._loaded_options = None
38
+ _globals['_METHOD'].fields_by_name['syntax']._serialized_options = b'\030\001'
39
+ _globals['_METHOD'].fields_by_name['edition']._loaded_options = None
40
+ _globals['_METHOD'].fields_by_name['edition']._serialized_options = b'\030\001'
37
41
  _globals['_API']._serialized_start=113
38
- _globals['_API']._serialized_end=434
39
- _globals['_METHOD']._serialized_start=437
40
- _globals['_METHOD']._serialized_end=743
41
- _globals['_MIXIN']._serialized_start=745
42
- _globals['_MIXIN']._serialized_end=792
42
+ _globals['_API']._serialized_end=460
43
+ _globals['_METHOD']._serialized_start=463
44
+ _globals['_METHOD']._serialized_end=803
45
+ _globals['_MIXIN']._serialized_start=805
46
+ _globals['_MIXIN']._serialized_end=852
43
47
  # @@protoc_insertion_point(module_scope)
@@ -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/compiler/plugin.proto
5
- # Protobuf Python Version: 5.29.0-rc3
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
- 5,
15
- 29,
16
- 0,
17
- '-rc3',
14
+ 6,
15
+ 33,
16
+ 3,
17
+ '',
18
18
  'google/protobuf/compiler/plugin.proto'
19
19
  )
20
20
  # @@protoc_insertion_point(imports)