Fix stdlib/disutils testing (#9734)

This commit is contained in:
Avasam
2023-02-21 03:06:20 -05:00
committed by GitHub
parent 880c0da404
commit a6c6bc1b8e
18 changed files with 171 additions and 268 deletions

View File

@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from abc import abstractmethod
from collections.abc import Callable, Iterable
from distutils.dist import Distribution
@@ -60,3 +61,5 @@ class Command:
skip_msg: str | None = None,
level: Any = 1,
) -> None: ... # level is not used
def ensure_finalized(self) -> None: ...
def dump_options(self, header: Incomplete | None = None, indent: str = "") -> None: ...

View File

@@ -1,9 +1,17 @@
from _typeshed import StrOrBytesPath
from collections.abc import Mapping
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
from distutils.extension import Extension as Extension
from typing import Any
USAGE: str
def gen_usage(script_name: StrOrBytesPath) -> str: ...
setup_keywords: tuple[str, ...]
extension_keywords: tuple[str, ...]
def setup(
*,
name: str = ...,

View File

@@ -1,4 +1,20 @@
from distutils.unixccompiler import UnixCCompiler
from distutils.version import LooseVersion
from re import Pattern
from typing_extensions import Literal
def get_msvcr() -> list[str] | None: ...
class CygwinCCompiler(UnixCCompiler): ...
class Mingw32CCompiler(CygwinCCompiler): ...
CONFIG_H_OK: str
CONFIG_H_NOTOK: str
CONFIG_H_UNCERTAIN: str
def check_config_h() -> tuple[Literal["ok", "not ok", "uncertain"], str]: ...
RE_VERSION: Pattern[bytes]
def get_versions() -> tuple[LooseVersion | None, ...]: ...
def is_cygwingcc() -> bool: ...

View File

@@ -1,8 +1,11 @@
from _typeshed import FileDescriptorOrPath, SupportsWrite
from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite
from collections.abc import Iterable, Mapping
from distutils.cmd import Command
from re import Pattern
from typing import IO, Any
command_re: Pattern[str]
class DistributionMetadata:
def __init__(self, path: FileDescriptorOrPath | None = None) -> None: ...
name: str | None
@@ -57,3 +60,57 @@ class Distribution:
def get_option_dict(self, command: str) -> dict[str, tuple[str, str]]: ...
def parse_config_files(self, filenames: Iterable[str] | None = None) -> None: ...
def get_command_obj(self, command: str, create: bool = ...) -> Command | None: ...
global_options: Incomplete
common_usage: str
display_options: Incomplete
display_option_names: Incomplete
negative_opt: Incomplete
verbose: int
dry_run: int
help: int
command_packages: Incomplete
script_name: Incomplete
script_args: Incomplete
command_options: Incomplete
dist_files: Incomplete
packages: Incomplete
package_data: Incomplete
package_dir: Incomplete
py_modules: Incomplete
libraries: Incomplete
headers: Incomplete
ext_modules: Incomplete
ext_package: Incomplete
include_dirs: Incomplete
extra_path: Incomplete
scripts: Incomplete
data_files: Incomplete
password: str
command_obj: Incomplete
have_run: Incomplete
want_user_cfg: bool
def dump_option_dicts(
self, header: Incomplete | None = ..., commands: Incomplete | None = ..., indent: str = ...
) -> None: ...
def find_config_files(self): ...
commands: Incomplete
def parse_command_line(self): ...
def finalize_options(self) -> None: ...
def handle_display_options(self, option_order): ...
def print_command_list(self, commands, header, max_length) -> None: ...
def print_commands(self) -> None: ...
def get_command_list(self): ...
def get_command_packages(self): ...
def get_command_class(self, command): ...
def reinitialize_command(self, command, reinit_subcommands: int = ...): ...
def announce(self, msg, level=...) -> None: ...
def run_commands(self) -> None: ...
def run_command(self, command) -> None: ...
def has_pure_modules(self): ...
def has_ext_modules(self): ...
def has_c_libraries(self): ...
def has_modules(self): ...
def has_headers(self): ...
def has_scripts(self): ...
def has_data_files(self): ...
def is_pure(self): ...

View File

@@ -1,14 +1,15 @@
from collections.abc import Iterable, Mapping
from re import Pattern
from typing import Any, overload
from typing_extensions import TypeAlias
_Option: TypeAlias = tuple[str, str | None, str]
_GR: TypeAlias = tuple[list[str], OptionDummy]
def fancy_getopt(
options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None
) -> list[str] | _GR: ...
def wrap_text(text: str, width: int) -> list[str]: ...
longopt_pat: str
longopt_re: Pattern[str]
neg_alias_re: Pattern[str]
longopt_xlate: dict[int, int]
class FancyGetopt:
def __init__(self, option_table: list[_Option] | None = None) -> None: ...
@@ -20,5 +21,14 @@ class FancyGetopt:
def get_option_order(self) -> list[tuple[str, str]]: ...
def generate_help(self, header: str | None = None) -> list[str]: ...
def fancy_getopt(
options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None
) -> list[str] | _GR: ...
WS_TRANS: dict[int, str]
def wrap_text(text: str, width: int) -> list[str]: ...
def translate_longopt(opt: str) -> str: ...
class OptionDummy:
def __init__(self, options: Iterable[str] = ...) -> None: ...

View File

@@ -1,9 +1,15 @@
import sys
from collections.abc import Mapping
from distutils.ccompiler import CCompiler
PREFIX: str
EXEC_PREFIX: str
BASE_PREFIX: str
BASE_EXEC_PREFIX: str
project_base: str
python_build: bool
def expand_makefile_vars(s: str, vars: Mapping[str, str]) -> str: ...
def get_config_var(name: str) -> int | str | None: ...
def get_config_vars(*args: str) -> Mapping[str, int | str]: ...
def get_config_h_filename() -> str: ...
@@ -11,3 +17,6 @@ def get_makefile_filename() -> str: ...
def get_python_inc(plat_specific: bool = ..., prefix: str | None = None) -> str: ...
def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: str | None = None) -> str: ...
def customize_compiler(compiler: CCompiler) -> None: ...
if sys.version_info < (3, 10):
def get_python_version() -> str: ...

View File

@@ -1,8 +1,12 @@
import sys
from _typeshed import StrPath, Unused
from collections.abc import Callable, Container, Iterable, Mapping
from typing import Any
from typing_extensions import Literal
if sys.version_info >= (3, 8):
def get_host_platform() -> str: ...
def get_platform() -> str: ...
def convert_path(pathname: str) -> str: ...
def change_root(new_root: str, pathname: str) -> str: ...