From 9798508013adab13f1445623ab5378e26448fb3e Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Sat, 21 Dec 2024 22:55:35 +0100 Subject: [PATCH 1/2] Fix compilation --- src/betterproto2_compiler/plugin/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/betterproto2_compiler/plugin/models.py b/src/betterproto2_compiler/plugin/models.py index 78bcce1c..057983d3 100644 --- a/src/betterproto2_compiler/plugin/models.py +++ b/src/betterproto2_compiler/plugin/models.py @@ -46,7 +46,7 @@ Union, ) -import betterproto2_compiler +import betterproto2 from betterproto2_compiler.compile.naming import ( pythonize_class_name, pythonize_field_name, @@ -182,7 +182,7 @@ class ProtoContentBase: source_file: FileDescriptorProto typing_compiler: TypingCompiler path: List[int] - parent: Union["betterproto2_compiler.Message", "OutputTemplate"] + parent: Union["betterproto2.Message", "OutputTemplate"] __dataclass_fields__: Dict[str, object] @@ -420,7 +420,7 @@ def field_wraps(self) -> Optional[str]: match_wrapper = re.match(r"\.google\.protobuf\.(.+)Value$", self.proto_obj.type_name) if match_wrapper: wrapped_type = "TYPE_" + match_wrapper.group(1).upper() - if hasattr(betterproto2_compiler, wrapped_type): + if hasattr(betterproto2, wrapped_type): return f"betterproto2.{wrapped_type}" return None From 6543eba527e44c4cd907bcc4970a2e02daa1c671 Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Sat, 21 Dec 2024 22:57:23 +0100 Subject: [PATCH 2/2] Format code --- src/betterproto2_compiler/plugin/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/betterproto2_compiler/plugin/models.py b/src/betterproto2_compiler/plugin/models.py index 057983d3..99520ae8 100644 --- a/src/betterproto2_compiler/plugin/models.py +++ b/src/betterproto2_compiler/plugin/models.py @@ -47,6 +47,7 @@ ) import betterproto2 + from betterproto2_compiler.compile.naming import ( pythonize_class_name, pythonize_field_name,