1- from _typeshed import BytesPath , StrPath , Unused
21from collections .abc import Callable , Iterable
32from typing import ClassVar , Literal , TypeVar , overload
3+
4+ from _typeshed import BytesPath , StrPath , Unused
45from typing_extensions import TypeAlias , TypeVarTuple , Unpack
56
67_Macro : TypeAlias = tuple [str ] | tuple [str , str | None ]
@@ -9,12 +10,23 @@ _BytesPathT = TypeVar("_BytesPathT", bound=BytesPath)
910_Ts = TypeVarTuple ("_Ts" )
1011
1112def gen_lib_options (
12- compiler : CCompiler , library_dirs : list [str ], runtime_library_dirs : list [str ], libraries : list [str ]
13+ compiler : CCompiler ,
14+ library_dirs : list [str ],
15+ runtime_library_dirs : list [str ],
16+ libraries : list [str ],
1317) -> list [str ]: ...
14- def gen_preprocess_options (macros : list [_Macro ], include_dirs : list [str ]) -> list [str ]: ...
15- def get_default_compiler (osname : str | None = None , platform : str | None = None ) -> str : ...
18+ def gen_preprocess_options (
19+ macros : list [_Macro ], include_dirs : list [str ]
20+ ) -> list [str ]: ...
21+ def get_default_compiler (
22+ osname : str | None = None , platform : str | None = None
23+ ) -> str : ...
1624def new_compiler (
17- plat : str | None = None , compiler : str | None = None , verbose : bool = False , dry_run : bool = False , force : bool = False
25+ plat : str | None = None ,
26+ compiler : str | None = None ,
27+ verbose : bool = False ,
28+ dry_run : bool = False ,
29+ force : bool = False ,
1830) -> CCompiler : ...
1931def show_compilers () -> None : ...
2032
@@ -38,7 +50,9 @@ class CCompiler:
3850 library_dirs : list [str ]
3951 runtime_library_dirs : list [str ]
4052 objects : list [str ]
41- def __init__ (self , verbose : bool = False , dry_run : bool = False , force : bool = False ) -> None : ...
53+ def __init__ (
54+ self , verbose : bool = False , dry_run : bool = False , force : bool = False
55+ ) -> None : ...
4256 def add_include_dir (self , dir : str ) -> None : ...
4357 def set_include_dirs (self , dirs : list [str ]) -> None : ...
4458 def add_library (self , libname : str ) -> None : ...
@@ -52,7 +66,9 @@ class CCompiler:
5266 def add_link_object (self , object : str ) -> None : ...
5367 def set_link_objects (self , objects : list [str ]) -> None : ...
5468 def detect_language (self , sources : str | list [str ]) -> str | None : ...
55- def find_library_file (self , dirs : list [str ], lib : str , debug : bool = False ) -> str | None : ...
69+ def find_library_file (
70+ self , dirs : list [str ], lib : str , debug : bool = False
71+ ) -> str | None : ...
5672 def has_function (
5773 self ,
5874 funcname : str ,
@@ -153,21 +169,40 @@ class CCompiler:
153169 extra_postargs : list [str ] | None = None ,
154170 ) -> None : ...
155171 @overload
156- def executable_filename (self , basename : str , strip_dir : Literal [0 , False ] = 0 , output_dir : StrPath = "" ) -> str : ...
172+ def executable_filename (
173+ self , basename : str , strip_dir : Literal [False ] = False , output_dir : StrPath = ""
174+ ) -> str : ...
157175 @overload
158- def executable_filename (self , basename : StrPath , strip_dir : Literal [1 , True ], output_dir : StrPath = "" ) -> str : ...
176+ def executable_filename (
177+ self , basename : StrPath , strip_dir : Literal [True ], output_dir : StrPath = ""
178+ ) -> str : ...
159179 def library_filename (
160- self , libname : str , lib_type : str = "static" , strip_dir : bool = False , output_dir : StrPath = ""
180+ self ,
181+ libname : str ,
182+ lib_type : str = "static" ,
183+ strip_dir : bool = False ,
184+ output_dir : StrPath = "" ,
161185 ) -> str : ...
162186 def object_filenames (
163- self , source_filenames : Iterable [StrPath ], strip_dir : bool = False , output_dir : StrPath | None = None
187+ self ,
188+ source_filenames : Iterable [StrPath ],
189+ strip_dir : bool = False ,
190+ output_dir : StrPath | None = '' ,
164191 ) -> list [str ]: ...
165192 @overload
166- def shared_object_filename (self , basename : str , strip_dir : Literal [0 , False ] = 0 , output_dir : StrPath = "" ) -> str : ...
193+ def shared_object_filename (
194+ self , basename : str , strip_dir : Literal [False ] = False , output_dir : StrPath = ""
195+ ) -> str : ...
167196 @overload
168- def shared_object_filename (self , basename : StrPath , strip_dir : Literal [1 , True ], output_dir : StrPath = "" ) -> str : ...
197+ def shared_object_filename (
198+ self , basename : StrPath , strip_dir : Literal [True ], output_dir : StrPath = ""
199+ ) -> str : ...
169200 def execute (
170- self , func : Callable [[Unpack [_Ts ]], Unused ], args : tuple [Unpack [_Ts ]], msg : str | None = None , level : int = 1
201+ self ,
202+ func : Callable [[Unpack [_Ts ]], Unused ],
203+ args : tuple [Unpack [_Ts ]],
204+ msg : str | None = None ,
205+ level : int = 1 ,
171206 ) -> None : ...
172207 def spawn (self , cmd : list [str ]) -> None : ...
173208 def mkpath (self , name : str , mode : int = 0o777 ) -> None : ...
0 commit comments