@@ -50,7 +50,9 @@ def __init__(self, proto_root: Path, output_dir: Path, proto_files: List[str]):
5050 def _check_paths (self ):
5151 """Validates input paths."""
5252 if not self .proto_root .exists ():
53- raise FileNotFoundError (f"Proto root directory not found: { self .proto_root } " )
53+ raise FileNotFoundError (
54+ f"Proto root directory not found: { self .proto_root } "
55+ )
5456
5557 for p_file in self .proto_files :
5658 if not (self .proto_root / p_file ).exists ():
@@ -94,7 +96,9 @@ def _get_protoc_args(self) -> List[str]:
9496 )
9597 logger .info ("Enabled mypy-protobuf type generation." )
9698 else :
97- logger .warning ("mypy-protobuf not found. Skipping .pyi generation." )
99+ logger .warning (
100+ "mypy-protobuf not found. Skipping .pyi generation."
101+ )
98102
99103 for p_file in self .proto_files :
100104 args .append (str (self .proto_root / p_file ))
@@ -106,15 +110,18 @@ def _resolve_protoc_gen_mypy() -> Optional[str]:
106110 """
107111 Resolves the protoc-gen-mypy executable path.
108112 Protoc looks for plugins via PATH; when run from make/CI, venv bin may
109- not be on PATH. Prefer the executable next to sys.executable, then PATH.
113+ not be on PATH. Prefer the executable next to sys.executable,
114+ then PATH.
110115 """
111116 import sys as _sys
112117
113118 # 1. Same dir as current Python (venv bin when run via make)
114119 bin_dir = Path (_sys .executable ).resolve ().parent
115120 for name in ("protoc-gen-mypy" , "protoc-gen-mypy.exe" ):
116121 candidate = bin_dir / name
117- if candidate .exists () and (candidate .is_file () or candidate .is_symlink ()):
122+ if candidate .exists () and (
123+ candidate .is_file () or candidate .is_symlink ()
124+ ):
118125 return str (candidate )
119126
120127 # 2. On PATH
@@ -166,7 +173,9 @@ def run(self):
166173 logger .info (f"Code generation complete. Output: { self .output_dir } " )
167174
168175 except Exception :
169- logger .exception ("An unexpected error occurred during code generation." )
176+ logger .exception (
177+ "An unexpected error occurred during code generation."
178+ )
170179 sys .exit (1 )
171180
172181
@@ -195,7 +204,10 @@ def main():
195204 "files" ,
196205 nargs = "*" ,
197206 default = ["function_stream.proto" ],
198- help = "Specific .proto files to compile (default: function_stream.proto)" ,
207+ help = (
208+ "Specific .proto files to compile "
209+ "(default: function_stream.proto)"
210+ ),
199211 )
200212
201213 args = parser .parse_args ()
0 commit comments