@@ -300,7 +300,9 @@ def native_parse(
300300 node .path = filename
301301 return node , [], []
302302
303- b , errors , ignores , import_bytes = parse_to_binary_ast (filename , options , skip_function_bodies )
303+ b , errors , ignores , import_bytes , is_partial_package = parse_to_binary_ast (
304+ filename , options , skip_function_bodies
305+ )
304306 data = ReadBuffer (b )
305307 n = read_int (data )
306308 state = State (options )
@@ -310,6 +312,7 @@ def native_parse(
310312
311313 node = MypyFile (defs , imports )
312314 node .path = filename
315+ node .is_partial_stub_package = is_partial_package
313316 # Merge deserialization errors with parsing errors
314317 all_errors = errors + state .errors
315318 return node , all_errors , ignores
@@ -329,11 +332,11 @@ def read_statements(state: State, data: ReadBuffer, n: int) -> list[Statement]:
329332
330333def parse_to_binary_ast (
331334 filename : str , options : Options , skip_function_bodies : bool = False
332- ) -> tuple [bytes , list [dict [str , Any ]], TypeIgnores , bytes ]:
333- ast_bytes , errors , ignores , import_bytes = ast_serialize .parse (
335+ ) -> tuple [bytes , list [dict [str , Any ]], TypeIgnores , bytes , bool ]:
336+ ast_bytes , errors , ignores , import_bytes , is_partial_package = ast_serialize .parse (
334337 filename , skip_function_bodies , python_version = options .python_version
335338 )
336- return ast_bytes , errors , ignores , import_bytes
339+ return ast_bytes , errors , ignores , import_bytes , is_partial_package
337340
338341
339342def read_statement (state : State , data : ReadBuffer ) -> Statement :
0 commit comments