distutils: improve boolean parameters with int defaults (#11928)

This commit is contained in:
Avasam
2024-05-17 02:33:18 -04:00
committed by GitHub
parent 240114ac1a
commit c99adf4b85
26 changed files with 228 additions and 141 deletions

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any
from typing import Any, Literal
from ..cmd import Command
@@ -9,9 +9,9 @@ if sys.platform == "win32":
class PyDialog(Dialog):
def __init__(self, *args, **kw) -> None: ...
def title(self, title) -> None: ...
def back(self, title, next, name: str = "Back", active: int = 1): ...
def cancel(self, title, next, name: str = "Cancel", active: int = 1): ...
def next(self, title, next, name: str = "Next", active: int = 1): ...
def back(self, title, next, name: str = "Back", active: bool | Literal[0, 1] = 1): ...
def cancel(self, title, next, name: str = "Cancel", active: bool | Literal[0, 1] = 1): ...
def next(self, title, next, name: str = "Next", active: bool | Literal[0, 1] = 1): ...
def xbutton(self, name, title, next, xpos): ...
class bdist_msi(Command):

View File

@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Literal
from ..cmd import Command
from ..util import Mixin2to3 as Mixin2to3
@@ -32,7 +32,7 @@ class build_py(Command):
def find_all_modules(self): ...
def get_source_files(self): ...
def get_module_outfile(self, build_dir, package, module): ...
def get_outputs(self, include_bytecode: int = 1): ...
def get_outputs(self, include_bytecode: bool | Literal[0, 1] = 1): ...
def build_module(self, module, module_file, package): ...
def build_modules(self) -> None: ...
def build_packages(self) -> None: ...

View File

@@ -1,4 +1,4 @@
from typing import Any
from typing import Any, Literal
from typing_extensions import TypeAlias
from ..cmd import Command
@@ -16,7 +16,7 @@ class SilentReporter(_Reporter):
report_level,
halt_level,
stream: Any | None = ...,
debug: int = ...,
debug: bool | Literal[0, 1] = 0,
encoding: str = ...,
error_handler: str = ...,
) -> None: ...

View File

@@ -1,6 +1,6 @@
from collections.abc import Sequence
from re import Pattern
from typing import Any
from typing import Any, Literal
from ..ccompiler import CCompiler
from ..cmd import Command
@@ -65,8 +65,8 @@ class config(Command):
include_dirs: Sequence[str] | None = None,
libraries: Sequence[str] | None = None,
library_dirs: Sequence[str] | None = None,
decl: int = 0,
call: int = 0,
decl: bool | Literal[0, 1] = 0,
call: bool | Literal[0, 1] = 0,
) -> bool: ...
def check_lib(
self,