Rename to avoid name clash

This commit is contained in:
Luke Murphy
2020-08-09 04:05:14 +02:00
parent 1f61e86cba
commit 7bc28206a8
5 changed files with 13 additions and 14 deletions

1
hyper_rpc/__init__.py Normal file
View File

@ -0,0 +1 @@
"""hrpc module."""

24
hyper_rpc/hrpc.py Normal file
View File

@ -0,0 +1,24 @@
"""Simple RPC with Protobuf Services."""
from argparse import ArgumentParser, FileType
from shlex import split
from subprocess import run
def main():
"""Command-line entrypoint."""
parser = ArgumentParser(description="Generate hrpc service and stubs")
parser.add_argument("protobuf", type=FileType("r"), help="protobuf file")
args = parser.parse_args()
generate(args)
def generate(args):
"""Generate services and stubs."""
cmd = (
"python -m grpc_tools.protoc "
"--purerpc_out=. "
"--python_out=. "
"-I. "
f"{args.protobuf.name}"
)
run(split(cmd))