Skip to content

Commit 03ea8a9

Browse files
committed
hitfix: now librarry working stable
1 parent 6e64cdb commit 03ea8a9

File tree

21 files changed

+99
-107
lines changed

21 files changed

+99
-107
lines changed

examples/v2/client_v2.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from pydantic import BaseModel
2-
from simple_rpc import GrpcClientV2
2+
from simple_rpc.v2.client import GrpcClientV2
33
import asyncio
44
import pathlib
55

66
client = GrpcClientV2(
7-
proto_dir_relpath=pathlib.Path("client_tmp"),
8-
port=50056
7+
port=50051
98
)
109
command = client.configure_command(
1110
functionName="example_method",

examples/v2/server_v2.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from simple_rpc import GrpcServerV2
1+
from simple_rpc.v2.server import GrpcServerV2
22
from pydantic import BaseModel
33
import pathlib
44

@@ -21,7 +21,6 @@ async def example_method(self, request: RequestModel) -> ResponceModel:
2121

2222
app.configure_service(
2323
cls=Server(),
24-
port=50056,
25-
proto_dir_relpath=pathlib.Path("server_tmp")
24+
port=50051
2625
)
2726
app.run()

simple_rpc/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
from .v1.grpc_server_reduced import GrpcServer as GrpcServer
2-
from .v1.grpc_client_reduced import GrpcClient as GrpcClient
3-
4-
from .v2.server.grpc_server_auto import GrpcServer as GrpcServerV2
5-
from .v2.client.grpc_client_auto import GrpcClient as GrpcClientV2
2+
from .v1.grpc_client_reduced import GrpcClient as GrpcClient

simple_rpc/v1/__

Whitespace-only changes.

simple_rpc/v2/client/SOT/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
python -m grpc_tools.protoc --proto_path=. --python_out=. --pyi_out=. --grpc_python_out=. sot.proto

simple_rpc/v2/client/SOT/proto/sot.proto

Lines changed: 0 additions & 10 deletions
This file was deleted.

simple_rpc/v2/client/SOT/sot.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
syntax = "proto3";
2+
3+
service SOTServer {
4+
rpc get_active_proto(get_active_protoRquest) returns (get_active_protoResponce) {}
5+
}
6+
message get_active_protoResponce {
7+
string proto = 1;
8+
}
9+
message get_active_protoRquest {
10+
}
Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

simple_rpc/v2/client/SOT/proto/sot_pb2.pyi renamed to simple_rpc/v2/client/SOT/sot_pb2.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ from typing import ClassVar as _ClassVar, Optional as _Optional
44

55
DESCRIPTOR: _descriptor.FileDescriptor
66

7-
class get_protoResponce(_message.Message):
7+
class get_active_protoResponce(_message.Message):
88
__slots__ = ("proto",)
99
PROTO_FIELD_NUMBER: _ClassVar[int]
1010
proto: str
1111
def __init__(self, proto: _Optional[str] = ...) -> None: ...
1212

13-
class get_protoRquest(_message.Message):
13+
class get_active_protoRquest(_message.Message):
1414
__slots__ = ()
1515
def __init__(self) -> None: ...

simple_rpc/v2/client/SOT/proto/sot_pb2_grpc.py renamed to simple_rpc/v2/client/SOT/sot_pb2_grpc.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2+
# Edited by NF-coder
23
"""Client and server classes corresponding to protobuf-defined services."""
34
import grpc
45
import warnings
56

6-
from . import sot_pb2 as sot__pb2
7+
from . import sot_pb2 as sot__pb2 # modified line
78

89
GRPC_GENERATED_VERSION = '1.71.0'
910
GRPC_VERSION = grpc.__version__
@@ -25,7 +26,7 @@
2526
)
2627

2728

28-
class SOTStub(object):
29+
class SOTServerStub(object):
2930
"""Missing associated documentation comment in .proto file."""
3031

3132
def __init__(self, channel):
@@ -34,43 +35,43 @@ def __init__(self, channel):
3435
Args:
3536
channel: A grpc.Channel.
3637
"""
37-
self.get_proto = channel.unary_unary(
38-
'/SOT/get_proto',
39-
request_serializer=sot__pb2.get_protoRquest.SerializeToString,
40-
response_deserializer=sot__pb2.get_protoResponce.FromString,
38+
self.get_active_proto = channel.unary_unary(
39+
'/SOTServer/get_active_proto',
40+
request_serializer=sot__pb2.get_active_protoRquest.SerializeToString,
41+
response_deserializer=sot__pb2.get_active_protoResponce.FromString,
4142
_registered_method=True)
4243

4344

44-
class SOTServicer(object):
45+
class SOTServerServicer(object):
4546
"""Missing associated documentation comment in .proto file."""
4647

47-
def get_proto(self, request, context):
48+
def get_active_proto(self, request, context):
4849
"""Missing associated documentation comment in .proto file."""
4950
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
5051
context.set_details('Method not implemented!')
5152
raise NotImplementedError('Method not implemented!')
5253

5354

54-
def add_SOTServicer_to_server(servicer, server):
55+
def add_SOTServerServicer_to_server(servicer, server):
5556
rpc_method_handlers = {
56-
'get_proto': grpc.unary_unary_rpc_method_handler(
57-
servicer.get_proto,
58-
request_deserializer=sot__pb2.get_protoRquest.FromString,
59-
response_serializer=sot__pb2.get_protoResponce.SerializeToString,
57+
'get_active_proto': grpc.unary_unary_rpc_method_handler(
58+
servicer.get_active_proto,
59+
request_deserializer=sot__pb2.get_active_protoRquest.FromString,
60+
response_serializer=sot__pb2.get_active_protoResponce.SerializeToString,
6061
),
6162
}
6263
generic_handler = grpc.method_handlers_generic_handler(
63-
'SOT', rpc_method_handlers)
64+
'SOTServer', rpc_method_handlers)
6465
server.add_generic_rpc_handlers((generic_handler,))
65-
server.add_registered_method_handlers('SOT', rpc_method_handlers)
66+
server.add_registered_method_handlers('SOTServer', rpc_method_handlers)
6667

6768

6869
# This class is part of an EXPERIMENTAL API.
69-
class SOT(object):
70+
class SOTServer(object):
7071
"""Missing associated documentation comment in .proto file."""
7172

7273
@staticmethod
73-
def get_proto(request,
74+
def get_active_proto(request,
7475
target,
7576
options=(),
7677
channel_credentials=None,
@@ -83,9 +84,9 @@ def get_proto(request,
8384
return grpc.experimental.unary_unary( # type: ignore
8485
request,
8586
target,
86-
'/SOT/get_proto',
87-
sot__pb2.get_protoRquest.SerializeToString,
88-
sot__pb2.get_protoResponce.FromString,
87+
'/SOTServer/get_active_proto',
88+
sot__pb2.get_active_protoRquest.SerializeToString,
89+
sot__pb2.get_active_protoResponce.FromString,
8990
options,
9091
channel_credentials,
9192
insecure,

0 commit comments

Comments
 (0)