From d31f90be6b034130136a60309e244ec1147d0d78 Mon Sep 17 00:00:00 2001 From: boukeversteegh Date: Thu, 4 Jun 2020 00:11:22 +0200 Subject: [PATCH] Combine circular imports --- betterproto/__init__.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/betterproto/__init__.py b/betterproto/__init__.py index 2ef7164..5d901be 100644 --- a/betterproto/__init__.py +++ b/betterproto/__init__.py @@ -942,7 +942,19 @@ def which_one_of(message: Message, group_name: str) -> Tuple[str, Any]: # Circular import workaround: google.protobuf depends on base classes defined above. -from .lib.google.protobuf import Duration, Timestamp +from .lib.google.protobuf import ( + Duration, + Timestamp, + BoolValue, + BytesValue, + DoubleValue, + FloatValue, + Int32Value, + Int64Value, + StringValue, + UInt32Value, + UInt64Value, +) class _Duration(Duration): @@ -1092,16 +1104,3 @@ class ServiceStub(ABC): await stream.send_message(request, end=True) async for message in stream: yield message - - -from .lib.google.protobuf import ( - BoolValue, - BytesValue, - DoubleValue, - FloatValue, - Int32Value, - Int64Value, - StringValue, - UInt32Value, - UInt64Value, -)