Skip to content

Commit 4f7cebc

Browse files
run black
1 parent 3298f4b commit 4f7cebc

File tree

14 files changed

+223
-190
lines changed

14 files changed

+223
-190
lines changed

test/async_only/test_async_only.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
"""
1111

1212
from typing import Awaitable
13+
1314
import grpc.aio
14-
from testproto.grpc import dummy_pb2_grpc, dummy_pb2
15+
from testproto.grpc import dummy_pb2, dummy_pb2_grpc
1516

1617

1718
class AsyncOnlyServicer(dummy_pb2_grpc.DummyServiceServicer):

test/generated/testproto/grpc/dummy_pb2_grpc.pyi

Lines changed: 70 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type:
3131
GRPC_GENERATED_VERSION: str
3232
GRPC_VERSION: str
3333
_DummyServiceUnaryUnaryType = typing_extensions.TypeVar(
34-
'_DummyServiceUnaryUnaryType',
34+
"_DummyServiceUnaryUnaryType",
3535
grpc.UnaryUnaryMultiCallable[
3636
testproto.grpc.dummy_pb2.DummyRequest,
3737
testproto.grpc.dummy_pb2.DummyReply,
@@ -47,7 +47,7 @@ _DummyServiceUnaryUnaryType = typing_extensions.TypeVar(
4747
)
4848

4949
_DummyServiceUnaryStreamType = typing_extensions.TypeVar(
50-
'_DummyServiceUnaryStreamType',
50+
"_DummyServiceUnaryStreamType",
5151
grpc.UnaryStreamMultiCallable[
5252
testproto.grpc.dummy_pb2.DummyRequest,
5353
testproto.grpc.dummy_pb2.DummyReply,
@@ -63,7 +63,7 @@ _DummyServiceUnaryStreamType = typing_extensions.TypeVar(
6363
)
6464

6565
_DummyServiceStreamUnaryType = typing_extensions.TypeVar(
66-
'_DummyServiceStreamUnaryType',
66+
"_DummyServiceStreamUnaryType",
6767
grpc.StreamUnaryMultiCallable[
6868
testproto.grpc.dummy_pb2.DummyRequest,
6969
testproto.grpc.dummy_pb2.DummyReply,
@@ -79,7 +79,7 @@ _DummyServiceStreamUnaryType = typing_extensions.TypeVar(
7979
)
8080

8181
_DummyServiceStreamStreamType = typing_extensions.TypeVar(
82-
'_DummyServiceStreamStreamType',
82+
"_DummyServiceStreamStreamType",
8383
grpc.StreamStreamMultiCallable[
8484
testproto.grpc.dummy_pb2.DummyRequest,
8585
testproto.grpc.dummy_pb2.DummyReply,
@@ -98,44 +98,49 @@ class DummyServiceStub(typing.Generic[_DummyServiceUnaryUnaryType, _DummyService
9898
"""DummyService"""
9999

100100
@typing.overload
101-
def __init__(self: DummyServiceStub[
102-
grpc.UnaryUnaryMultiCallable[
103-
testproto.grpc.dummy_pb2.DummyRequest,
104-
testproto.grpc.dummy_pb2.DummyReply,
101+
def __init__(
102+
self: DummyServiceStub[
103+
grpc.UnaryUnaryMultiCallable[
104+
testproto.grpc.dummy_pb2.DummyRequest,
105+
testproto.grpc.dummy_pb2.DummyReply,
106+
],
107+
grpc.UnaryStreamMultiCallable[
108+
testproto.grpc.dummy_pb2.DummyRequest,
109+
testproto.grpc.dummy_pb2.DummyReply,
110+
],
111+
grpc.StreamUnaryMultiCallable[
112+
testproto.grpc.dummy_pb2.DummyRequest,
113+
testproto.grpc.dummy_pb2.DummyReply,
114+
],
115+
grpc.StreamStreamMultiCallable[
116+
testproto.grpc.dummy_pb2.DummyRequest,
117+
testproto.grpc.dummy_pb2.DummyReply,
118+
],
105119
],
106-
grpc.UnaryStreamMultiCallable[
107-
testproto.grpc.dummy_pb2.DummyRequest,
108-
testproto.grpc.dummy_pb2.DummyReply,
109-
],
110-
grpc.StreamUnaryMultiCallable[
111-
testproto.grpc.dummy_pb2.DummyRequest,
112-
testproto.grpc.dummy_pb2.DummyReply,
113-
],
114-
grpc.StreamStreamMultiCallable[
115-
testproto.grpc.dummy_pb2.DummyRequest,
116-
testproto.grpc.dummy_pb2.DummyReply,
117-
],
118-
], channel: grpc.Channel) -> None: ...
119-
120+
channel: grpc.Channel,
121+
) -> None: ...
120122
@typing.overload
121-
def __init__(self: DummyServiceStub[
122-
grpc.aio.UnaryUnaryMultiCallable[
123-
testproto.grpc.dummy_pb2.DummyRequest,
124-
testproto.grpc.dummy_pb2.DummyReply,
125-
],
126-
grpc.aio.UnaryStreamMultiCallable[
127-
testproto.grpc.dummy_pb2.DummyRequest,
128-
testproto.grpc.dummy_pb2.DummyReply,
123+
def __init__(
124+
self: DummyServiceStub[
125+
grpc.aio.UnaryUnaryMultiCallable[
126+
testproto.grpc.dummy_pb2.DummyRequest,
127+
testproto.grpc.dummy_pb2.DummyReply,
128+
],
129+
grpc.aio.UnaryStreamMultiCallable[
130+
testproto.grpc.dummy_pb2.DummyRequest,
131+
testproto.grpc.dummy_pb2.DummyReply,
132+
],
133+
grpc.aio.StreamUnaryMultiCallable[
134+
testproto.grpc.dummy_pb2.DummyRequest,
135+
testproto.grpc.dummy_pb2.DummyReply,
136+
],
137+
grpc.aio.StreamStreamMultiCallable[
138+
testproto.grpc.dummy_pb2.DummyRequest,
139+
testproto.grpc.dummy_pb2.DummyReply,
140+
],
129141
],
130-
grpc.aio.StreamUnaryMultiCallable[
131-
testproto.grpc.dummy_pb2.DummyRequest,
132-
testproto.grpc.dummy_pb2.DummyReply,
133-
],
134-
grpc.aio.StreamStreamMultiCallable[
135-
testproto.grpc.dummy_pb2.DummyRequest,
136-
testproto.grpc.dummy_pb2.DummyReply,
137-
],
138-
], channel: grpc.aio.Channel) -> None: ...
142+
channel: grpc.aio.Channel,
143+
) -> None: ...
139144

140145
UnaryUnary: _DummyServiceUnaryUnaryType
141146
"""UnaryUnary"""
@@ -206,7 +211,7 @@ class DummyServiceServicer(metaclass=abc.ABCMeta):
206211
def add_DummyServiceServicer_to_server(servicer: DummyServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
207212

208213
_DeprecatedServiceDeprecatedMethodType = typing_extensions.TypeVar(
209-
'_DeprecatedServiceDeprecatedMethodType',
214+
"_DeprecatedServiceDeprecatedMethodType",
210215
grpc.UnaryUnaryMultiCallable[
211216
testproto.grpc.dummy_pb2.DeprecatedRequest,
212217
testproto.grpc.dummy_pb2.DummyReply,
@@ -222,7 +227,7 @@ _DeprecatedServiceDeprecatedMethodType = typing_extensions.TypeVar(
222227
)
223228

224229
_DeprecatedServiceDeprecatedMethodNotDeprecatedRequestType = typing_extensions.TypeVar(
225-
'_DeprecatedServiceDeprecatedMethodNotDeprecatedRequestType',
230+
"_DeprecatedServiceDeprecatedMethodNotDeprecatedRequestType",
226231
grpc.UnaryUnaryMultiCallable[
227232
testproto.grpc.dummy_pb2.DummyRequest,
228233
testproto.grpc.dummy_pb2.DummyReply,
@@ -242,28 +247,33 @@ class DeprecatedServiceStub(typing.Generic[_DeprecatedServiceDeprecatedMethodTyp
242247
"""Marking the service as deprecated"""
243248

244249
@typing.overload
245-
def __init__(self: DeprecatedServiceStub[
246-
grpc.UnaryUnaryMultiCallable[
247-
testproto.grpc.dummy_pb2.DeprecatedRequest,
248-
testproto.grpc.dummy_pb2.DummyReply,
249-
],
250-
grpc.UnaryUnaryMultiCallable[
251-
testproto.grpc.dummy_pb2.DummyRequest,
252-
testproto.grpc.dummy_pb2.DummyReply,
250+
def __init__(
251+
self: DeprecatedServiceStub[
252+
grpc.UnaryUnaryMultiCallable[
253+
testproto.grpc.dummy_pb2.DeprecatedRequest,
254+
testproto.grpc.dummy_pb2.DummyReply,
255+
],
256+
grpc.UnaryUnaryMultiCallable[
257+
testproto.grpc.dummy_pb2.DummyRequest,
258+
testproto.grpc.dummy_pb2.DummyReply,
259+
],
253260
],
254-
], channel: grpc.Channel) -> None: ...
255-
261+
channel: grpc.Channel,
262+
) -> None: ...
256263
@typing.overload
257-
def __init__(self: DeprecatedServiceStub[
258-
grpc.aio.UnaryUnaryMultiCallable[
259-
testproto.grpc.dummy_pb2.DeprecatedRequest,
260-
testproto.grpc.dummy_pb2.DummyReply,
261-
],
262-
grpc.aio.UnaryUnaryMultiCallable[
263-
testproto.grpc.dummy_pb2.DummyRequest,
264-
testproto.grpc.dummy_pb2.DummyReply,
264+
def __init__(
265+
self: DeprecatedServiceStub[
266+
grpc.aio.UnaryUnaryMultiCallable[
267+
testproto.grpc.dummy_pb2.DeprecatedRequest,
268+
testproto.grpc.dummy_pb2.DummyReply,
269+
],
270+
grpc.aio.UnaryUnaryMultiCallable[
271+
testproto.grpc.dummy_pb2.DummyRequest,
272+
testproto.grpc.dummy_pb2.DummyReply,
273+
],
265274
],
266-
], channel: grpc.aio.Channel) -> None: ...
275+
channel: grpc.aio.Channel,
276+
) -> None: ...
267277

268278
DeprecatedMethod: _DeprecatedServiceDeprecatedMethodType
269279
"""DeprecatedMethod"""

test/generated/testproto/grpc/import_pb2_grpc.pyi

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type:
2727
GRPC_GENERATED_VERSION: str
2828
GRPC_VERSION: str
2929
_SimpleServiceUnaryUnaryType = typing_extensions.TypeVar(
30-
'_SimpleServiceUnaryUnaryType',
30+
"_SimpleServiceUnaryUnaryType",
3131
grpc.UnaryUnaryMultiCallable[
3232
google.protobuf.empty_pb2.Empty,
3333
testproto.test_pb2.Simple1,
@@ -43,7 +43,7 @@ _SimpleServiceUnaryUnaryType = typing_extensions.TypeVar(
4343
)
4444

4545
_SimpleServiceUnaryStreamType = typing_extensions.TypeVar(
46-
'_SimpleServiceUnaryStreamType',
46+
"_SimpleServiceUnaryStreamType",
4747
grpc.UnaryUnaryMultiCallable[
4848
testproto.test_pb2.Simple1,
4949
google.protobuf.empty_pb2.Empty,
@@ -59,7 +59,7 @@ _SimpleServiceUnaryStreamType = typing_extensions.TypeVar(
5959
)
6060

6161
_SimpleServiceNoCommentType = typing_extensions.TypeVar(
62-
'_SimpleServiceNoCommentType',
62+
"_SimpleServiceNoCommentType",
6363
grpc.UnaryUnaryMultiCallable[
6464
testproto.test_pb2.Simple1,
6565
google.protobuf.empty_pb2.Empty,
@@ -78,36 +78,41 @@ class SimpleServiceStub(typing.Generic[_SimpleServiceUnaryUnaryType, _SimpleServ
7878
"""SimpleService"""
7979

8080
@typing.overload
81-
def __init__(self: SimpleServiceStub[
82-
grpc.UnaryUnaryMultiCallable[
83-
google.protobuf.empty_pb2.Empty,
84-
testproto.test_pb2.Simple1,
81+
def __init__(
82+
self: SimpleServiceStub[
83+
grpc.UnaryUnaryMultiCallable[
84+
google.protobuf.empty_pb2.Empty,
85+
testproto.test_pb2.Simple1,
86+
],
87+
grpc.UnaryUnaryMultiCallable[
88+
testproto.test_pb2.Simple1,
89+
google.protobuf.empty_pb2.Empty,
90+
],
91+
grpc.UnaryUnaryMultiCallable[
92+
testproto.test_pb2.Simple1,
93+
google.protobuf.empty_pb2.Empty,
94+
],
8595
],
86-
grpc.UnaryUnaryMultiCallable[
87-
testproto.test_pb2.Simple1,
88-
google.protobuf.empty_pb2.Empty,
89-
],
90-
grpc.UnaryUnaryMultiCallable[
91-
testproto.test_pb2.Simple1,
92-
google.protobuf.empty_pb2.Empty,
93-
],
94-
], channel: grpc.Channel) -> None: ...
95-
96+
channel: grpc.Channel,
97+
) -> None: ...
9698
@typing.overload
97-
def __init__(self: SimpleServiceStub[
98-
grpc.aio.UnaryUnaryMultiCallable[
99-
google.protobuf.empty_pb2.Empty,
100-
testproto.test_pb2.Simple1,
101-
],
102-
grpc.aio.UnaryUnaryMultiCallable[
103-
testproto.test_pb2.Simple1,
104-
google.protobuf.empty_pb2.Empty,
105-
],
106-
grpc.aio.UnaryUnaryMultiCallable[
107-
testproto.test_pb2.Simple1,
108-
google.protobuf.empty_pb2.Empty,
99+
def __init__(
100+
self: SimpleServiceStub[
101+
grpc.aio.UnaryUnaryMultiCallable[
102+
google.protobuf.empty_pb2.Empty,
103+
testproto.test_pb2.Simple1,
104+
],
105+
grpc.aio.UnaryUnaryMultiCallable[
106+
testproto.test_pb2.Simple1,
107+
google.protobuf.empty_pb2.Empty,
108+
],
109+
grpc.aio.UnaryUnaryMultiCallable[
110+
testproto.test_pb2.Simple1,
111+
google.protobuf.empty_pb2.Empty,
112+
],
109113
],
110-
], channel: grpc.aio.Channel) -> None: ...
114+
channel: grpc.aio.Channel,
115+
) -> None: ...
111116

112117
UnaryUnary: _SimpleServiceUnaryUnaryType
113118
"""UnaryUnary"""

test/generated_async_only/testproto/grpc/dummy_pb2_grpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
22
"""Client and server classes corresponding to protobuf-defined services."""
3-
import grpc
43
import warnings
54

5+
import grpc
66
from testproto.grpc import dummy_pb2 as testproto_dot_grpc_dot_dummy__pb2
77

88
GRPC_GENERATED_VERSION = '1.76.0'

test/generated_async_only/testproto/grpc/dummy_pb2_grpc.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ if sys.version_info >= (3, 13):
2020
else:
2121
from typing_extensions import deprecated
2222

23-
2423
GRPC_GENERATED_VERSION: str
2524
GRPC_VERSION: str
2625
_DummyServiceUnaryUnaryType: typing_extensions.TypeAlias = grpc.aio.UnaryUnaryMultiCallable[
@@ -39,6 +38,7 @@ _DummyServiceStreamStreamType: typing_extensions.TypeAlias = grpc.aio.StreamStre
3938
testproto.grpc.dummy_pb2.DummyRequest,
4039
testproto.grpc.dummy_pb2.DummyReply,
4140
]
41+
4242
class DummyServiceStub:
4343
"""DummyService"""
4444

@@ -101,6 +101,7 @@ _DeprecatedServiceDeprecatedMethodNotDeprecatedRequestType: typing_extensions.Ty
101101
testproto.grpc.dummy_pb2.DummyRequest,
102102
testproto.grpc.dummy_pb2.DummyReply,
103103
]
104+
104105
@deprecated("""This service is deprecated""")
105106
class DeprecatedServiceStub:
106107
"""Marking the service as deprecated"""

test/generated_async_only/testproto/grpc/import_pb2_grpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
22
"""Client and server classes corresponding to protobuf-defined services."""
3-
import grpc
43
import warnings
54

5+
import grpc
66
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
77
from testproto import test_pb2 as testproto_dot_test__pb2
88

test/generated_async_only/testproto/grpc/import_pb2_grpc.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ if sys.version_info >= (3, 10):
1616
else:
1717
import typing_extensions
1818

19-
2019
GRPC_GENERATED_VERSION: str
2120
GRPC_VERSION: str
2221
_SimpleServiceUnaryUnaryType: typing_extensions.TypeAlias = grpc.aio.UnaryUnaryMultiCallable[
@@ -31,6 +30,7 @@ _SimpleServiceNoCommentType: typing_extensions.TypeAlias = grpc.aio.UnaryUnaryMu
3130
testproto.test_pb2.Simple1,
3231
google.protobuf.empty_pb2.Empty,
3332
]
33+
3434
class SimpleServiceStub:
3535
"""SimpleService"""
3636

0 commit comments

Comments
 (0)