Skip to content

Commit 4d7046f

Browse files
committed
Update generated code after rebase
Signed-off-by: Aidan Jensen <aidandj.github@gmail.com>
1 parent 078307d commit 4d7046f

File tree

10 files changed

+117
-19
lines changed

10 files changed

+117
-19
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ line-length = 10000
1313
[tool.isort]
1414
profile = "black"
1515
skip_gitignore = true
16-
extend_skip_glob = ["*_pb2.py", "*_pb2_grpc.py"]
16+
extend_skip_glob = ["*_pb2.py"]
1717

1818
[tool.mypy]
1919
strict = true

test/generated_async_only/testproto/grpc/dummy_pb2.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ class DeprecatedRequest(google.protobuf.message.Message):
5959
DESCRIPTOR: google.protobuf.descriptor.Descriptor
6060

6161
OLD_FIELD_FIELD_NUMBER: builtins.int
62-
old_field: builtins.str
62+
@property
63+
@deprecated("""This field has been marked as deprecated using proto field options.""")
64+
def old_field(self) -> builtins.str: ...
65+
@old_field.setter
66+
@deprecated("""This field has been marked as deprecated using proto field options.""")
67+
def old_field(self, value: builtins.str) -> None: ...
6368
def __init__(
6469
self,
6570
*,

test/generated_async_only/testproto/grpc/dummy_pb2_grpc.pyi

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,17 @@ class DeprecatedServiceStub:
7575
"""Marking the service as deprecated"""
7676

7777
def __init__(self, channel: grpc.aio.Channel) -> None: ...
78-
DeprecatedMethod: grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]
79-
"""DeprecatedMethod"""
80-
DeprecatedMethodNotDeprecatedRequest: grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply]
81-
"""DeprecatedMethodNotDeprecatedRequest"""
78+
@property
79+
@deprecated("""This method has been marked as deprecated using proto method options.""")
80+
def DeprecatedMethod(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]:
81+
"""DeprecatedMethod"""
82+
@property
83+
@deprecated("""Method is deprecated, but request message is not""")
84+
def DeprecatedMethodNotDeprecatedRequest(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply]:
85+
"""DeprecatedMethodNotDeprecatedRequest"""
86+
@property
87+
@deprecated("""This method has been marked as deprecated using proto method options.""")
88+
def DeprecatedMethodNoComments(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: ...
8289

8390
@deprecated("""This service is deprecated""")
8491
class DeprecatedServiceServicer(metaclass=abc.ABCMeta):
@@ -100,6 +107,13 @@ class DeprecatedServiceServicer(metaclass=abc.ABCMeta):
100107
) -> collections.abc.Awaitable[testproto.grpc.dummy_pb2.DummyReply]:
101108
"""DeprecatedMethodNotDeprecatedRequest"""
102109

110+
@abc.abstractmethod
111+
def DeprecatedMethodNoComments(
112+
self,
113+
request: testproto.grpc.dummy_pb2.DeprecatedRequest,
114+
context: grpc.aio.ServicerContext[testproto.grpc.dummy_pb2.DeprecatedRequest, collections.abc.Awaitable[testproto.grpc.dummy_pb2.DummyReply]],
115+
) -> collections.abc.Awaitable[testproto.grpc.dummy_pb2.DummyReply]: ...
116+
103117
@deprecated("""This service is deprecated""")
104118
def add_DeprecatedServiceServicer_to_server(servicer: DeprecatedServiceServicer, server: grpc.aio.Server) -> None: ...
105119

test/generated_async_only/testproto/test_pb2.pyi

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,22 @@ class _DeprecatedEnum:
7777

7878
class _DeprecatedEnumEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DeprecatedEnum.ValueType], builtins.type):
7979
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
80-
DEPRECATED_ONE: _DeprecatedEnum.ValueType # 1
81-
DEPRECATED_TWO: _DeprecatedEnum.ValueType # 2
80+
@property
81+
@deprecated("""This enum value has been marked as deprecated using proto enum value options.""")
82+
def DEPRECATED_ONE(self) -> _DeprecatedEnum.ValueType: # 1
83+
"""Trailing comment for enum value"""
84+
@property
85+
@deprecated("""This enum value has been marked as deprecated using proto enum value options.""")
86+
def DEPRECATED_TWO(self) -> _DeprecatedEnum.ValueType: ... # 2
87+
NOT_DEPRECATED: _DeprecatedEnum.ValueType # 3
8288

8389
@deprecated("""This enum is deprecated\n2 lines of comments\n"Quotes in comments"\nand 'single quotes'\nTrailing comment""")
8490
class DeprecatedEnum(_DeprecatedEnum, metaclass=_DeprecatedEnumEnumTypeWrapper): ...
8591

8692
DEPRECATED_ONE: DeprecatedEnum.ValueType # 1
93+
"""Trailing comment for enum value"""
8794
DEPRECATED_TWO: DeprecatedEnum.ValueType # 2
95+
NOT_DEPRECATED: DeprecatedEnum.ValueType # 3
8896
Global___DeprecatedEnum: typing_extensions.TypeAlias = DeprecatedEnum
8997

9098
@typing.final
@@ -432,15 +440,35 @@ class DeprecatedMessage(google.protobuf.message.Message):
432440
DESCRIPTOR: google.protobuf.descriptor.Descriptor
433441

434442
A_STRING_FIELD_NUMBER: builtins.int
443+
DEPRECATED_FIELD_FIELD_NUMBER: builtins.int
444+
DEPRECATED_FIELD_WITH_COMMENT_FIELD_NUMBER: builtins.int
435445
a_string: builtins.str
446+
@property
447+
@deprecated("""This field has been marked as deprecated using proto field options.""")
448+
def deprecated_field(self) -> builtins.str: ...
449+
@deprecated_field.setter
450+
@deprecated("""This field has been marked as deprecated using proto field options.""")
451+
def deprecated_field(self, value: builtins.str) -> None: ...
452+
@property
453+
@deprecated("""This field has been marked as deprecated using proto field options.""")
454+
def deprecated_field_with_comment(self) -> builtins.str:
455+
"""This field is deprecated with comment"""
456+
457+
@deprecated_field_with_comment.setter
458+
@deprecated("""This field has been marked as deprecated using proto field options.""")
459+
def deprecated_field_with_comment(self, value: builtins.str) -> None:
460+
"""This field is deprecated with comment"""
461+
436462
def __init__(
437463
self,
438464
*,
439465
a_string: builtins.str | None = ...,
466+
deprecated_field: builtins.str | None = ...,
467+
deprecated_field_with_comment: builtins.str | None = ...,
440468
) -> None: ...
441-
_HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"]
469+
_HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"]
442470
def HasField(self, field_name: _HasFieldArgType) -> builtins.bool: ...
443-
_ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"]
471+
_ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"]
444472
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
445473

446474
Global___DeprecatedMessage: typing_extensions.TypeAlias = DeprecatedMessage

test/generated_sync_only/testproto/grpc/dummy_pb2.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ class DeprecatedRequest(google.protobuf.message.Message):
5959
DESCRIPTOR: google.protobuf.descriptor.Descriptor
6060

6161
OLD_FIELD_FIELD_NUMBER: builtins.int
62-
old_field: builtins.str
62+
@property
63+
@deprecated("""This field has been marked as deprecated using proto field options.""")
64+
def old_field(self) -> builtins.str: ...
65+
@old_field.setter
66+
@deprecated("""This field has been marked as deprecated using proto field options.""")
67+
def old_field(self, value: builtins.str) -> None: ...
6368
def __init__(
6469
self,
6570
*,

test/generated_sync_only/testproto/grpc/dummy_pb2_grpc.pyi

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ https://github.com/vmagamedov/grpclib/blob/master/tests/dummy.proto"""
66
import abc
77
import collections.abc
88
import grpc
9+
import grpc.aio
910
import sys
1011
import testproto.grpc.dummy_pb2
1112
import typing
@@ -74,10 +75,17 @@ class DeprecatedServiceStub:
7475
"""Marking the service as deprecated"""
7576

7677
def __init__(self, channel: grpc.Channel) -> None: ...
77-
DeprecatedMethod: grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]
78-
"""DeprecatedMethod"""
79-
DeprecatedMethodNotDeprecatedRequest: grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply]
80-
"""DeprecatedMethodNotDeprecatedRequest"""
78+
@property
79+
@deprecated("""This method has been marked as deprecated using proto method options.""")
80+
def DeprecatedMethod(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]:
81+
"""DeprecatedMethod"""
82+
@property
83+
@deprecated("""Method is deprecated, but request message is not""")
84+
def DeprecatedMethodNotDeprecatedRequest(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply]:
85+
"""DeprecatedMethodNotDeprecatedRequest"""
86+
@property
87+
@deprecated("""This method has been marked as deprecated using proto method options.""")
88+
def DeprecatedMethodNoComments(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: ...
8189

8290
@deprecated("""This service is deprecated""")
8391
class DeprecatedServiceServicer(metaclass=abc.ABCMeta):
@@ -99,6 +107,13 @@ class DeprecatedServiceServicer(metaclass=abc.ABCMeta):
99107
) -> testproto.grpc.dummy_pb2.DummyReply:
100108
"""DeprecatedMethodNotDeprecatedRequest"""
101109

110+
@abc.abstractmethod
111+
def DeprecatedMethodNoComments(
112+
self,
113+
request: testproto.grpc.dummy_pb2.DeprecatedRequest,
114+
context: grpc.ServicerContext,
115+
) -> testproto.grpc.dummy_pb2.DummyReply: ...
116+
102117
@deprecated("""This service is deprecated""")
103118
def add_DeprecatedServiceServicer_to_server(servicer: DeprecatedServiceServicer, server: grpc.Server) -> None: ...
104119

test/generated_sync_only/testproto/grpc/import_pb2_grpc.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import abc
77
import collections.abc
88
import google.protobuf.empty_pb2
99
import grpc
10+
import grpc.aio
1011
import testproto.test_pb2
1112
import typing
1213

test/generated_sync_only/testproto/test_no_generic_services_pb2_grpc.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ isort:skip_file
66
import abc
77
import collections.abc
88
import grpc
9+
import grpc.aio
910
import testproto.test_no_generic_services_pb2
1011
import typing
1112

test/generated_sync_only/testproto/test_pb2.pyi

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,22 @@ class _DeprecatedEnum:
7777

7878
class _DeprecatedEnumEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DeprecatedEnum.ValueType], builtins.type):
7979
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
80-
DEPRECATED_ONE: _DeprecatedEnum.ValueType # 1
81-
DEPRECATED_TWO: _DeprecatedEnum.ValueType # 2
80+
@property
81+
@deprecated("""This enum value has been marked as deprecated using proto enum value options.""")
82+
def DEPRECATED_ONE(self) -> _DeprecatedEnum.ValueType: # 1
83+
"""Trailing comment for enum value"""
84+
@property
85+
@deprecated("""This enum value has been marked as deprecated using proto enum value options.""")
86+
def DEPRECATED_TWO(self) -> _DeprecatedEnum.ValueType: ... # 2
87+
NOT_DEPRECATED: _DeprecatedEnum.ValueType # 3
8288

8389
@deprecated("""This enum is deprecated\n2 lines of comments\n"Quotes in comments"\nand 'single quotes'\nTrailing comment""")
8490
class DeprecatedEnum(_DeprecatedEnum, metaclass=_DeprecatedEnumEnumTypeWrapper): ...
8591

8692
DEPRECATED_ONE: DeprecatedEnum.ValueType # 1
93+
"""Trailing comment for enum value"""
8794
DEPRECATED_TWO: DeprecatedEnum.ValueType # 2
95+
NOT_DEPRECATED: DeprecatedEnum.ValueType # 3
8896
Global___DeprecatedEnum: typing_extensions.TypeAlias = DeprecatedEnum
8997

9098
@typing.final
@@ -432,15 +440,35 @@ class DeprecatedMessage(google.protobuf.message.Message):
432440
DESCRIPTOR: google.protobuf.descriptor.Descriptor
433441

434442
A_STRING_FIELD_NUMBER: builtins.int
443+
DEPRECATED_FIELD_FIELD_NUMBER: builtins.int
444+
DEPRECATED_FIELD_WITH_COMMENT_FIELD_NUMBER: builtins.int
435445
a_string: builtins.str
446+
@property
447+
@deprecated("""This field has been marked as deprecated using proto field options.""")
448+
def deprecated_field(self) -> builtins.str: ...
449+
@deprecated_field.setter
450+
@deprecated("""This field has been marked as deprecated using proto field options.""")
451+
def deprecated_field(self, value: builtins.str) -> None: ...
452+
@property
453+
@deprecated("""This field has been marked as deprecated using proto field options.""")
454+
def deprecated_field_with_comment(self) -> builtins.str:
455+
"""This field is deprecated with comment"""
456+
457+
@deprecated_field_with_comment.setter
458+
@deprecated("""This field has been marked as deprecated using proto field options.""")
459+
def deprecated_field_with_comment(self, value: builtins.str) -> None:
460+
"""This field is deprecated with comment"""
461+
436462
def __init__(
437463
self,
438464
*,
439465
a_string: builtins.str | None = ...,
466+
deprecated_field: builtins.str | None = ...,
467+
deprecated_field_with_comment: builtins.str | None = ...,
440468
) -> None: ...
441-
_HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"]
469+
_HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"]
442470
def HasField(self, field_name: _HasFieldArgType) -> builtins.bool: ...
443-
_ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"]
471+
_ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"]
444472
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
445473

446474
Global___DeprecatedMessage: typing_extensions.TypeAlias = DeprecatedMessage

test/generated_sync_only/testproto/test_pb2_grpc.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Proto 2 test file."""
66
import abc
77
import collections.abc
88
import grpc
9+
import grpc.aio
910
import testproto.test_pb2
1011
import typing
1112

0 commit comments

Comments
 (0)