Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit aeda803

Browse files
Fix betterproto2 vs betterproto2_compiler import (#9)
* Fix compilation * Format code
1 parent ee6e9a1 commit aeda803

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/betterproto2_compiler/plugin/models.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
Union,
4747
)
4848

49-
import betterproto2_compiler
49+
import betterproto2
50+
5051
from betterproto2_compiler.compile.naming import (
5152
pythonize_class_name,
5253
pythonize_field_name,
@@ -182,7 +183,7 @@ class ProtoContentBase:
182183
source_file: FileDescriptorProto
183184
typing_compiler: TypingCompiler
184185
path: List[int]
185-
parent: Union["betterproto2_compiler.Message", "OutputTemplate"]
186+
parent: Union["betterproto2.Message", "OutputTemplate"]
186187

187188
__dataclass_fields__: Dict[str, object]
188189

@@ -420,7 +421,7 @@ def field_wraps(self) -> Optional[str]:
420421
match_wrapper = re.match(r"\.google\.protobuf\.(.+)Value$", self.proto_obj.type_name)
421422
if match_wrapper:
422423
wrapped_type = "TYPE_" + match_wrapper.group(1).upper()
423-
if hasattr(betterproto2_compiler, wrapped_type):
424+
if hasattr(betterproto2, wrapped_type):
424425
return f"betterproto2.{wrapped_type}"
425426
return None
426427

0 commit comments

Comments
 (0)