Browse Source

Update contrib/python/types-protobuf to 5.26.0.20240422
ef33a7540423312f353a77f18ebe05d429b92195

robot-contrib 10 months ago
parent
commit
d502666ab3

+ 6 - 6
contrib/python/types-protobuf/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: types-protobuf
-Version: 4.24.0.20240311
+Version: 5.26.0.20240422
 Summary: Typing stubs for protobuf
 Home-page: https://github.com/python/typeshed
 License: Apache-2.0 license
@@ -26,18 +26,18 @@ PyCharm, etc. to check code that uses
 `protobuf`.
 
 This version of `types-protobuf` aims to provide accurate annotations
-for `protobuf==4.24.*`.
+for `protobuf==5.26.*`.
 The source for this package can be found at
 https://github.com/python/typeshed/tree/main/stubs/protobuf. All fixes for
 types and metadata should be contributed there.
 
-Generated using [mypy-protobuf==3.5.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.5.0) on protobuf==4.21.8
+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)
 
 This stub package is marked as [partial](https://peps.python.org/pep-0561/#partial-stub-packages).
 If you find that annotations are missing, feel free to contribute and help complete them.
 
 
 See https://github.com/python/typeshed/blob/main/README.md for more details.
-This package was generated from typeshed commit `3802899a01269df575ea32a21534c5400fb9218a` and was tested
-with mypy 1.9.0, pyright 1.1.350, and
-pytype 2024.2.27.
+This package was generated from typeshed commit `1017c525f84b5e78a75ad909c6a4ef2b5c0610e6` and was tested
+with mypy 1.9.0, pyright 1.1.358, and
+pytype 2024.4.11.

+ 4 - 2
contrib/python/types-protobuf/google-stubs/METADATA.toml

@@ -1,6 +1,8 @@
-version = "4.24.*"
+# Whenever you update version here, PROTOBUF_VERSION should be updated
+# in scripts/generate_proto_stubs.sh and vice-versa.
+version = "5.26.*"
 upstream_repository = "https://github.com/protocolbuffers/protobuf"
-extra_description = "Generated using [mypy-protobuf==3.5.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.5.0) on protobuf==4.21.8"
+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)"
 partial_stub = true
 
 [tool.stubtest]

+ 84 - 82
contrib/python/types-protobuf/google-stubs/protobuf/descriptor.pyi

@@ -24,7 +24,7 @@ _USE_C_DESCRIPTORS: bool
 
 class DescriptorBase(metaclass=DescriptorMetaclass):
     has_options: Any
-    def __init__(self, options, serialized_options, options_class_name) -> None: ...
+    def __init__(self, file, options, serialized_options, options_class_name) -> None: ...
     def GetOptions(self): ...
 
 class _NestedDescriptorBase(DescriptorBase):
@@ -40,9 +40,9 @@ class _NestedDescriptorBase(DescriptorBase):
         full_name,
         file,
         containing_type,
-        serialized_start=...,
-        serialized_end=...,
-        serialized_options=...,
+        serialized_start=None,
+        serialized_end=None,
+        serialized_options=None,
     ) -> None: ...
     def CopyToProto(self, proto): ...
 
@@ -61,7 +61,6 @@ class Descriptor(_NestedDescriptorBase):
     extension_ranges: Any
     oneofs: Any
     oneofs_by_name: Any
-    syntax: Any
     def __init__(
         self,
         name: str,
@@ -72,16 +71,17 @@ class Descriptor(_NestedDescriptorBase):
         nested_types: list[FieldDescriptor],
         enum_types: list[EnumDescriptor],
         extensions: list[FieldDescriptor],
-        options: Incomplete | None = ...,
-        serialized_options: Incomplete | None = ...,
-        is_extendable: bool | None = ...,
-        extension_ranges: Incomplete | None = ...,
-        oneofs: list[OneofDescriptor] | None = ...,
-        file: FileDescriptor | None = ...,
-        serialized_start: Incomplete | None = ...,
-        serialized_end: Incomplete | None = ...,
-        syntax: str | None = ...,
-        create_key: Incomplete | None = ...,
+        options: Incomplete | None = None,
+        serialized_options: Incomplete | None = None,
+        is_extendable: bool | None = True,
+        extension_ranges: Incomplete | None = None,
+        oneofs: list[OneofDescriptor] | None = None,
+        file: FileDescriptor | None = None,
+        serialized_start: Incomplete | None = None,
+        serialized_end: Incomplete | None = None,
+        syntax: str | None = None,
+        is_map_entry=False,
+        create_key: Incomplete | None = None,
     ): ...
     def EnumValueName(self, enum, value): ...
     def CopyToProto(self, proto): ...
@@ -140,13 +140,13 @@ class FieldDescriptor(DescriptorBase):
         containing_type,
         is_extension,
         extension_scope,
-        options=...,
-        serialized_options=...,
-        has_default_value=...,
-        containing_oneof=...,
-        json_name=...,
-        file=...,
-        create_key=...,
+        options=None,
+        serialized_options=None,
+        has_default_value=True,
+        containing_oneof=None,
+        json_name=None,
+        file=None,
+        create_key=None,
     ): ...
     name: Any
     full_name: Any
@@ -154,7 +154,8 @@ class FieldDescriptor(DescriptorBase):
     number: Any
     type: Any
     cpp_type: Any
-    label: Any
+    @property
+    def label(self): ...
     has_default_value: Any
     default_value: Any
     containing_type: Any
@@ -178,13 +179,13 @@ class FieldDescriptor(DescriptorBase):
         containing_type,
         is_extension,
         extension_scope,
-        options=...,
-        serialized_options=...,
-        has_default_value=...,
-        containing_oneof=...,
-        json_name=...,
-        file=...,
-        create_key=...,
+        options=None,
+        serialized_options=None,
+        has_default_value=True,
+        containing_oneof=None,
+        json_name=None,
+        file=None,
+        create_key=None,
     ) -> None: ...
     @staticmethod
     def ProtoTypeToCppProtoType(proto_type): ...
@@ -197,13 +198,13 @@ class EnumDescriptor(_NestedDescriptorBase):
         full_name,
         filename,
         values,
-        containing_type=...,
-        options=...,
-        serialized_options=...,
-        file=...,
-        serialized_start=...,
-        serialized_end=...,
-        create_key=...,
+        containing_type=None,
+        options=None,
+        serialized_options=None,
+        file=None,
+        serialized_start=None,
+        serialized_end=None,
+        create_key=None,
     ): ...
     values: Any
     values_by_name: Any
@@ -214,35 +215,35 @@ class EnumDescriptor(_NestedDescriptorBase):
         full_name,
         filename,
         values,
-        containing_type=...,
-        options=...,
-        serialized_options=...,
-        file=...,
-        serialized_start=...,
-        serialized_end=...,
-        create_key=...,
+        containing_type=None,
+        options=None,
+        serialized_options=None,
+        file=None,
+        serialized_start=None,
+        serialized_end=None,
+        create_key=None,
     ) -> None: ...
     def CopyToProto(self, proto): ...
     def GetOptions(self) -> EnumOptions: ...
 
 class EnumValueDescriptor(DescriptorBase):
-    def __new__(cls, name, index, number, type=..., options=..., serialized_options=..., create_key=...): ...
+    def __new__(cls, name, index, number, type=None, options=None, serialized_options=None, create_key=None): ...
     name: Any
     index: Any
     number: Any
     type: Any
-    def __init__(self, name, index, number, type=..., options=..., serialized_options=..., create_key=...) -> None: ...
+    def __init__(self, name, index, number, type=None, options=None, serialized_options=None, create_key=None) -> None: ...
     def GetOptions(self) -> EnumValueOptions: ...
 
 class OneofDescriptor:
-    def __new__(cls, name, full_name, index, containing_type, fields, options=..., serialized_options=..., create_key=...): ...
+    def __new__(cls, name, full_name, index, containing_type, fields, options=None, serialized_options=None, create_key=None): ...
     name: Any
     full_name: Any
     index: Any
     containing_type: Any
     fields: Any
     def __init__(
-        self, name, full_name, index, containing_type, fields, options=..., serialized_options=..., create_key=...
+        self, name, full_name, index, containing_type, fields, options=None, serialized_options=None, create_key=None
     ) -> None: ...
     def GetOptions(self) -> OneofOptions: ...
 
@@ -256,12 +257,12 @@ class ServiceDescriptor(_NestedDescriptorBase):
         full_name: str,
         index: int,
         methods: list[MethodDescriptor],
-        options: ServiceOptions | None = ...,
-        serialized_options: Incomplete | None = ...,
-        file: FileDescriptor | None = ...,
-        serialized_start: Incomplete | None = ...,
-        serialized_end: Incomplete | None = ...,
-        create_key: Incomplete | None = ...,
+        options: ServiceOptions | None = None,
+        serialized_options: Incomplete | None = None,
+        file: FileDescriptor | None = None,
+        serialized_start: Incomplete | None = None,
+        serialized_end: Incomplete | None = None,
+        create_key: Incomplete | None = None,
     ): ...
     def FindMethodByName(self, name): ...
     def CopyToProto(self, proto): ...
@@ -276,11 +277,11 @@ class MethodDescriptor(DescriptorBase):
         containing_service,
         input_type,
         output_type,
-        client_streaming=...,
-        server_streaming=...,
-        options=...,
-        serialized_options=...,
-        create_key=...,
+        client_streaming=False,
+        server_streaming=False,
+        options=None,
+        serialized_options=None,
+        create_key=None,
     ): ...
     name: Any
     full_name: Any
@@ -298,11 +299,11 @@ class MethodDescriptor(DescriptorBase):
         containing_service,
         input_type,
         output_type,
-        client_streaming=...,
-        server_streaming=...,
-        options=...,
-        serialized_options=...,
-        create_key=...,
+        client_streaming=False,
+        server_streaming=False,
+        options=None,
+        serialized_options=None,
+        create_key=None,
     ) -> None: ...
     def GetOptions(self) -> MethodOptions: ...
 
@@ -311,21 +312,21 @@ class FileDescriptor(DescriptorBase):
         cls,
         name,
         package,
-        options=...,
-        serialized_options=...,
-        serialized_pb=...,
-        dependencies=...,
-        public_dependencies=...,
-        syntax=...,
-        pool=...,
-        create_key=...,
+        options=None,
+        serialized_options=None,
+        serialized_pb=None,
+        dependencies=None,
+        public_dependencies=None,
+        syntax=None,
+        edition=None,
+        pool=None,
+        create_key=None,
     ): ...
     _options: Any
     pool: Any
     message_types_by_name: Any
     name: Any
     package: Any
-    syntax: Any
     serialized_pb: Any
     enum_types_by_name: Any
     extensions_by_name: Any
@@ -336,17 +337,18 @@ class FileDescriptor(DescriptorBase):
         self,
         name,
         package,
-        options=...,
-        serialized_options=...,
-        serialized_pb=...,
-        dependencies=...,
-        public_dependencies=...,
-        syntax=...,
-        pool=...,
-        create_key=...,
+        options=None,
+        serialized_options=None,
+        serialized_pb=None,
+        dependencies=None,
+        public_dependencies=None,
+        syntax=None,
+        edition=None,
+        pool=None,
+        create_key=None,
     ) -> None: ...
     def CopyToProto(self, proto): ...
     def GetOptions(self) -> FileOptions: ...
 
-def MakeDescriptor(desc_proto, package=..., build_file_if_cpp=..., syntax=...): ...
+def MakeDescriptor(desc_proto, package="", build_file_if_cpp=True, syntax=None, edition=None, file_desc=None): ...
 def _ParseOptions(message: Message, string: bytes) -> Message: ...

+ 3 - 7
contrib/python/types-protobuf/google-stubs/protobuf/descriptor_pool.pyi

@@ -1,16 +1,12 @@
-from _typeshed import Incomplete
+from _typeshed import Incomplete, Unused
 
 class DescriptorPool:
-    def __new__(cls, descriptor_db: Incomplete | None = ...): ...
+    def __new__(cls, descriptor_db: Incomplete | None = None): ...
     def __init__(  # pyright: ignore[reportInconsistentConstructor]
-        self, descriptor_db: Incomplete | None = ..., use_deprecated_legacy_json_field_conflicts: bool = ...
+        self, descriptor_db: Incomplete | None = None, use_deprecated_legacy_json_field_conflicts: Unused = False
     ) -> None: ...
     def Add(self, file_desc_proto): ...
     def AddSerializedFile(self, serialized_file_desc_proto): ...
-    def AddDescriptor(self, desc): ...
-    def AddServiceDescriptor(self, service_desc): ...
-    def AddExtensionDescriptor(self, extension): ...
-    def AddFileDescriptor(self, file_desc): ...
     def FindFileByName(self, file_name): ...
     def FindFileContainingSymbol(self, symbol): ...
     def FindMessageTypeByName(self, full_name): ...

+ 2 - 3
contrib/python/types-protobuf/google-stubs/protobuf/internal/builder.pyi

@@ -1,5 +1,4 @@
-from _typeshed import Incomplete
 from typing import Any
 
-def BuildMessageAndEnumDescriptors(file_des: Incomplete, module: dict[str, Any]) -> None: ...
-def BuildTopDescriptorsAndMessages(file_des: Incomplete, module_name: str, module: dict[str, Any]) -> None: ...
+def BuildMessageAndEnumDescriptors(file_des, module: dict[str, Any]) -> None: ...
+def BuildTopDescriptorsAndMessages(file_des, module_name: str, module: dict[str, Any]) -> None: ...

+ 6 - 5
contrib/python/types-protobuf/google-stubs/protobuf/internal/containers.pyi

@@ -21,7 +21,8 @@ class BaseContainer(Sequence[_T]):
     def __len__(self) -> int: ...
     def __ne__(self, other: object) -> bool: ...
     def __hash__(self) -> int: ...
-    def sort(self, *, key: Callable[[_T], Any] | None = ..., reverse: bool = ...) -> None: ...
+    # Same as list.sort, the extra sort_function kwarg errors in Python 3
+    def sort(self, *, key: Callable[[_T], Any] | None = None, reverse: bool = False) -> None: ...
     @overload
     def __getitem__(self, key: SupportsIndex) -> _T: ...
     @overload
@@ -34,7 +35,7 @@ class RepeatedScalarFieldContainer(BaseContainer[_ScalarV]):
     def extend(self, elem_seq: Iterable[_ScalarV] | None) -> None: ...
     def MergeFrom(self: _M, other: _M) -> None: ...
     def remove(self, elem: _ScalarV) -> None: ...
-    def pop(self, key: int = ...) -> _ScalarV: ...
+    def pop(self, key: int = -1) -> _ScalarV: ...
     @overload
     def __setitem__(self, key: int, value: _ScalarV) -> None: ...
     @overload
@@ -50,7 +51,7 @@ class RepeatedCompositeFieldContainer(BaseContainer[_MessageV]):
     def extend(self, elem_seq: Iterable[_MessageV]) -> None: ...
     def MergeFrom(self: _M, other: _M) -> None: ...
     def remove(self, elem: _MessageV) -> None: ...
-    def pop(self, key: int = ...) -> _MessageV: ...
+    def pop(self, key: int = -1) -> _MessageV: ...
     def __delitem__(self, key: int | slice) -> None: ...
     def __eq__(self, other: object) -> bool: ...
 
@@ -69,7 +70,7 @@ class ScalarMap(MutableMapping[_K, _ScalarV]):
     def __iter__(self) -> Iterator[_K]: ...
     def __eq__(self, other: object) -> bool: ...
     @overload
-    def get(self, key: _K, default: None = ...) -> _ScalarV | None: ...
+    def get(self, key: _K, default: None = None) -> _ScalarV | None: ...
     @overload
     def get(self, key: _K, default: _ScalarV | _T) -> _ScalarV | _T: ...
     def MergeFrom(self: _M, other: _M): ...
@@ -91,7 +92,7 @@ class MessageMap(MutableMapping[_K, _MessageV]):
     def __iter__(self) -> Iterator[_K]: ...
     def __eq__(self, other: object) -> bool: ...
     @overload
-    def get(self, key: _K, default: None = ...) -> _MessageV | None: ...
+    def get(self, key: _K, default: None = None) -> _MessageV | None: ...
     @overload
     def get(self, key: _K, default: _MessageV | _T) -> _MessageV | _T: ...
     def get_or_create(self, key: _K) -> _MessageV: ...

+ 3 - 3
contrib/python/types-protobuf/google-stubs/protobuf/internal/decoder.pyi

@@ -30,7 +30,7 @@ def EnumDecoder(
     is_packed: bool,
     key: FieldDescriptor,
     new_default: _NewDefault,
-    clear_if_default: bool = ...,
+    clear_if_default: bool = False,
 ) -> _Decoder: ...
 def StringDecoder(
     field_number: int,
@@ -38,7 +38,7 @@ def StringDecoder(
     is_packed: bool,
     key: FieldDescriptor,
     new_default: _NewDefault,
-    clear_if_default: bool = ...,
+    clear_if_default: bool = False,
 ) -> _Decoder: ...
 def BytesDecoder(
     field_number: int,
@@ -46,7 +46,7 @@ def BytesDecoder(
     is_packed: bool,
     key: FieldDescriptor,
     new_default: _NewDefault,
-    clear_if_default: bool = ...,
+    clear_if_default: bool = False,
 ) -> _Decoder: ...
 def GroupDecoder(
     field_number: int, is_repeated: bool, is_packed: bool, key: FieldDescriptor, new_default: _NewDefault

+ 5 - 7
contrib/python/types-protobuf/google-stubs/protobuf/internal/well_known_types.pyi

@@ -9,12 +9,10 @@ from google.protobuf import struct_pb2
 class Any:
     type_url: str
     value: Incomplete
-    def Pack(
-        self, msg: Incomplete, type_url_prefix: str = "type.googleapis.com/", deterministic: Incomplete | None = None
-    ) -> None: ...
-    def Unpack(self, msg: Incomplete) -> bool: ...
+    def Pack(self, msg, type_url_prefix: str = "type.googleapis.com/", deterministic: Incomplete | None = None) -> None: ...
+    def Unpack(self, msg) -> bool: ...
     def TypeName(self) -> str: ...
-    def Is(self, descriptor: Incomplete) -> bool: ...
+    def Is(self, descriptor) -> bool: ...
 
 class Timestamp:
     def ToJsonString(self) -> str: ...
@@ -30,7 +28,7 @@ class Timestamp:
     def FromMicroseconds(self, micros: int) -> None: ...
     def FromMilliseconds(self, millis: int) -> None: ...
     def FromSeconds(self, seconds: int) -> None: ...
-    def ToDatetime(self, tzinfo: tzinfo | None = ...) -> datetime: ...
+    def ToDatetime(self, tzinfo: tzinfo | None = None) -> datetime: ...
     def FromDatetime(self, dt: datetime) -> None: ...
 
 class Duration:
@@ -58,7 +56,7 @@ class FieldMask:
     def Union(self, mask1: tAny, mask2: tAny) -> None: ...
     def Intersect(self, mask1: tAny, mask2: tAny) -> None: ...
     def MergeMessage(
-        self, source: tAny, destination: tAny, replace_message_field: bool = ..., replace_repeated_field: bool = ...
+        self, source: tAny, destination: tAny, replace_message_field: bool = False, replace_repeated_field: bool = False
     ) -> None: ...
 
 class _FieldMaskTree:

+ 19 - 19
contrib/python/types-protobuf/google-stubs/protobuf/json_format.pyi

@@ -11,34 +11,34 @@ class SerializeToJsonError(Error): ...
 
 def MessageToJson(
     message: Message,
-    including_default_value_fields: bool = ...,
-    preserving_proto_field_name: bool = ...,
-    indent: int | None = ...,
-    sort_keys: bool = ...,
-    use_integers_for_enums: bool = ...,
-    descriptor_pool: DescriptorPool | None = ...,
-    float_precision: int | None = ...,
-    ensure_ascii: bool = ...,
+    preserving_proto_field_name: bool = False,
+    indent: int | None = 2,
+    sort_keys: bool = False,
+    use_integers_for_enums: bool = False,
+    descriptor_pool: DescriptorPool | None = None,
+    float_precision: int | None = None,
+    ensure_ascii: bool = True,
+    always_print_fields_with_no_presence: bool = False,
 ) -> str: ...
 def MessageToDict(
     message: Message,
-    including_default_value_fields: bool = ...,
-    preserving_proto_field_name: bool = ...,
-    use_integers_for_enums: bool = ...,
-    descriptor_pool: DescriptorPool | None = ...,
-    float_precision: int | None = ...,
+    always_print_fields_with_no_presence: bool = False,
+    preserving_proto_field_name: bool = False,
+    use_integers_for_enums: bool = False,
+    descriptor_pool: DescriptorPool | None = None,
+    float_precision: int | None = None,
 ) -> dict[str, Any]: ...
 def Parse(
     text: bytes | str,
     message: _MessageT,
-    ignore_unknown_fields: bool = ...,
-    descriptor_pool: DescriptorPool | None = ...,
-    max_recursion_depth: int = ...,
+    ignore_unknown_fields: bool = False,
+    descriptor_pool: DescriptorPool | None = None,
+    max_recursion_depth: int = 100,
 ) -> _MessageT: ...
 def ParseDict(
     js_dict: Any,
     message: _MessageT,
-    ignore_unknown_fields: bool = ...,
-    descriptor_pool: DescriptorPool | None = ...,
-    max_recursion_depth: int = ...,
+    ignore_unknown_fields: bool = False,
+    descriptor_pool: DescriptorPool | None = None,
+    max_recursion_depth: int = 100,
 ) -> _MessageT: ...

+ 3 - 3
contrib/python/types-protobuf/google-stubs/protobuf/message.pyi

@@ -13,7 +13,7 @@ _M = TypeVar("_M", bound=Message)  # message type (of self)
 
 class Message:
     DESCRIPTOR: Descriptor
-    def __deepcopy__(self, memo: Any = ...) -> Self: ...
+    def __deepcopy__(self, memo: Any = None) -> Self: ...
     def __eq__(self, other_msg): ...
     def __ne__(self, other_msg): ...
     def MergeFrom(self, other_msg: Self) -> None: ...
@@ -23,8 +23,8 @@ class Message:
     def IsInitialized(self) -> bool: ...
     def MergeFromString(self, serialized: bytes) -> int: ...
     def ParseFromString(self, serialized: bytes) -> int: ...
-    def SerializeToString(self, deterministic: bool = ...) -> bytes: ...
-    def SerializePartialToString(self, deterministic: bool = ...) -> bytes: ...
+    def SerializeToString(self, *, deterministic: bool = ...) -> bytes: ...
+    def SerializePartialToString(self, *, deterministic: bool = ...) -> bytes: ...
     def ListFields(self) -> Sequence[tuple[FieldDescriptor, Any]]: ...
     # The TypeVar must be bound to `Message` or we get mypy errors, so we cannot use `Self` for `HasExtension` & `ClearExtension`
     def HasExtension(self: _M, field_descriptor: _ExtensionFieldDescriptor[_M, Any]) -> bool: ...

Some files were not shown because too many files changed in this diff