Skip to content

Commit 60c4f51

Browse files
committed
new version of lib (v2) now awailable!
1 parent dd67656 commit 60c4f51

25 files changed

+714
-12
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
__pycache__/
33

44
.*/*
5-
.*/
5+
.*/
6+
.*

examples/__init__.py

Whitespace-only changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pydantic import BaseModel
2-
from simple_rpc_future import GrpcClient
2+
from simple_rpc import GrpcClient
33
import asyncio
44

55
class ResponceModel(BaseModel):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ResponceModel(BaseModel):
1212
proto_filename = "proto.proto"
1313
)
1414

15-
class Server:
15+
class Server:
1616
@app.grpc_method(out_proto_name="ResponceMsg")
1717
async def Method(self, num1) -> ResponceModel:
1818
return ResponceModel(

examples/v2/client_v2.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from pydantic import BaseModel
2+
from v2.client.grpc_client_auto import GrpcClient
3+
import asyncio
4+
import pathlib
5+
6+
client = GrpcClient(
7+
proto_dir_relpath=pathlib.Path("client_tmp"),
8+
port=50056
9+
)
10+
command = client.configure_command(
11+
functionName="example_method",
12+
className="Server"
13+
)
14+
15+
16+
async def run():
17+
print(
18+
await command()
19+
)
20+
21+
if __name__ == "__main__":
22+
asyncio.run(
23+
run()
24+
)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "simple-rpc"
7-
version = "0.0.2"
7+
version = "0.1.0"
88
description = "Simple framework to create your own gRPC server with grpcio"
99
authors = [
1010
{name = "NF-coder", email = "[email protected]"}
@@ -16,6 +16,6 @@ packages = [
1616
]
1717
requires-python = ">=3.9"
1818
dependencies = [
19-
"grpcio >= 1.71.0",
19+
"grpcio == 1.71.0",
2020
"pydantic >= 2.8.0",
2121
]

simple_rpc/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
from .grpc_server_reduced import GrpcServer
2-
from .grpc_client_reduced import GrpcClient
1+
from .v1.grpc_server_reduced import GrpcServer as GrpcServer
2+
from .v1.grpc_client_reduced import GrpcClient as GrpcClient
3+
4+
from .v2.grpc_server_auto import GrpcServer as GrpcServerV2
5+
from .v2.grpc_client_auto import GrpcClient as GrpcClientV2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(
5555
ip: str = "0.0.0.0",
5656
port: int = 50051
5757
) -> None:
58-
self.proto_pb2, self.proto_pb2_grpc = grpc.protos_and_services(proto_filename) # noqa
58+
self.proto_pb2, self.proto_pb2_grpc = grpc.protos_and_services(proto_filename) # type: ignore
5959
self.ip = ip
6060
self.port = port
6161

0 commit comments

Comments
 (0)