diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e93f27..537f756 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# hyperspace-rpc 0.0.1a3 (2020-08-10) + +- Fix import paths and add import re-writer + # hyperspace-rpc 0.0.1a2 (2020-08-09) - Add missing hrpc.proto generate service and stub files diff --git a/hyperspace_rpc/hrpc_grpc.py b/hyperspace_rpc/hrpc_grpc.py index 36738e7..ed16d69 100644 --- a/hyperspace_rpc/hrpc_grpc.py +++ b/hyperspace_rpc/hrpc_grpc.py @@ -1,3 +1,3 @@ import google.protobuf.descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 -import hrpc_pb2 as hrpc__pb2 +from . import hrpc_pb2 as hrpc__pb2 import purerpc diff --git a/hyperspace_rpc/schema_grpc.py b/hyperspace_rpc/schema_grpc.py index 32d2488..8bd1841 100644 --- a/hyperspace_rpc/schema_grpc.py +++ b/hyperspace_rpc/schema_grpc.py @@ -1,7 +1,7 @@ -import hrpc_pb2 as hrpc__pb2 +from . import hrpc_pb2 as hrpc__pb2 import purerpc -import schema_pb2 as schema__pb2 +from . import schema_pb2 as schema__pb2 class HyperspaceServicer(purerpc.Servicer): diff --git a/hyperspace_rpc/schema_pb2.py b/hyperspace_rpc/schema_pb2.py index 31c1e78..64e02ff 100644 --- a/hyperspace_rpc/schema_pb2.py +++ b/hyperspace_rpc/schema_pb2.py @@ -11,7 +11,7 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -import hrpc_pb2 as hrpc__pb2 +from . import hrpc_pb2 as hrpc__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name="schema.proto", diff --git a/makefile b/makefile new file mode 100644 index 0000000..808c4cd --- /dev/null +++ b/makefile @@ -0,0 +1,7 @@ +default: rewrite + +rewrite: + @sed -i 's/import hrpc_pb2 as hrpc__pb2/from . import hrpc_pb2 as hrpc__pb2/g' hyperspace_rpc/*.py && \ + sed -i 's/import schema_pb2 as schema__pb2/from . import schema_pb2 as schema__pb2/g' hyperspace_rpc/*.py + +.PHONY: rewrite diff --git a/pyproject.toml b/pyproject.toml index 56464fe..8dd7ee5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api" [tool.poetry] name = "hyperspace-rpc" -version = "0.0.1a2" +version = "0.0.1a3" description = "Raw RPC layer for Hyperspace" authors = ["decentral1se "] maintainers = ["decentral1se "]