diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2024-05-12 09:37:05 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2024-05-12 09:45:21 +0300 |
commit | d502666ab38ad7f8b15bc6e839fd00a4d07cd274 (patch) | |
tree | fe18befee41a498d5e12967a958ddbebdd57b96d | |
parent | 015e1da96b2e9b456ad66af1372774ad1d59dfbb (diff) | |
download | ydb-d502666ab38ad7f8b15bc6e839fd00a4d07cd274.tar.gz |
Update contrib/python/types-protobuf to 5.26.0.20240422
ef33a7540423312f353a77f18ebe05d429b92195
14 files changed, 234 insertions, 232 deletions
diff --git a/contrib/python/types-protobuf/.dist-info/METADATA b/contrib/python/types-protobuf/.dist-info/METADATA index 9343511f8a..9a5c2caee5 100644 --- a/contrib/python/types-protobuf/.dist-info/METADATA +++ b/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. diff --git a/contrib/python/types-protobuf/google-stubs/METADATA.toml b/contrib/python/types-protobuf/google-stubs/METADATA.toml index 7ee1107f03..ad7078f37e 100644 --- a/contrib/python/types-protobuf/google-stubs/METADATA.toml +++ b/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] diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/descriptor.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/descriptor.pyi index d8a1ad676a..291ca0c729 100644 --- a/contrib/python/types-protobuf/google-stubs/protobuf/descriptor.pyi +++ b/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: ... diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/descriptor_pool.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/descriptor_pool.pyi index 00be66656d..f555c5d73e 100644 --- a/contrib/python/types-protobuf/google-stubs/protobuf/descriptor_pool.pyi +++ b/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): ... diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/internal/builder.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/internal/builder.pyi index a0a72dec58..0491b8e543 100644 --- a/contrib/python/types-protobuf/google-stubs/protobuf/internal/builder.pyi +++ b/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: ... diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/internal/containers.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/internal/containers.pyi index 235ab25d61..30a37353c1 100644 --- a/contrib/python/types-protobuf/google-stubs/protobuf/internal/containers.pyi +++ b/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: ... diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/internal/decoder.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/internal/decoder.pyi index 41a50035b5..ce74e9318c 100644 --- a/contrib/python/types-protobuf/google-stubs/protobuf/internal/decoder.pyi +++ b/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 diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/internal/well_known_types.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/internal/well_known_types.pyi index e257cf0529..6192d64ae1 100644 --- a/contrib/python/types-protobuf/google-stubs/protobuf/internal/well_known_types.pyi +++ b/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: diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/json_format.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/json_format.pyi index 62ad1bad2e..89eba0c4ea 100644 --- a/contrib/python/types-protobuf/google-stubs/protobuf/json_format.pyi +++ b/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: ... diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/message.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/message.pyi index 64448454fc..819ad7aad5 100644 --- a/contrib/python/types-protobuf/google-stubs/protobuf/message.pyi +++ b/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: ... diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/message_factory.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/message_factory.pyi index e9009393aa..518e125195 100644 --- a/contrib/python/types-protobuf/google-stubs/protobuf/message_factory.pyi +++ b/contrib/python/types-protobuf/google-stubs/protobuf/message_factory.pyi @@ -8,10 +8,10 @@ from google.protobuf.message import Message class MessageFactory: pool: Any - def __init__(self, pool: DescriptorPool | None = ...) -> None: ... + def __init__(self, pool: DescriptorPool | None = None) -> None: ... def GetPrototype(self, descriptor: Descriptor) -> type[Message]: ... def GetMessages(self, files: Iterable[str]) -> dict[str, type[Message]]: ... def GetMessageClass(descriptor: Descriptor) -> type[Message]: ... def GetMessageClassesForFiles(files: Iterable[str], pool: DescriptorPool) -> dict[str, type[Message]]: ... -def GetMessages(file_protos: Iterable[FileDescriptorProto], pool: DescriptorPool | None = ...) -> dict[str, type[Message]]: ... +def GetMessages(file_protos: Iterable[FileDescriptorProto], pool: DescriptorPool | None = None) -> dict[str, type[Message]]: ... diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/py.typed b/contrib/python/types-protobuf/google-stubs/protobuf/py.typed new file mode 100644 index 0000000000..b648ac9233 --- /dev/null +++ b/contrib/python/types-protobuf/google-stubs/protobuf/py.typed @@ -0,0 +1 @@ +partial diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/text_format.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/text_format.pyi index 593739c94f..c9a9da29a1 100644 --- a/contrib/python/types-protobuf/google-stubs/protobuf/text_format.pyi +++ b/contrib/python/types-protobuf/google-stubs/protobuf/text_format.pyi @@ -12,7 +12,7 @@ _M = TypeVar("_M", bound=Message) # message type (of self) class Error(Exception): ... class ParseError(Error): - def __init__(self, message: str | None = ..., line: int | None = ..., column: int | None = ...) -> None: ... + def __init__(self, message: str | None = None, line: int | None = None, column: int | None = None) -> None: ... def GetLine(self) -> int | None: ... def GetColumn(self) -> int | None: ... @@ -26,84 +26,86 @@ _MessageFormatter: TypeAlias = Callable[[Message, int, bool], str | None] def MessageToString( message: Message, - as_utf8: bool = ..., - as_one_line: bool = ..., - use_short_repeated_primitives: bool = ..., - pointy_brackets: bool = ..., - use_index_order: bool = ..., - float_format: str | None = ..., - double_format: str | None = ..., - use_field_number: bool = ..., - descriptor_pool: DescriptorPool | None = ..., - indent: int = ..., - message_formatter: _MessageFormatter | None = ..., - print_unknown_fields: bool = ..., - force_colon: bool = ..., + as_utf8: bool = True, + as_one_line: bool = False, + use_short_repeated_primitives: bool = False, + pointy_brackets: bool = False, + use_index_order: bool = False, + float_format: str | None = None, + double_format: str | None = None, + use_field_number: bool = False, + descriptor_pool: DescriptorPool | None = None, + indent: int = 0, + message_formatter: _MessageFormatter | None = None, + print_unknown_fields: bool = False, + force_colon: bool = False, ) -> str: ... def MessageToBytes( message: Message, - as_utf8: bool = ..., - as_one_line: bool = ..., - use_short_repeated_primitives: bool = ..., - pointy_brackets: bool = ..., - use_index_order: bool = ..., - float_format: str | None = ..., - double_format: str | None = ..., - use_field_number: bool = ..., - descriptor_pool: DescriptorPool | None = ..., - indent: int = ..., - message_formatter: _MessageFormatter = ..., - print_unknown_fields: bool = ..., - force_colon: bool = ..., + *, + # Same kwargs as MessageToString + as_utf8: bool = True, + as_one_line: bool = False, + use_short_repeated_primitives: bool = False, + pointy_brackets: bool = False, + use_index_order: bool = False, + float_format: str | None = None, + double_format: str | None = None, + use_field_number: bool = False, + descriptor_pool: DescriptorPool | None = None, + indent: int = 0, + message_formatter: _MessageFormatter | None = None, + print_unknown_fields: bool = False, + force_colon: bool = False, ) -> bytes: ... def PrintMessage( message: Message, out: SupportsWrite[str], - indent: int = ..., - as_utf8: bool = ..., - as_one_line: bool = ..., - use_short_repeated_primitives: bool = ..., - pointy_brackets: bool = ..., - use_index_order: bool = ..., - float_format: str | None = ..., - double_format: str | None = ..., - use_field_number: bool = ..., - descriptor_pool: DescriptorPool | None = ..., - message_formatter: _MessageFormatter | None = ..., - print_unknown_fields: bool = ..., - force_colon: bool = ..., + indent: int = 0, + as_utf8: bool = True, + as_one_line: bool = False, + use_short_repeated_primitives: bool = False, + pointy_brackets: bool = False, + use_index_order: bool = False, + float_format: str | None = None, + double_format: str | None = None, + use_field_number: bool = False, + descriptor_pool: DescriptorPool | None = None, + message_formatter: _MessageFormatter | None = None, + print_unknown_fields: bool = False, + force_colon: bool = False, ) -> None: ... def PrintField( field: FieldDescriptor, value: Any, out: SupportsWrite[str], - indent: int = ..., - as_utf8: bool = ..., - as_one_line: bool = ..., - use_short_repeated_primitives: bool = ..., - pointy_brackets: bool = ..., - use_index_order: bool = ..., - float_format: str | None = ..., - double_format: str | None = ..., - message_formatter: _MessageFormatter | None = ..., - print_unknown_fields: bool = ..., - force_colon: bool = ..., + indent: int = 0, + as_utf8: bool = True, + as_one_line: bool = False, + use_short_repeated_primitives: bool = False, + pointy_brackets: bool = False, + use_index_order: bool = False, + float_format: str | None = None, + double_format: str | None = None, + message_formatter: _MessageFormatter | None = None, + print_unknown_fields: bool = False, + force_colon: bool = False, ) -> None: ... def PrintFieldValue( field: FieldDescriptor, value: Any, out: SupportsWrite[str], - indent: int = ..., - as_utf8: bool = ..., - as_one_line: bool = ..., - use_short_repeated_primitives: bool = ..., - pointy_brackets: bool = ..., - use_index_order: bool = ..., - float_format: str | None = ..., - double_format: str | None = ..., - message_formatter: _MessageFormatter | None = ..., - print_unknown_fields: bool = ..., - force_colon: bool = ..., + indent: int = 0, + as_utf8: bool = True, + as_one_line: bool = False, + use_short_repeated_primitives: bool = False, + pointy_brackets: bool = False, + use_index_order: bool = False, + float_format: str | None = None, + double_format: str | None = None, + message_formatter: _MessageFormatter | None = None, + print_unknown_fields: bool = False, + force_colon: bool = False, ) -> None: ... class _Printer: @@ -124,19 +126,19 @@ class _Printer: def __init__( self, out: SupportsWrite[str], - indent: int = ..., - as_utf8: bool = ..., - as_one_line: bool = ..., - use_short_repeated_primitives: bool = ..., - pointy_brackets: bool = ..., - use_index_order: bool = ..., - float_format: str | None = ..., - double_format: str | None = ..., - use_field_number: bool = ..., - descriptor_pool: DescriptorPool | None = ..., - message_formatter: _MessageFormatter | None = ..., - print_unknown_fields: bool = ..., - force_colon: bool = ..., + indent: int = 0, + as_utf8: bool = True, + as_one_line: bool = False, + use_short_repeated_primitives: bool = False, + pointy_brackets: bool = False, + use_index_order: bool = False, + float_format: str | None = None, + double_format: str | None = None, + use_field_number: bool = False, + descriptor_pool: DescriptorPool | None = None, + message_formatter: _MessageFormatter | None = None, + print_unknown_fields: bool = False, + force_colon: bool = False, ) -> None: ... def PrintMessage(self, message: Message) -> None: ... def PrintField(self, field: FieldDescriptor, value: Any) -> None: ... @@ -145,26 +147,26 @@ class _Printer: def Parse( text: str | bytes, message: _M, - allow_unknown_extension: bool = ..., - allow_field_number: bool = ..., - descriptor_pool: DescriptorPool | None = ..., - allow_unknown_field: bool = ..., + allow_unknown_extension: bool = False, + allow_field_number: bool = False, + descriptor_pool: DescriptorPool | None = None, + allow_unknown_field: bool = False, ) -> _M: ... def Merge( text: str | bytes, message: _M, - allow_unknown_extension: bool = ..., - allow_field_number: bool = ..., - descriptor_pool: DescriptorPool | None = ..., - allow_unknown_field: bool = ..., + allow_unknown_extension: bool = False, + allow_field_number: bool = False, + descriptor_pool: DescriptorPool | None = None, + allow_unknown_field: bool = False, ) -> _M: ... def MergeLines( lines: Iterable[str | bytes], message: _M, - allow_unknown_extension: bool = ..., - allow_field_number: bool = ..., - descriptor_pool: DescriptorPool | None = ..., - allow_unknown_field: bool = ..., + allow_unknown_extension: bool = False, + allow_field_number: bool = False, + descriptor_pool: DescriptorPool | None = None, + allow_unknown_field: bool = False, ) -> _M: ... class _Parser: @@ -174,10 +176,10 @@ class _Parser: allow_unknown_field: bool def __init__( self, - allow_unknown_extension: bool = ..., - allow_field_number: bool = ..., - descriptor_pool: DescriptorPool | None = ..., - allow_unknown_field: bool = ..., + allow_unknown_extension: bool = False, + allow_field_number: bool = False, + descriptor_pool: DescriptorPool | None = None, + allow_unknown_field: bool = False, ) -> None: ... def ParseLines(self, lines: Iterable[str | bytes], message: _M) -> _M: ... def MergeLines(self, lines: Iterable[str | bytes], message: _M) -> _M: ... @@ -210,7 +212,7 @@ class Tokenizer: def ParseError(self, message: Message) -> _ParseError: ... def NextToken(self) -> None: ... -def ParseInteger(text: str, is_signed: bool = ..., is_long: bool = ...) -> int: ... +def ParseInteger(text: str, is_signed: bool = False, is_long: bool = False) -> int: ... def ParseFloat(text: str) -> float: ... def ParseBool(text: str) -> bool: ... def ParseEnum(field: FieldDescriptor, value: str) -> int: ... diff --git a/contrib/python/types-protobuf/ya.make b/contrib/python/types-protobuf/ya.make index fccc308bce..d70c00e22e 100644 --- a/contrib/python/types-protobuf/ya.make +++ b/contrib/python/types-protobuf/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(4.24.0.20240311) +VERSION(5.26.0.20240422) LICENSE(Apache-2.0) @@ -42,6 +42,7 @@ RESOURCE_FILES( .dist-info/METADATA .dist-info/top_level.txt google-stubs/METADATA.toml + google-stubs/protobuf/py.typed ) END() |