Skip to content

Commit

Permalink
Add missing defaults to setuptools/_distutils (#12839)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Oct 18, 2024
1 parent 559ae97 commit 3b0ce50
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 80 deletions.
124 changes: 62 additions & 62 deletions stubs/setuptools/setuptools/_distutils/ccompiler.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def gen_lib_options(
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
) -> list[str]: ...
def gen_preprocess_options(macros: list[_Macro], include_dirs: list[str]) -> list[str]: ...
def get_default_compiler(osname: str | None = ..., platform: str | None = ...) -> str: ...
def get_default_compiler(osname: str | None = None, platform: str | None = None) -> str: ...
def new_compiler(
plat: str | None = ..., compiler: str | None = ..., verbose: bool = False, dry_run: bool = False, force: bool = False
plat: str | None = None, compiler: str | None = None, verbose: bool = False, dry_run: bool = False, force: bool = False
) -> CCompiler: ...
def show_compilers() -> None: ...

Expand Down Expand Up @@ -47,7 +47,7 @@ class CCompiler:
def set_library_dirs(self, dirs: list[str]) -> None: ...
def add_runtime_library_dir(self, dir: str) -> None: ...
def set_runtime_library_dirs(self, dirs: list[str]) -> None: ...
def define_macro(self, name: str, value: str | None = ...) -> None: ...
def define_macro(self, name: str, value: str | None = None) -> None: ...
def undefine_macro(self, name: str) -> None: ...
def add_link_object(self, object: str) -> None: ...
def set_link_objects(self, objects: list[str]) -> None: ...
Expand All @@ -56,10 +56,10 @@ class CCompiler:
def has_function(
self,
funcname: str,
includes: list[str] | None = ...,
include_dirs: list[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
includes: list[str] | None = None,
include_dirs: list[str] | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
) -> bool: ...
def library_dir_option(self, dir: str) -> str: ...
def library_option(self, lib: str) -> str: ...
Expand All @@ -68,113 +68,113 @@ class CCompiler:
def compile(
self,
sources: list[str],
output_dir: str | None = ...,
macros: list[_Macro] | None = ...,
include_dirs: list[str] | None = ...,
output_dir: str | None = None,
macros: list[_Macro] | None = None,
include_dirs: list[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
depends: list[str] | None = ...,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
depends: list[str] | None = None,
) -> list[str]: ...
def create_static_lib(
self,
objects: list[str],
output_libname: str,
output_dir: str | None = ...,
output_dir: str | None = None,
debug: bool = False,
target_lang: str | None = ...,
target_lang: str | None = None,
) -> None: ...
def link(
self,
target_desc: str,
objects: list[str],
output_filename: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
target_lang: str | None = None,
) -> None: ...
def link_executable(
self,
objects: list[str],
output_progname: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
target_lang: str | None = ...,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
target_lang: str | None = None,
) -> None: ...
def link_shared_lib(
self,
objects: list[str],
output_libname: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
target_lang: str | None = None,
) -> None: ...
def link_shared_object(
self,
objects: list[str],
output_filename: str,
output_dir: str | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
output_dir: str | None = None,
libraries: list[str] | None = None,
library_dirs: list[str] | None = None,
runtime_library_dirs: list[str] | None = None,
export_symbols: list[str] | None = None,
debug: bool = False,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
build_temp: str | None = None,
target_lang: str | None = None,
) -> None: ...
def preprocess(
self,
source: str,
output_file: str | None = ...,
macros: list[_Macro] | None = ...,
include_dirs: list[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
output_file: str | None = None,
macros: list[_Macro] | None = None,
include_dirs: list[str] | None = None,
extra_preargs: list[str] | None = None,
extra_postargs: list[str] | None = None,
) -> None: ...
@overload
def executable_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = ...) -> str: ...
def executable_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = "") -> str: ...
@overload
def executable_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = ...) -> str: ...
def executable_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = "") -> str: ...
def library_filename(
self, libname: str, lib_type: str = "static", strip_dir: bool = False, output_dir: StrPath = ""
) -> str: ...
def object_filenames(
self, source_filenames: Iterable[StrPath], strip_dir: bool = False, output_dir: StrPath | None = ...
self, source_filenames: Iterable[StrPath], strip_dir: bool = False, output_dir: StrPath | None = ""
) -> list[str]: ...
@overload
def shared_object_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = ...) -> str: ...
def shared_object_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = "") -> str: ...
@overload
def shared_object_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = ...) -> str: ...
def shared_object_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = "") -> str: ...
def execute(
self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = ..., level: int = ...
self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = None, level: int = 1
) -> None: ...
def spawn(self, cmd: list[str]) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
@overload
def move_file(self, src: StrPath, dst: _StrPathT) -> _StrPathT | str: ...
@overload
def move_file(self, src: BytesPath, dst: _BytesPathT) -> _BytesPathT | bytes: ...
def announce(self, msg: str, level: int = ...) -> None: ...
def announce(self, msg: str, level: int = 1) -> None: ...
def warn(self, msg: str) -> None: ...
def debug_print(self, msg: str) -> None: ...
8 changes: 4 additions & 4 deletions stubs/setuptools/setuptools/_distutils/cmd.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class Command:
def finalize_options(self) -> None: ...
@abstractmethod
def run(self) -> None: ...
def announce(self, msg: str, level: int = ...) -> None: ...
def announce(self, msg: str, level: int = 10) -> None: ...
def debug_print(self, msg: str) -> None: ...
def ensure_string(self, option: str, default: str | None = ...) -> None: ...
def ensure_string(self, option: str, default: str | None = None) -> None: ...
def ensure_string_list(self, option: str) -> None: ...
def ensure_filename(self, option: str) -> None: ...
def ensure_dirname(self, option: str) -> None: ...
Expand All @@ -43,9 +43,9 @@ class Command:
def get_sub_commands(self) -> list[str]: ...
def warn(self, msg: str) -> None: ...
def execute(
self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = ..., level: int = ...
self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = None, level: int = 1
) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
def mkpath(self, name: str, mode: int = 0o777) -> None: ...
@overload
def copy_file(
self,
Expand Down
2 changes: 1 addition & 1 deletion stubs/setuptools/setuptools/_distutils/dist.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Distribution:
def reinitialize_command(self, command: str, reinit_subcommands: bool = False) -> Command: ...
@overload
def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False) -> _CommandT: ...
def announce(self, msg, level: int = ...) -> None: ...
def announce(self, msg, level: int = 20) -> None: ...
def run_commands(self) -> None: ...
def run_command(self, command: str) -> None: ...
def has_pure_modules(self) -> bool: ...
Expand Down
10 changes: 5 additions & 5 deletions stubs/setuptools/setuptools/_distutils/filelist.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from typing import Literal, overload
class FileList:
allfiles: Iterable[str] | None
files: list[str]
def __init__(self, warn: None = ..., debug_print: None = ...) -> None: ...
def __init__(self, warn: None = None, debug_print: None = None) -> None: ...
def set_allfiles(self, allfiles: Iterable[str]) -> None: ...
def findall(self, dir: str = ...) -> None: ...
def debug_print(self, msg: str) -> None: ...
Expand All @@ -17,21 +17,21 @@ class FileList:
def process_template_line(self, line: str) -> None: ...
@overload
def include_pattern(
self, pattern: str, anchor: bool = True, prefix: str | None = ..., is_regex: Literal[0, False] = 0
self, pattern: str, anchor: bool = True, prefix: str | None = None, is_regex: Literal[0, False] = 0
) -> bool: ...
@overload
def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> bool: ...
@overload
def include_pattern(
self, pattern: str | Pattern[str], anchor: bool = True, prefix: str | None = ..., is_regex: bool = False
self, pattern: str | Pattern[str], anchor: bool = True, prefix: str | None = None, is_regex: bool = False
) -> bool: ...
@overload
def exclude_pattern(
self, pattern: str, anchor: bool = True, prefix: str | None = ..., is_regex: Literal[0, False] = 0
self, pattern: str, anchor: bool = True, prefix: str | None = None, is_regex: Literal[0, False] = 0
) -> bool: ...
@overload
def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> bool: ...
@overload
def exclude_pattern(
self, pattern: str | Pattern[str], anchor: bool = True, prefix: str | None = ..., is_regex: bool = False
self, pattern: str | Pattern[str], anchor: bool = True, prefix: str | None = None, is_regex: bool = False
) -> bool: ...
4 changes: 2 additions & 2 deletions stubs/setuptools/setuptools/_distutils/sysconfig.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ def get_config_vars() -> dict[str, str | int]: ...
def get_config_vars(arg: str, /, *args: str) -> list[str | int]: ...
def get_config_h_filename() -> str: ...
def get_makefile_filename() -> str: ...
def get_python_inc(plat_specific: bool = False, prefix: str | None = ...) -> str: ...
def get_python_lib(plat_specific: bool = False, standard_lib: bool = False, prefix: str | None = ...) -> str: ...
def get_python_inc(plat_specific: bool = False, prefix: str | None = None) -> str: ...
def get_python_lib(plat_specific: bool = False, standard_lib: bool = False, prefix: str | None = None) -> str: ...
def customize_compiler(compiler: CCompiler) -> None: ...
12 changes: 6 additions & 6 deletions stubs/setuptools/setuptools/_distutils/util.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ def convert_path(pathname: str) -> str: ...
def change_root(new_root: str, pathname: str) -> str: ...
def check_environ() -> None: ...
def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ...
def grok_environment_error(exc: object, prefix: str = ...) -> str: ...
def grok_environment_error(exc: object, prefix: str = "error: ") -> str: ...
def split_quoted(s: str) -> list[str]: ...
def execute(
func: Callable[[Unpack[_Ts]], Unused],
args: tuple[Unpack[_Ts]],
msg: str | None = ...,
msg: str | None = None,
verbose: bool = False,
dry_run: bool = False,
) -> None: ...
def strtobool(val: str) -> Literal[0, 1]: ...
def byte_compile(
py_files: list[str],
optimize: int = ...,
optimize: int = 0,
force: bool = False,
prefix: str | None = ...,
base_dir: str | None = ...,
prefix: str | None = None,
base_dir: str | None = None,
verbose: bool = True,
dry_run: bool = False,
direct: bool | None = ...,
direct: bool | None = None,
) -> None: ...
def rfc822_escape(header: str) -> str: ...
def is_mingw() -> bool: ...

0 comments on commit 3b0ce50

Please sign in to comment.