@@ -38,7 +38,7 @@ def module_name_for_path(file_path: str):
3838 return os .path .splitext (name )[0 ]
3939
4040
41- def get_stub_files () -> list [TypeshedFile ]:
41+ def get_stub_files (approved_modules : list [ str ] ) -> list [TypeshedFile ]:
4242 top = os .path .join (DIR , ".." , "lang/en/typeshed/stdlib" )
4343 files_to_process : list [TypeshedFile ] = []
4444 for root , dirs , files in os .walk (top ):
@@ -47,26 +47,25 @@ def get_stub_files() -> list[TypeshedFile]:
4747 # Skip audio stubs file that imports from microbit audio
4848 # (so we don't include its docstring)
4949 if (
50- os .path .basename (os .path .dirname (file_path )) != "microbit"
51- and name == "audio.pyi"
50+ os .path .basename (os .path .dirname (file_path )) in approved_modules
51+ or os . path . splitext ( name )[ 0 ] in approved_modules
5252 ):
53- continue
54- if name . endswith ( ".pyi" ):
55- files_to_process . append (
56- TypeshedFile (
57- file_path = file_path ,
58- module_name = module_name_for_path ( file_path ) ,
59- python_file = True ,
53+ if name . endswith ( ".pyi" ):
54+ files_to_process . append (
55+ TypeshedFile (
56+ file_path = file_path ,
57+ module_name = module_name_for_path ( file_path ) ,
58+ python_file = True ,
59+ )
6060 )
61- )
62- else :
63- files_to_process . append (
64- TypeshedFile (
65- file_path = file_path ,
66- module_name = "" ,
67- python_file = False ,
61+ else :
62+ files_to_process . append (
63+ TypeshedFile (
64+ file_path = file_path ,
65+ module_name = "" ,
66+ python_file = False ,
67+ )
6868 )
69- )
7069 return sorted (files_to_process , key = lambda x : x .file_path )
7170
7271
0 commit comments