summaryrefslogtreecommitdiffstats
path: root/contrib/python
diff options
context:
space:
mode:
authorrobot-contrib <[email protected]>2025-05-24 21:09:33 +0300
committerrobot-contrib <[email protected]>2025-05-24 21:26:59 +0300
commitbd0779c9d1b7da9d7c0d1bcef115b101bb98681d (patch)
tree789e15b2f47887d76217aac5275534af0a7b2f5e /contrib/python
parent31c196a2173cb510b21eb45748f2af5331a878fe (diff)
Update contrib/python/types-protobuf to 6.30.2.20250506
commit_hash:0dd1c540e0f2b06db0697a7c43a89979129be6af
Diffstat (limited to 'contrib/python')
-rw-r--r--contrib/python/types-protobuf/.dist-info/METADATA26
-rw-r--r--contrib/python/types-protobuf/README.md8
-rw-r--r--contrib/python/types-protobuf/google-stubs/METADATA.toml5
-rw-r--r--contrib/python/types-protobuf/google-stubs/_upb/_message.pyi310
-rw-r--r--contrib/python/types-protobuf/google-stubs/protobuf/__init__.pyi4
-rw-r--r--contrib/python/types-protobuf/google-stubs/protobuf/descriptor_database.pyi16
-rw-r--r--contrib/python/types-protobuf/google-stubs/protobuf/internal/containers.pyi12
-rw-r--r--contrib/python/types-protobuf/google-stubs/protobuf/internal/decoder.pyi2
-rw-r--r--contrib/python/types-protobuf/google-stubs/protobuf/message.pyi15
-rw-r--r--contrib/python/types-protobuf/google-stubs/protobuf/message_factory.pyi2
-rw-r--r--contrib/python/types-protobuf/google-stubs/protobuf/reflection.pyi3
-rw-r--r--contrib/python/types-protobuf/google-stubs/protobuf/service.pyi39
-rw-r--r--contrib/python/types-protobuf/ya.make5
13 files changed, 362 insertions, 85 deletions
diff --git a/contrib/python/types-protobuf/.dist-info/METADATA b/contrib/python/types-protobuf/.dist-info/METADATA
index 2e57930ea7c..0fd53bbd2c4 100644
--- a/contrib/python/types-protobuf/.dist-info/METADATA
+++ b/contrib/python/types-protobuf/.dist-info/METADATA
@@ -1,27 +1,19 @@
-Metadata-Version: 2.2
+Metadata-Version: 2.4
Name: types-protobuf
-Version: 5.29.1.20250315
+Version: 6.30.2.20250506
Summary: Typing stubs for protobuf
-Home-page: https://github.com/python/typeshed
-License: Apache-2.0
+License-Expression: Apache-2.0
+Project-URL: Homepage, https://github.com/python/typeshed
Project-URL: GitHub, https://github.com/python/typeshed
Project-URL: Changes, https://github.com/typeshed-internal/stub_uploader/blob/main/data/changelogs/protobuf.md
Project-URL: Issue tracker, https://github.com/python/typeshed/issues
Project-URL: Chat, https://gitter.im/python/typing
-Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Stubs Only
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
-Dynamic: classifier
-Dynamic: description
-Dynamic: description-content-type
-Dynamic: home-page
-Dynamic: license
-Dynamic: project-url
-Dynamic: requires-python
-Dynamic: summary
+Dynamic: license-file
## Typing stubs for protobuf
@@ -34,9 +26,9 @@ It can be used by type-checking tools like
[Pyre](https://pyre-check.org/),
PyCharm, etc. to check code that uses `protobuf`. This version of
`types-protobuf` aims to provide accurate annotations for
-`protobuf~=5.29.1`.
+`protobuf~=6.30.2`.
-Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 28.1 on [protobuf v29.1](https://github.com/protocolbuffers/protobuf/releases/tag/v29.1) (python `protobuf==5.29.1`).
+Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 29.0 on [protobuf v30.2](https://github.com/protocolbuffers/protobuf/releases/tag/v30.2) (python `protobuf==6.30.2`).
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.
@@ -51,7 +43,7 @@ directory.
This package was tested with
mypy 1.15.0,
-pyright 1.1.396,
+pyright 1.1.400,
and pytype 2024.10.11.
It was generated from typeshed commit
-[`cdfb10c340c3df0f8b4112705e6e229b6ae269fd`](https://github.com/python/typeshed/commit/cdfb10c340c3df0f8b4112705e6e229b6ae269fd).
+[`4265ee7c72f476e7156949e55784fd82b40e6953`](https://github.com/python/typeshed/commit/4265ee7c72f476e7156949e55784fd82b40e6953).
diff --git a/contrib/python/types-protobuf/README.md b/contrib/python/types-protobuf/README.md
index 6c6f6b321a8..c35bf581ad2 100644
--- a/contrib/python/types-protobuf/README.md
+++ b/contrib/python/types-protobuf/README.md
@@ -9,9 +9,9 @@ It can be used by type-checking tools like
[Pyre](https://pyre-check.org/),
PyCharm, etc. to check code that uses `protobuf`. This version of
`types-protobuf` aims to provide accurate annotations for
-`protobuf~=5.29.1`.
+`protobuf~=6.30.2`.
-Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 28.1 on [protobuf v29.1](https://github.com/protocolbuffers/protobuf/releases/tag/v29.1) (python `protobuf==5.29.1`).
+Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 29.0 on [protobuf v30.2](https://github.com/protocolbuffers/protobuf/releases/tag/v30.2) (python `protobuf==6.30.2`).
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.
@@ -26,7 +26,7 @@ directory.
This package was tested with
mypy 1.15.0,
-pyright 1.1.396,
+pyright 1.1.400,
and pytype 2024.10.11.
It was generated from typeshed commit
-[`cdfb10c340c3df0f8b4112705e6e229b6ae269fd`](https://github.com/python/typeshed/commit/cdfb10c340c3df0f8b4112705e6e229b6ae269fd). \ No newline at end of file
+[`4265ee7c72f476e7156949e55784fd82b40e6953`](https://github.com/python/typeshed/commit/4265ee7c72f476e7156949e55784fd82b40e6953). \ No newline at end of file
diff --git a/contrib/python/types-protobuf/google-stubs/METADATA.toml b/contrib/python/types-protobuf/google-stubs/METADATA.toml
index 04c674e5fbc..a7416507152 100644
--- a/contrib/python/types-protobuf/google-stubs/METADATA.toml
+++ b/contrib/python/types-protobuf/google-stubs/METADATA.toml
@@ -1,7 +1,8 @@
# Using an exact number in the specifier for scripts/sync_protobuf/google_protobuf.py
-version = "~=5.29.1"
+# When updating, also re-run the script
+version = "~=6.30.2"
upstream_repository = "https://github.com/protocolbuffers/protobuf"
-extra_description = "Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 28.1 on [protobuf v29.1](https://github.com/protocolbuffers/protobuf/releases/tag/v29.1) (python `protobuf==5.29.1`)."
+extra_description = "Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 29.0 on [protobuf v30.2](https://github.com/protocolbuffers/protobuf/releases/tag/v30.2) (python `protobuf==6.30.2`)."
partial_stub = true
[tool.stubtest]
diff --git a/contrib/python/types-protobuf/google-stubs/_upb/_message.pyi b/contrib/python/types-protobuf/google-stubs/_upb/_message.pyi
new file mode 100644
index 00000000000..bb188bcbf4f
--- /dev/null
+++ b/contrib/python/types-protobuf/google-stubs/_upb/_message.pyi
@@ -0,0 +1,310 @@
+from _typeshed import Incomplete
+from typing import ClassVar, final
+
+default_pool: DescriptorPool
+
+@final
+class Arena: ...
+
+@final
+class Descriptor:
+ containing_type: Incomplete
+ enum_types: Incomplete
+ enum_types_by_name: Incomplete
+ enum_values_by_name: Incomplete
+ extension_ranges: Incomplete
+ extensions: Incomplete
+ extensions_by_name: Incomplete
+ fields: Incomplete
+ fields_by_camelcase_name: Incomplete
+ fields_by_name: Incomplete
+ fields_by_number: Incomplete
+ file: Incomplete
+ full_name: Incomplete
+ has_options: Incomplete
+ is_extendable: Incomplete
+ name: Incomplete
+ nested_types: Incomplete
+ nested_types_by_name: Incomplete
+ oneofs: Incomplete
+ oneofs_by_name: Incomplete
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def CopyToProto(self, object, /): ...
+ def EnumValueName(self, *args, **kwargs): ... # incomplete
+ def GetOptions(self): ...
+
+@final
+class DescriptorPool:
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def Add(self, object, /): ...
+ def AddSerializedFile(self, object, /): ...
+ def FindAllExtensions(self, object, /): ...
+ def FindEnumTypeByName(self, object, /): ...
+ def FindExtensionByName(self, object, /): ...
+ def FindExtensionByNumber(self, *args, **kwargs): ... # incomplete
+ def FindFieldByName(self, object, /): ...
+ def FindFileByName(self, object, /): ...
+ def FindFileContainingSymbol(self, object, /): ...
+ def FindMessageTypeByName(self, object, /): ...
+ def FindMethodByName(self, object, /): ...
+ def FindOneofByName(self, object, /): ...
+ def FindServiceByName(self, object, /): ...
+ def SetFeatureSetDefaults(self, object, /): ...
+
+@final
+class EnumDescriptor:
+ containing_type: Incomplete
+ file: Incomplete
+ full_name: Incomplete
+ has_options: Incomplete
+ is_closed: Incomplete
+ name: Incomplete
+ values: Incomplete
+ values_by_name: Incomplete
+ values_by_number: Incomplete
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def CopyToProto(self, object, /): ...
+ def GetOptions(self): ...
+
+@final
+class EnumValueDescriptor:
+ has_options: Incomplete
+ index: Incomplete
+ name: Incomplete
+ number: Incomplete
+ type: Incomplete
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def GetOptions(self): ...
+
+@final
+class ExtensionDict:
+ def __contains__(self, other) -> bool: ...
+ def __delitem__(self, other) -> None: ...
+ def __eq__(self, other: object) -> bool: ...
+ def __ge__(self, other: object) -> bool: ...
+ def __getitem__(self, index): ...
+ def __gt__(self, other: object) -> bool: ...
+ def __iter__(self): ...
+ def __le__(self, other: object) -> bool: ...
+ def __len__(self) -> int: ...
+ def __lt__(self, other: object) -> bool: ...
+ def __ne__(self, other: object) -> bool: ...
+ def __setitem__(self, index, object) -> None: ...
+
+@final
+class ExtensionIterator:
+ def __iter__(self): ...
+ def __next__(self): ...
+
+@final
+class FieldDescriptor:
+ CPPTYPE_BOOL: ClassVar[int] = ...
+ CPPTYPE_BYTES: ClassVar[int] = ...
+ CPPTYPE_DOUBLE: ClassVar[int] = ...
+ CPPTYPE_ENUM: ClassVar[int] = ...
+ CPPTYPE_FLOAT: ClassVar[int] = ...
+ CPPTYPE_INT32: ClassVar[int] = ...
+ CPPTYPE_INT64: ClassVar[int] = ...
+ CPPTYPE_MESSAGE: ClassVar[int] = ...
+ CPPTYPE_STRING: ClassVar[int] = ...
+ CPPTYPE_UINT32: ClassVar[int] = ...
+ CPPTYPE_UINT64: ClassVar[int] = ...
+ LABEL_OPTIONAL: ClassVar[int] = ...
+ LABEL_REPEATED: ClassVar[int] = ...
+ LABEL_REQUIRED: ClassVar[int] = ...
+ TYPE_BOOL: ClassVar[int] = ...
+ TYPE_BYTES: ClassVar[int] = ...
+ TYPE_DOUBLE: ClassVar[int] = ...
+ TYPE_ENUM: ClassVar[int] = ...
+ TYPE_FIXED32: ClassVar[int] = ...
+ TYPE_FIXED64: ClassVar[int] = ...
+ TYPE_FLOAT: ClassVar[int] = ...
+ TYPE_GROUP: ClassVar[int] = ...
+ TYPE_INT32: ClassVar[int] = ...
+ TYPE_INT64: ClassVar[int] = ...
+ TYPE_MESSAGE: ClassVar[int] = ...
+ TYPE_SFIXED32: ClassVar[int] = ...
+ TYPE_SFIXED64: ClassVar[int] = ...
+ TYPE_SINT32: ClassVar[int] = ...
+ TYPE_SINT64: ClassVar[int] = ...
+ TYPE_STRING: ClassVar[int] = ...
+ TYPE_UINT32: ClassVar[int] = ...
+ TYPE_UINT64: ClassVar[int] = ...
+ camelcase_name: Incomplete
+ containing_oneof: Incomplete
+ containing_type: Incomplete
+ cpp_type: Incomplete
+ default_value: Incomplete
+ enum_type: Incomplete
+ extension_scope: Incomplete
+ file: Incomplete
+ full_name: Incomplete
+ has_default_value: Incomplete
+ has_options: Incomplete
+ has_presence: Incomplete
+ index: Incomplete
+ is_extension: Incomplete
+ is_packed: Incomplete
+ json_name: Incomplete
+ label: Incomplete
+ message_type: Incomplete
+ name: Incomplete
+ number: Incomplete
+ type: Incomplete
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def GetOptions(self): ...
+
+@final
+class FileDescriptor:
+ dependencies: Incomplete
+ enum_types_by_name: Incomplete
+ extensions_by_name: Incomplete
+ has_options: Incomplete
+ message_types_by_name: Incomplete
+ name: Incomplete
+ package: Incomplete
+ pool: Incomplete
+ public_dependencies: Incomplete
+ serialized_pb: Incomplete
+ services_by_name: Incomplete
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def CopyToProto(self, object, /): ...
+ def GetOptions(self): ...
+
+@final
+class MapIterator:
+ def __iter__(self): ...
+ def __next__(self): ...
+
+@final
+class Message:
+ Extensions: Incomplete
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete # incomplete
+ def ByteSize(self): ...
+ def Clear(self): ...
+ def ClearExtension(self, object, /): ...
+ def ClearField(self, object, /): ...
+ def CopyFrom(self, object, /): ...
+ def DiscardUnknownFields(self): ...
+ def FindInitializationErrors(self): ...
+ @classmethod
+ def FromString(cls, object, /): ...
+ def HasExtension(self, object, /): ...
+ def HasField(self, object, /): ...
+ def IsInitialized(self, *args, **kwargs): ... # incomplete
+ def ListFields(self): ...
+ def MergeFrom(self, object, /): ...
+ def MergeFromString(self, object, /): ...
+ def ParseFromString(self, object, /): ...
+ def SerializePartialToString(self, *args, **kwargs): ... # incomplete
+ def SerializeToString(self, *args, **kwargs): ... # incomplete
+ def SetInParent(self): ...
+ def UnknownFields(self): ...
+ def WhichOneof(self, object, /): ...
+ def __contains__(self, other) -> bool: ...
+ def __deepcopy__(self, memo=None): ...
+ def __delattr__(self, name): ...
+ def __eq__(self, other: object) -> bool: ...
+ def __ge__(self, other: object) -> bool: ...
+ def __gt__(self, other: object) -> bool: ...
+ def __le__(self, other: object) -> bool: ...
+ def __lt__(self, other: object) -> bool: ...
+ def __ne__(self, other: object) -> bool: ...
+ def __setattr__(self, name, value): ...
+
+@final
+class MessageMeta(type): ...
+
+@final
+class MethodDescriptor:
+ client_streaming: Incomplete
+ containing_service: Incomplete
+ full_name: Incomplete
+ index: Incomplete
+ input_type: Incomplete
+ name: Incomplete
+ output_type: Incomplete
+ server_streaming: Incomplete
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def CopyToProto(self, object, /): ...
+ def GetOptions(self): ...
+
+@final
+class OneofDescriptor:
+ containing_type: Incomplete
+ fields: Incomplete
+ full_name: Incomplete
+ has_options: Incomplete
+ index: Incomplete
+ name: Incomplete
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def GetOptions(self): ...
+
+@final
+class RepeatedCompositeContainer:
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def MergeFrom(self, object, /): ...
+ def add(self, *args, **kwargs): ... # incomplete
+ def append(self, object, /): ...
+ def extend(self, object, /): ...
+ def insert(self, *args, **kwargs): ... # incomplete
+ def pop(self, *args, **kwargs): ... # incomplete
+ def remove(self, object, /): ...
+ def reverse(self): ...
+ def sort(self, *args, **kwargs): ... # incomplete
+ def __deepcopy__(self, memo=None): ...
+ def __delitem__(self, other) -> None: ...
+ def __eq__(self, other: object) -> bool: ...
+ def __ge__(self, other: object) -> bool: ...
+ def __getitem__(self, index): ...
+ def __gt__(self, other: object) -> bool: ...
+ def __le__(self, other: object) -> bool: ...
+ def __len__(self) -> int: ...
+ def __lt__(self, other: object) -> bool: ...
+ def __ne__(self, other: object) -> bool: ...
+ def __setitem__(self, index, object) -> None: ...
+
+@final
+class RepeatedScalarContainer:
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def MergeFrom(self, object, /): ...
+ def append(self, object, /): ...
+ def extend(self, object, /): ...
+ def insert(self, *args, **kwargs): ... # incomplete
+ def pop(self, *args, **kwargs): ... # incomplete
+ def remove(self, object, /): ...
+ def reverse(self): ...
+ def sort(self, *args, **kwargs): ... # incomplete
+ def __deepcopy__(self, memo=None): ...
+ def __delitem__(self, other) -> None: ...
+ def __eq__(self, other: object) -> bool: ...
+ def __ge__(self, other: object) -> bool: ...
+ def __getitem__(self, index): ...
+ def __gt__(self, other: object) -> bool: ...
+ def __le__(self, other: object) -> bool: ...
+ def __len__(self) -> int: ...
+ def __lt__(self, other: object) -> bool: ...
+ def __ne__(self, other: object) -> bool: ...
+ def __reduce__(self): ...
+ def __setitem__(self, index, object) -> None: ...
+
+@final
+class ServiceDescriptor:
+ file: Incomplete
+ full_name: Incomplete
+ index: Incomplete
+ methods: Incomplete
+ methods_by_name: Incomplete
+ name: Incomplete
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def CopyToProto(self, object, /): ...
+ def FindMethodByName(self, object, /): ...
+ def GetOptions(self): ...
+
+@final
+class UnknownFieldSet:
+ def __init__(self, *args, **kwargs) -> None: ... # incomplete
+ def __getitem__(self, index): ...
+ def __len__(self) -> int: ...
+
+def SetAllowOversizeProtos(object, /): ... # incomplete
diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/__init__.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/__init__.pyi
index bda5b5a7f4c..c5dd9546606 100644
--- a/contrib/python/types-protobuf/google-stubs/protobuf/__init__.pyi
+++ b/contrib/python/types-protobuf/google-stubs/protobuf/__init__.pyi
@@ -1 +1,3 @@
-__version__: str
+from typing import Final
+
+__version__: Final[str]
diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/descriptor_database.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/descriptor_database.pyi
new file mode 100644
index 00000000000..6568fc2159c
--- /dev/null
+++ b/contrib/python/types-protobuf/google-stubs/protobuf/descriptor_database.pyi
@@ -0,0 +1,16 @@
+from typing import Final
+
+from google.protobuf.descriptor_pb2 import FileDescriptorProto
+
+__author__: Final[str]
+
+class Error(Exception): ...
+class DescriptorDatabaseConflictingDefinitionError(Error): ...
+
+class DescriptorDatabase:
+ def __init__(self) -> None: ...
+ def Add(self, file_desc_proto) -> None: ...
+ def FindFileByName(self, name): ...
+ def FindFileContainingSymbol(self, symbol): ...
+ def FindFileContainingExtension(self, extendee_name, extension_number) -> FileDescriptorProto | None: ...
+ def FindAllExtensionNumbers(self, extendee_name) -> list[int]: ...
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 aaa97043921..75261371607 100644
--- a/contrib/python/types-protobuf/google-stubs/protobuf/internal/containers.pyi
+++ b/contrib/python/types-protobuf/google-stubs/protobuf/internal/containers.pyi
@@ -1,5 +1,6 @@
from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequence
from typing import Any, Protocol, SupportsIndex, TypeVar, overload
+from typing_extensions import Self
from google.protobuf.descriptor import Descriptor
from google.protobuf.internal.message_listener import MessageListener
@@ -10,7 +11,6 @@ _T = TypeVar("_T")
_K = TypeVar("_K", bound=bool | int | str)
_ScalarV = TypeVar("_ScalarV", bound=bool | int | float | str | bytes)
_MessageV = TypeVar("_MessageV", bound=Message)
-_M = TypeVar("_M")
class _ValueChecker(Protocol[_T]):
def CheckValue(self, proposed_value: _T) -> _T: ...
@@ -33,7 +33,7 @@ class RepeatedScalarFieldContainer(BaseContainer[_ScalarV]):
def append(self, value: _ScalarV) -> None: ...
def insert(self, key: int, value: _ScalarV) -> None: ...
def extend(self, elem_seq: Iterable[_ScalarV] | None) -> None: ...
- def MergeFrom(self: _M, other: _M | Iterable[_ScalarV]) -> None: ...
+ def MergeFrom(self, other: Self | Iterable[_ScalarV]) -> None: ...
def remove(self, elem: _ScalarV) -> None: ...
def pop(self, key: int = -1) -> _ScalarV: ...
@overload
@@ -49,7 +49,7 @@ class RepeatedCompositeFieldContainer(BaseContainer[_MessageV]):
def append(self, value: _MessageV) -> None: ...
def insert(self, key: int, value: _MessageV) -> None: ...
def extend(self, elem_seq: Iterable[_MessageV]) -> None: ...
- def MergeFrom(self: _M, other: _M | Iterable[_MessageV]) -> None: ...
+ def MergeFrom(self, other: Self | Iterable[_MessageV]) -> None: ...
def remove(self, elem: _MessageV) -> None: ...
def pop(self, key: int = -1) -> _MessageV: ...
def __delitem__(self, key: int | slice) -> None: ...
@@ -73,7 +73,8 @@ class ScalarMap(MutableMapping[_K, _ScalarV]):
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): ...
+ def setdefault(self, key: _K, value: _ScalarV | None = None) -> _ScalarV: ...
+ def MergeFrom(self, other: Self): ...
def InvalidateIterators(self) -> None: ...
def GetEntryClass(self) -> GeneratedProtocolMessageType: ...
@@ -96,6 +97,7 @@ class MessageMap(MutableMapping[_K, _MessageV]):
@overload
def get(self, key: _K, default: _MessageV | _T) -> _MessageV | _T: ...
def get_or_create(self, key: _K) -> _MessageV: ...
- def MergeFrom(self: _M, other: _M): ...
+ def setdefault(self, key: _K, value: _MessageV | None = None) -> _MessageV: ...
+ def MergeFrom(self, other: Self): ...
def InvalidateIterators(self) -> None: ...
def GetEntryClass(self) -> GeneratedProtocolMessageType: ...
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 ce74e9318c6..94ed7f61536 100644
--- a/contrib/python/types-protobuf/google-stubs/protobuf/internal/decoder.pyi
+++ b/contrib/python/types-protobuf/google-stubs/protobuf/internal/decoder.pyi
@@ -59,5 +59,3 @@ MESSAGE_SET_ITEM_TAG: bytes
def MessageSetItemDecoder(descriptor: Descriptor) -> _Decoder: ...
def MapDecoder(field_descriptor, new_default, is_message_map) -> _Decoder: ...
-
-SkipField: Any
diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/message.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/message.pyi
index 819ad7aad5d..ea1d636ee26 100644
--- a/contrib/python/types-protobuf/google-stubs/protobuf/message.pyi
+++ b/contrib/python/types-protobuf/google-stubs/protobuf/message.pyi
@@ -1,7 +1,9 @@
from collections.abc import Sequence
-from typing import Any, TypeVar
+from typing import Any
from typing_extensions import Self
+from google._upb._message import Descriptor as _upb_Descriptor
+
from .descriptor import Descriptor, FieldDescriptor
from .internal.extension_dict import _ExtensionDict, _ExtensionFieldDescriptor
@@ -9,10 +11,8 @@ class Error(Exception): ...
class DecodeError(Error): ...
class EncodeError(Error): ...
-_M = TypeVar("_M", bound=Message) # message type (of self)
-
class Message:
- DESCRIPTOR: Descriptor
+ DESCRIPTOR: Descriptor | _upb_Descriptor
def __deepcopy__(self, memo: Any = None) -> Self: ...
def __eq__(self, other_msg): ...
def __ne__(self, other_msg): ...
@@ -26,12 +26,11 @@ class Message:
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: ...
- def ClearExtension(self: _M, field_descriptor: _ExtensionFieldDescriptor[_M, Any]) -> None: ...
+ def HasExtension(self, field_descriptor: _ExtensionFieldDescriptor[Self, Any]) -> bool: ...
+ def ClearExtension(self, field_descriptor: _ExtensionFieldDescriptor[Self, Any]) -> None: ...
# The TypeVar must be bound to `Message` or we get mypy errors, so we cannot use `Self` for `Extensions`
@property
- def Extensions(self: _M) -> _ExtensionDict[_M]: ...
+ def Extensions(self) -> _ExtensionDict[Self]: ...
def ByteSize(self) -> int: ...
@classmethod
def FromString(cls, s: bytes) -> Self: ...
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 518e1251955..6422284aaad 100644
--- a/contrib/python/types-protobuf/google-stubs/protobuf/message_factory.pyi
+++ b/contrib/python/types-protobuf/google-stubs/protobuf/message_factory.pyi
@@ -9,8 +9,6 @@ from google.protobuf.message import Message
class MessageFactory:
pool: Any
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]]: ...
diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/reflection.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/reflection.pyi
index 5f7822363b1..2836b3fcf11 100644
--- a/contrib/python/types-protobuf/google-stubs/protobuf/reflection.pyi
+++ b/contrib/python/types-protobuf/google-stubs/protobuf/reflection.pyi
@@ -1,5 +1,2 @@
class GeneratedProtocolMessageType(type):
def __new__(cls, name, bases, dictionary): ...
-
-def ParseMessage(descriptor, byte_str): ...
-def MakeClass(descriptor): ...
diff --git a/contrib/python/types-protobuf/google-stubs/protobuf/service.pyi b/contrib/python/types-protobuf/google-stubs/protobuf/service.pyi
deleted file mode 100644
index 1123b6134dd..00000000000
--- a/contrib/python/types-protobuf/google-stubs/protobuf/service.pyi
+++ /dev/null
@@ -1,39 +0,0 @@
-from collections.abc import Callable
-from concurrent.futures import Future
-
-from google.protobuf.descriptor import MethodDescriptor, ServiceDescriptor
-from google.protobuf.message import Message
-
-class RpcException(Exception): ...
-
-class Service:
- @staticmethod
- def GetDescriptor() -> ServiceDescriptor: ...
- def CallMethod(
- self,
- method_descriptor: MethodDescriptor,
- rpc_controller: RpcController,
- request: Message,
- done: Callable[[Message], None] | None,
- ) -> Future[Message] | None: ...
- def GetRequestClass(self, method_descriptor: MethodDescriptor) -> type[Message]: ...
- def GetResponseClass(self, method_descriptor: MethodDescriptor) -> type[Message]: ...
-
-class RpcController:
- def Reset(self) -> None: ...
- def Failed(self) -> bool: ...
- def ErrorText(self) -> str | None: ...
- def StartCancel(self) -> None: ...
- def SetFailed(self, reason: str) -> None: ...
- def IsCanceled(self) -> bool: ...
- def NotifyOnCancel(self, callback: Callable[[], None]) -> None: ...
-
-class RpcChannel:
- def CallMethod(
- self,
- method_descriptor: MethodDescriptor,
- rpc_controller: RpcController,
- request: Message,
- response_class: type[Message],
- done: Callable[[Message], None] | None,
- ) -> Future[Message] | None: ...
diff --git a/contrib/python/types-protobuf/ya.make b/contrib/python/types-protobuf/ya.make
index 8820e5adf69..e93e7b16e84 100644
--- a/contrib/python/types-protobuf/ya.make
+++ b/contrib/python/types-protobuf/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(5.29.1.20250315)
+VERSION(6.30.2.20250506)
LICENSE(Apache-2.0)
@@ -10,9 +10,11 @@ NO_LINT()
PY_SRCS(
TOP_LEVEL
+ google-stubs/_upb/_message.pyi
google-stubs/protobuf/__init__.pyi
google-stubs/protobuf/compiler/__init__.pyi
google-stubs/protobuf/descriptor.pyi
+ google-stubs/protobuf/descriptor_database.pyi
google-stubs/protobuf/descriptor_pool.pyi
google-stubs/protobuf/internal/__init__.pyi
google-stubs/protobuf/internal/api_implementation.pyi
@@ -32,7 +34,6 @@ PY_SRCS(
google-stubs/protobuf/message_factory.pyi
google-stubs/protobuf/reflection.pyi
google-stubs/protobuf/runtime_version.pyi
- google-stubs/protobuf/service.pyi
google-stubs/protobuf/symbol_database.pyi
google-stubs/protobuf/text_format.pyi
google-stubs/protobuf/util/__init__.pyi