diff --git a/typings/distutils-stubs/_modified.pyi b/typings/distutils-stubs/_modified.pyi index e825ba0db57..84444dc04a9 100644 --- a/typings/distutils-stubs/_modified.pyi +++ b/typings/distutils-stubs/_modified.pyi @@ -1,17 +1,25 @@ -from _typeshed import StrOrBytesPath from collections.abc import Callable, Iterable from typing import Literal, TypeVar +from _typeshed import StrOrBytesPath + _SourcesT = TypeVar("_SourcesT", bound=StrOrBytesPath) _TargetsT = TypeVar("_TargetsT", bound=StrOrBytesPath) def newer(source: StrOrBytesPath, target: StrOrBytesPath) -> bool: ... def newer_pairwise( - sources: Iterable[_SourcesT], targets: Iterable[_TargetsT], newer: Callable[[_SourcesT, _TargetsT], bool] = newer + sources: Iterable[_SourcesT], + targets: Iterable[_TargetsT], + newer: Callable[[_SourcesT, _TargetsT], bool] = newer, ) -> tuple[list[_SourcesT], list[_TargetsT]]: ... def newer_group( - sources: Iterable[StrOrBytesPath], target: StrOrBytesPath, missing: Literal["error", "ignore", "newer"] = "error" + sources: Iterable[StrOrBytesPath], + target: StrOrBytesPath, + missing: Literal["error", "ignore", "newer"] = "error", ) -> bool: ... def newer_pairwise_group( - sources: Iterable[_SourcesT], targets: Iterable[_TargetsT], *, newer: Callable[[_SourcesT, _TargetsT], bool] = newer + sources: Iterable[_SourcesT], + targets: Iterable[_TargetsT], + *, + newer: Callable[[_SourcesT, _TargetsT], bool] = newer, ) -> tuple[list[_SourcesT], list[_TargetsT]]: ... diff --git a/typings/distutils-stubs/archive_util.pyi b/typings/distutils-stubs/archive_util.pyi index c2b9566e127..ad37d64ce83 100644 --- a/typings/distutils-stubs/archive_util.pyi +++ b/typings/distutils-stubs/archive_util.pyi @@ -1,6 +1,7 @@ -from _typeshed import StrOrBytesPath, StrPath from typing import Literal, overload +from _typeshed import StrOrBytesPath, StrPath + @overload def make_archive( base_name: str, @@ -32,4 +33,6 @@ def make_tarball( owner: str | None = None, group: str | None = None, ) -> str: ... -def make_zipfile(base_name: str, base_dir: str, verbose: bool = False, dry_run: bool = False) -> str: ... +def make_zipfile( + base_name: str, base_dir: str, verbose: bool = False, dry_run: bool = False +) -> str: ... diff --git a/typings/distutils-stubs/cmd.pyi b/typings/distutils-stubs/cmd.pyi index c9e25b6bd8c..15f59e6d468 100644 --- a/typings/distutils-stubs/cmd.pyi +++ b/typings/distutils-stubs/cmd.pyi @@ -1,7 +1,8 @@ -from _typeshed import BytesPath, StrOrBytesPath, StrPath, Unused from abc import abstractmethod from collections.abc import Callable, Iterable from typing import Any, ClassVar, Literal, TypeVar, overload + +from _typeshed import BytesPath, StrOrBytesPath, StrPath, Unused from typing_extensions import TypeVarTuple, Unpack from .command.bdist import bdist @@ -51,82 +52,140 @@ class Command: def ensure_filename(self, option: str) -> None: ... def ensure_dirname(self, option: str) -> None: ... def get_command_name(self) -> str: ... - def set_undefined_options(self, src_cmd: str, *option_pairs: tuple[str, str]) -> None: ... + def set_undefined_options( + self, src_cmd: str, *option_pairs: tuple[str, str] + ) -> None: ... # NOTE: This list comes directly from the distutils/command folder. Minus bdist_msi and bdist_wininst. @overload - def get_finalized_command(self, command: Literal["bdist"], create: bool = True) -> bdist: ... + def get_finalized_command( + self, command: Literal["bdist"], create: bool = True + ) -> bdist: ... @overload - def get_finalized_command(self, command: Literal["bdist_dumb"], create: bool = True) -> bdist_dumb: ... + def get_finalized_command( + self, command: Literal["bdist_dumb"], create: bool = True + ) -> bdist_dumb: ... @overload - def get_finalized_command(self, command: Literal["bdist_rpm"], create: bool = True) -> bdist_rpm: ... + def get_finalized_command( + self, command: Literal["bdist_rpm"], create: bool = True + ) -> bdist_rpm: ... @overload - def get_finalized_command(self, command: Literal["build"], create: bool = True) -> build: ... + def get_finalized_command( + self, command: Literal["build"], create: bool = True + ) -> build: ... @overload - def get_finalized_command(self, command: Literal["build_clib"], create: bool = True) -> build_clib: ... + def get_finalized_command( + self, command: Literal["build_clib"], create: bool = True + ) -> build_clib: ... @overload - def get_finalized_command(self, command: Literal["build_ext"], create: bool = True) -> build_ext: ... + def get_finalized_command( + self, command: Literal["build_ext"], create: bool = True + ) -> build_ext: ... @overload - def get_finalized_command(self, command: Literal["build_py"], create: bool = True) -> build_py: ... + def get_finalized_command( + self, command: Literal["build_py"], create: bool = True + ) -> build_py: ... @overload - def get_finalized_command(self, command: Literal["build_scripts"], create: bool = True) -> build_scripts: ... + def get_finalized_command( + self, command: Literal["build_scripts"], create: bool = True + ) -> build_scripts: ... @overload - def get_finalized_command(self, command: Literal["check"], create: bool = True) -> check: ... + def get_finalized_command( + self, command: Literal["check"], create: bool = True + ) -> check: ... @overload - def get_finalized_command(self, command: Literal["clean"], create: bool = True) -> clean: ... + def get_finalized_command( + self, command: Literal["clean"], create: bool = True + ) -> clean: ... @overload - def get_finalized_command(self, command: Literal["config"], create: bool = True) -> config: ... + def get_finalized_command( + self, command: Literal["config"], create: bool = True + ) -> config: ... @overload - def get_finalized_command(self, command: Literal["install"], create: bool = True) -> install: ... + def get_finalized_command( + self, command: Literal["install"], create: bool = True + ) -> install: ... @overload - def get_finalized_command(self, command: Literal["install_data"], create: bool = True) -> install_data: ... + def get_finalized_command( + self, command: Literal["install_data"], create: bool = True + ) -> install_data: ... @overload def get_finalized_command( self, command: Literal["install_egg_info"], create: bool = True ) -> install_egg_info: ... @overload - def get_finalized_command(self, command: Literal["install_headers"], create: bool = True) -> install_headers: ... + def get_finalized_command( + self, command: Literal["install_headers"], create: bool = True + ) -> install_headers: ... @overload - def get_finalized_command(self, command: Literal["install_lib"], create: bool = True) -> install_lib: ... + def get_finalized_command( + self, command: Literal["install_lib"], create: bool = True + ) -> install_lib: ... @overload - def get_finalized_command(self, command: Literal["install_scripts"], create: bool = True) -> install_scripts: ... + def get_finalized_command( + self, command: Literal["install_scripts"], create: bool = True + ) -> install_scripts: ... @overload - def get_finalized_command(self, command: Literal["register"], create: bool = True) -> register: ... + def get_finalized_command( + self, command: Literal["register"], create: bool = True + ) -> register: ... @overload - def get_finalized_command(self, command: Literal["sdist"], create: bool = True) -> sdist: ... + def get_finalized_command( + self, command: Literal["sdist"], create: bool = True + ) -> sdist: ... @overload - def get_finalized_command(self, command: Literal["upload"], create: bool = True) -> upload: ... + def get_finalized_command( + self, command: Literal["upload"], create: bool = True + ) -> upload: ... @overload def get_finalized_command(self, command: str, create: bool = True) -> Command: ... @overload - def reinitialize_command(self, command: Literal["bdist"], reinit_subcommands: bool = False) -> bdist: ... + def reinitialize_command( + self, command: Literal["bdist"], reinit_subcommands: bool = False + ) -> bdist: ... @overload def reinitialize_command( self, command: Literal["bdist_dumb"], reinit_subcommands: bool = False ) -> bdist_dumb: ... @overload - def reinitialize_command(self, command: Literal["bdist_rpm"], reinit_subcommands: bool = False) -> bdist_rpm: ... + def reinitialize_command( + self, command: Literal["bdist_rpm"], reinit_subcommands: bool = False + ) -> bdist_rpm: ... @overload - def reinitialize_command(self, command: Literal["build"], reinit_subcommands: bool = False) -> build: ... + def reinitialize_command( + self, command: Literal["build"], reinit_subcommands: bool = False + ) -> build: ... @overload def reinitialize_command( self, command: Literal["build_clib"], reinit_subcommands: bool = False ) -> build_clib: ... @overload - def reinitialize_command(self, command: Literal["build_ext"], reinit_subcommands: bool = False) -> build_ext: ... + def reinitialize_command( + self, command: Literal["build_ext"], reinit_subcommands: bool = False + ) -> build_ext: ... @overload - def reinitialize_command(self, command: Literal["build_py"], reinit_subcommands: bool = False) -> build_py: ... + def reinitialize_command( + self, command: Literal["build_py"], reinit_subcommands: bool = False + ) -> build_py: ... @overload def reinitialize_command( self, command: Literal["build_scripts"], reinit_subcommands: bool = False ) -> build_scripts: ... @overload - def reinitialize_command(self, command: Literal["check"], reinit_subcommands: bool = False) -> check: ... + def reinitialize_command( + self, command: Literal["check"], reinit_subcommands: bool = False + ) -> check: ... @overload - def reinitialize_command(self, command: Literal["clean"], reinit_subcommands: bool = False) -> clean: ... + def reinitialize_command( + self, command: Literal["clean"], reinit_subcommands: bool = False + ) -> clean: ... @overload - def reinitialize_command(self, command: Literal["config"], reinit_subcommands: bool = False) -> config: ... + def reinitialize_command( + self, command: Literal["config"], reinit_subcommands: bool = False + ) -> config: ... @overload - def reinitialize_command(self, command: Literal["install"], reinit_subcommands: bool = False) -> install: ... + def reinitialize_command( + self, command: Literal["install"], reinit_subcommands: bool = False + ) -> install: ... @overload def reinitialize_command( self, command: Literal["install_data"], reinit_subcommands: bool = False @@ -148,20 +207,34 @@ class Command: self, command: Literal["install_scripts"], reinit_subcommands: bool = False ) -> install_scripts: ... @overload - def reinitialize_command(self, command: Literal["register"], reinit_subcommands: bool = False) -> register: ... + def reinitialize_command( + self, command: Literal["register"], reinit_subcommands: bool = False + ) -> register: ... @overload - def reinitialize_command(self, command: Literal["sdist"], reinit_subcommands: bool = False) -> sdist: ... + def reinitialize_command( + self, command: Literal["sdist"], reinit_subcommands: bool = False + ) -> sdist: ... @overload - def reinitialize_command(self, command: Literal["upload"], reinit_subcommands: bool = False) -> upload: ... + def reinitialize_command( + self, command: Literal["upload"], reinit_subcommands: bool = False + ) -> upload: ... @overload - def reinitialize_command(self, command: str, reinit_subcommands: bool = False) -> Command: ... + def reinitialize_command( + self, command: str, reinit_subcommands: bool = False + ) -> Command: ... @overload - def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False) -> _CommandT: ... + def reinitialize_command( + self, command: _CommandT, reinit_subcommands: bool = False + ) -> _CommandT: ... def run_command(self, command: str) -> None: ... 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 = None, level: int = 1 + 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 = 0o777) -> None: ... @overload @@ -194,10 +267,16 @@ class Command: level: Unused = 1, ) -> list[str]: ... @overload - def move_file(self, src: StrPath, dst: _StrPathT, level: Unused = 1) -> _StrPathT | str: ... + def move_file( + self, src: StrPath, dst: _StrPathT, level: Unused = 1 + ) -> _StrPathT | str: ... @overload - def move_file(self, src: BytesPath, dst: _BytesPathT, level: Unused = 1) -> _BytesPathT | bytes: ... - def spawn(self, cmd: Iterable[str], search_path: bool = True, level: Unused = 1) -> None: ... + def move_file( + self, src: BytesPath, dst: _BytesPathT, level: Unused = 1 + ) -> _BytesPathT | bytes: ... + def spawn( + self, cmd: Iterable[str], search_path: bool = True, level: Unused = 1 + ) -> None: ... @overload def make_archive( self, diff --git a/typings/distutils-stubs/command/bdist.pyi b/typings/distutils-stubs/command/bdist.pyi index 0d699298314..43e6ece30e2 100644 --- a/typings/distutils-stubs/command/bdist.pyi +++ b/typings/distutils-stubs/command/bdist.pyi @@ -1,6 +1,7 @@ -from _typeshed import Unused from collections.abc import Callable from typing import ClassVar + +from _typeshed import Unused from typing_extensions import deprecated from ..cmd import Command diff --git a/typings/distutils-stubs/command/bdist_dumb.pyi b/typings/distutils-stubs/command/bdist_dumb.pyi index 297a0c39ed4..d7943b76d7e 100644 --- a/typings/distutils-stubs/command/bdist_dumb.pyi +++ b/typings/distutils-stubs/command/bdist_dumb.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command class bdist_dumb(Command): diff --git a/typings/distutils-stubs/command/bdist_rpm.pyi b/typings/distutils-stubs/command/bdist_rpm.pyi index 83b4161094c..eca2780b553 100644 --- a/typings/distutils-stubs/command/bdist_rpm.pyi +++ b/typings/distutils-stubs/command/bdist_rpm.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command class bdist_rpm(Command): diff --git a/typings/distutils-stubs/command/build.pyi b/typings/distutils-stubs/command/build.pyi index a1c00b5c816..59cbdf3d181 100644 --- a/typings/distutils-stubs/command/build.pyi +++ b/typings/distutils-stubs/command/build.pyi @@ -1,7 +1,8 @@ -from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import ClassVar +from _typeshed import Incomplete, Unused + from ..cmd import Command def show_compilers() -> None: ... diff --git a/typings/distutils-stubs/command/build_clib.pyi b/typings/distutils-stubs/command/build_clib.pyi index 687cb534501..75b78a718f2 100644 --- a/typings/distutils-stubs/command/build_clib.pyi +++ b/typings/distutils-stubs/command/build_clib.pyi @@ -1,7 +1,8 @@ -from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import ClassVar +from _typeshed import Incomplete, Unused + from ..cmd import Command class build_clib(Command): diff --git a/typings/distutils-stubs/command/build_ext.pyi b/typings/distutils-stubs/command/build_ext.pyi index 49c7f194852..2b8c49788f5 100644 --- a/typings/distutils-stubs/command/build_ext.pyi +++ b/typings/distutils-stubs/command/build_ext.pyi @@ -1,7 +1,8 @@ -from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import ClassVar +from _typeshed import Incomplete, Unused + from ..cmd import Command from ..extension import Extension diff --git a/typings/distutils-stubs/command/build_py.pyi b/typings/distutils-stubs/command/build_py.pyi index 6ad82d005ea..628ab5347f9 100644 --- a/typings/distutils-stubs/command/build_py.pyi +++ b/typings/distutils-stubs/command/build_py.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command class build_py(Command): diff --git a/typings/distutils-stubs/command/build_scripts.pyi b/typings/distutils-stubs/command/build_scripts.pyi index 74ca2cacd97..5ac864d4872 100644 --- a/typings/distutils-stubs/command/build_scripts.pyi +++ b/typings/distutils-stubs/command/build_scripts.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command first_line_re: Incomplete diff --git a/typings/distutils-stubs/command/clean.pyi b/typings/distutils-stubs/command/clean.pyi index 0f3768d6dcf..2b78d860310 100644 --- a/typings/distutils-stubs/command/clean.pyi +++ b/typings/distutils-stubs/command/clean.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command class clean(Command): diff --git a/typings/distutils-stubs/command/install.pyi b/typings/distutils-stubs/command/install.pyi index 8e092f7d6c0..798e30ae27b 100644 --- a/typings/distutils-stubs/command/install.pyi +++ b/typings/distutils-stubs/command/install.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command class install(Command): diff --git a/typings/distutils-stubs/command/install_data.pyi b/typings/distutils-stubs/command/install_data.pyi index 609de62b04b..8cc23f08db7 100644 --- a/typings/distutils-stubs/command/install_data.pyi +++ b/typings/distutils-stubs/command/install_data.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command class install_data(Command): diff --git a/typings/distutils-stubs/command/install_egg_info.pyi b/typings/distutils-stubs/command/install_egg_info.pyi index 75bb906ce58..fdc0cf982ad 100644 --- a/typings/distutils-stubs/command/install_egg_info.pyi +++ b/typings/distutils-stubs/command/install_egg_info.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command class install_egg_info(Command): diff --git a/typings/distutils-stubs/command/install_headers.pyi b/typings/distutils-stubs/command/install_headers.pyi index 3caad8a07dc..dc1243a3f7a 100644 --- a/typings/distutils-stubs/command/install_headers.pyi +++ b/typings/distutils-stubs/command/install_headers.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command class install_headers(Command): diff --git a/typings/distutils-stubs/command/install_lib.pyi b/typings/distutils-stubs/command/install_lib.pyi index 7edc148be97..1189464ae1d 100644 --- a/typings/distutils-stubs/command/install_lib.pyi +++ b/typings/distutils-stubs/command/install_lib.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command class install_lib(Command): diff --git a/typings/distutils-stubs/command/install_scripts.pyi b/typings/distutils-stubs/command/install_scripts.pyi index b9eab32f9dd..a87284e842c 100644 --- a/typings/distutils-stubs/command/install_scripts.pyi +++ b/typings/distutils-stubs/command/install_scripts.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..cmd import Command class install_scripts(Command): diff --git a/typings/distutils-stubs/command/register.pyi b/typings/distutils-stubs/command/register.pyi index 6f5901ffbc1..bb9d6c2e38e 100644 --- a/typings/distutils-stubs/command/register.pyi +++ b/typings/distutils-stubs/command/register.pyi @@ -1,7 +1,8 @@ -from _typeshed import Incomplete from collections.abc import Callable from typing import Any, ClassVar +from _typeshed import Incomplete + from ..config import PyPIRCCommand class register(PyPIRCCommand): diff --git a/typings/distutils-stubs/command/sdist.pyi b/typings/distutils-stubs/command/sdist.pyi index a84fbef2a68..94a80cc8cbb 100644 --- a/typings/distutils-stubs/command/sdist.pyi +++ b/typings/distutils-stubs/command/sdist.pyi @@ -1,7 +1,8 @@ -from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import ClassVar +from _typeshed import Incomplete, Unused + from ..cmd import Command def show_formats() -> None: ... diff --git a/typings/distutils-stubs/command/upload.pyi b/typings/distutils-stubs/command/upload.pyi index afcfbaf4867..a78f777ba7b 100644 --- a/typings/distutils-stubs/command/upload.pyi +++ b/typings/distutils-stubs/command/upload.pyi @@ -1,6 +1,7 @@ -from _typeshed import Incomplete from typing import ClassVar +from _typeshed import Incomplete + from ..config import PyPIRCCommand class upload(PyPIRCCommand): diff --git a/typings/distutils-stubs/dep_util.pyi b/typings/distutils-stubs/dep_util.pyi index 88cd92f0016..518d6c7ebe1 100644 --- a/typings/distutils-stubs/dep_util.pyi +++ b/typings/distutils-stubs/dep_util.pyi @@ -1 +1,5 @@ -from ._modified import newer as newer, newer_group as newer_group, newer_pairwise as newer_pairwise +from ._modified import ( + newer as newer, + newer_group as newer_group, + newer_pairwise as newer_pairwise, +) diff --git a/typings/distutils-stubs/dist.pyi b/typings/distutils-stubs/dist.pyi index 1ba10938d9b..bc6486c7802 100644 --- a/typings/distutils-stubs/dist.pyi +++ b/typings/distutils-stubs/dist.pyi @@ -1,7 +1,8 @@ -from _typeshed import Incomplete, StrOrBytesPath, StrPath, SupportsWrite from collections.abc import Iterable, MutableMapping from re import Pattern from typing import IO, ClassVar, Literal, TypeVar, overload + +from _typeshed import Incomplete, StrOrBytesPath, StrPath, SupportsWrite from typing_extensions import TypeAlias from .cmd import Command @@ -28,7 +29,9 @@ from .command.upload import upload command_re: Pattern[str] -_OptionsList: TypeAlias = list[tuple[str, str | None, str, int] | tuple[str, str | None, str]] +_OptionsList: TypeAlias = list[ + tuple[str, str | None, str, int] | tuple[str, str | None, str] +] _CommandT = TypeVar("_CommandT", bound=Command) class DistributionMetadata: @@ -81,7 +84,9 @@ class DistributionMetadata: class Distribution: cmdclass: dict[str, type[Command]] metadata: DistributionMetadata - def __init__(self, attrs: MutableMapping[str, Incomplete] | None = None) -> None: ... + def __init__( + self, attrs: MutableMapping[str, Incomplete] | None = None + ) -> None: ... def get_option_dict(self, command: str) -> dict[str, tuple[str, str]]: ... def parse_config_files( self, filenames: Iterable[StrPath] | None = None @@ -116,7 +121,10 @@ class Distribution: have_run: dict[str, bool] want_user_cfg: bool def dump_option_dicts( - self, header: Incomplete | None = None, commands: Incomplete | None = None, indent: str = "" + self, + header: Incomplete | None = None, + commands: Incomplete | None = None, + indent: str = "", ) -> None: ... def find_config_files(self): ... commands: Incomplete @@ -129,50 +137,94 @@ class Distribution: def get_command_packages(self): ... # NOTE: This list comes directly from the distutils/command folder. Minus bdist_msi and bdist_wininst. @overload - def get_command_obj(self, command: Literal["bdist"], create: Literal[True] = True) -> bdist: ... + def get_command_obj( + self, command: Literal["bdist"], create: Literal[True] = True + ) -> bdist: ... @overload - def get_command_obj(self, command: Literal["bdist_dumb"], create: Literal[True] = True) -> bdist_dumb: ... + def get_command_obj( + self, command: Literal["bdist_dumb"], create: Literal[True] = True + ) -> bdist_dumb: ... @overload - def get_command_obj(self, command: Literal["bdist_rpm"], create: Literal[True] = True) -> bdist_rpm: ... + def get_command_obj( + self, command: Literal["bdist_rpm"], create: Literal[True] = True + ) -> bdist_rpm: ... @overload - def get_command_obj(self, command: Literal["build"], create: Literal[True] = True) -> build: ... + def get_command_obj( + self, command: Literal["build"], create: Literal[True] = True + ) -> build: ... @overload - def get_command_obj(self, command: Literal["build_clib"], create: Literal[True] = True) -> build_clib: ... + def get_command_obj( + self, command: Literal["build_clib"], create: Literal[True] = True + ) -> build_clib: ... @overload - def get_command_obj(self, command: Literal["build_ext"], create: Literal[True] = True) -> build_ext: ... + def get_command_obj( + self, command: Literal["build_ext"], create: Literal[True] = True + ) -> build_ext: ... @overload - def get_command_obj(self, command: Literal["build_py"], create: Literal[True] = True) -> build_py: ... + def get_command_obj( + self, command: Literal["build_py"], create: Literal[True] = True + ) -> build_py: ... @overload - def get_command_obj(self, command: Literal["build_scripts"], create: Literal[True] = True) -> build_scripts: ... + def get_command_obj( + self, command: Literal["build_scripts"], create: Literal[True] = True + ) -> build_scripts: ... @overload - def get_command_obj(self, command: Literal["check"], create: Literal[True] = True) -> check: ... + def get_command_obj( + self, command: Literal["check"], create: Literal[True] = True + ) -> check: ... @overload - def get_command_obj(self, command: Literal["clean"], create: Literal[True] = True) -> clean: ... + def get_command_obj( + self, command: Literal["clean"], create: Literal[True] = True + ) -> clean: ... @overload - def get_command_obj(self, command: Literal["config"], create: Literal[True] = True) -> config: ... + def get_command_obj( + self, command: Literal["config"], create: Literal[True] = True + ) -> config: ... @overload - def get_command_obj(self, command: Literal["install"], create: Literal[True] = True) -> install: ... + def get_command_obj( + self, command: Literal["install"], create: Literal[True] = True + ) -> install: ... @overload - def get_command_obj(self, command: Literal["install_data"], create: Literal[True] = True) -> install_data: ... + def get_command_obj( + self, command: Literal["install_data"], create: Literal[True] = True + ) -> install_data: ... @overload - def get_command_obj(self, command: Literal["install_egg_info"], create: Literal[True] = True) -> install_egg_info: ... + def get_command_obj( + self, command: Literal["install_egg_info"], create: Literal[True] = True + ) -> install_egg_info: ... @overload - def get_command_obj(self, command: Literal["install_headers"], create: Literal[True] = True) -> install_headers: ... + def get_command_obj( + self, command: Literal["install_headers"], create: Literal[True] = True + ) -> install_headers: ... @overload - def get_command_obj(self, command: Literal["install_lib"], create: Literal[True] = True) -> install_lib: ... + def get_command_obj( + self, command: Literal["install_lib"], create: Literal[True] = True + ) -> install_lib: ... @overload - def get_command_obj(self, command: Literal["install_scripts"], create: Literal[True] = True) -> install_scripts: ... + def get_command_obj( + self, command: Literal["install_scripts"], create: Literal[True] = True + ) -> install_scripts: ... @overload - def get_command_obj(self, command: Literal["register"], create: Literal[True] = True) -> register: ... + def get_command_obj( + self, command: Literal["register"], create: Literal[True] = True + ) -> register: ... @overload - def get_command_obj(self, command: Literal["sdist"], create: Literal[True] = True) -> sdist: ... + def get_command_obj( + self, command: Literal["sdist"], create: Literal[True] = True + ) -> sdist: ... @overload - def get_command_obj(self, command: Literal["upload"], create: Literal[True] = True) -> upload: ... + def get_command_obj( + self, command: Literal["upload"], create: Literal[True] = True + ) -> upload: ... @overload - def get_command_obj(self, command: str, create: Literal[True] = True) -> Command: ... + def get_command_obj( + self, command: str, create: Literal[True] = True + ) -> Command: ... # Not replicating the overloads for "Command | None", user may use "isinstance" @overload - def get_command_obj(self, command: str, create: Literal[False]) -> Command | None: ... + def get_command_obj( + self, command: str, create: Literal[False] + ) -> Command | None: ... @overload def get_command_class(self, command: Literal["bdist"]) -> type[bdist]: ... @overload @@ -188,7 +240,9 @@ class Distribution: @overload def get_command_class(self, command: Literal["build_py"]) -> type[build_py]: ... @overload - def get_command_class(self, command: Literal["build_scripts"]) -> type[build_scripts]: ... + def get_command_class( + self, command: Literal["build_scripts"] + ) -> type[build_scripts]: ... @overload def get_command_class(self, command: Literal["check"]) -> type[check]: ... @overload @@ -198,15 +252,25 @@ class Distribution: @overload def get_command_class(self, command: Literal["install"]) -> type[install]: ... @overload - def get_command_class(self, command: Literal["install_data"]) -> type[install_data]: ... + def get_command_class( + self, command: Literal["install_data"] + ) -> type[install_data]: ... @overload - def get_command_class(self, command: Literal["install_egg_info"]) -> type[install_egg_info]: ... + def get_command_class( + self, command: Literal["install_egg_info"] + ) -> type[install_egg_info]: ... @overload - def get_command_class(self, command: Literal["install_headers"]) -> type[install_headers]: ... + def get_command_class( + self, command: Literal["install_headers"] + ) -> type[install_headers]: ... @overload - def get_command_class(self, command: Literal["install_lib"]) -> type[install_lib]: ... + def get_command_class( + self, command: Literal["install_lib"] + ) -> type[install_lib]: ... @overload - def get_command_class(self, command: Literal["install_scripts"]) -> type[install_scripts]: ... + def get_command_class( + self, command: Literal["install_scripts"] + ) -> type[install_scripts]: ... @overload def get_command_class(self, command: Literal["register"]) -> type[register]: ... @overload @@ -216,51 +280,93 @@ class Distribution: @overload def get_command_class(self, command: str) -> type[Command]: ... @overload - def reinitialize_command(self, command: Literal["bdist"], reinit_subcommands: bool = False) -> bdist: ... + def reinitialize_command( + self, command: Literal["bdist"], reinit_subcommands: bool = False + ) -> bdist: ... @overload - def reinitialize_command(self, command: Literal["bdist_dumb"], reinit_subcommands: bool = False) -> bdist_dumb: ... + def reinitialize_command( + self, command: Literal["bdist_dumb"], reinit_subcommands: bool = False + ) -> bdist_dumb: ... @overload - def reinitialize_command(self, command: Literal["bdist_rpm"], reinit_subcommands: bool = False) -> bdist_rpm: ... + def reinitialize_command( + self, command: Literal["bdist_rpm"], reinit_subcommands: bool = False + ) -> bdist_rpm: ... @overload - def reinitialize_command(self, command: Literal["build"], reinit_subcommands: bool = False) -> build: ... + def reinitialize_command( + self, command: Literal["build"], reinit_subcommands: bool = False + ) -> build: ... @overload - def reinitialize_command(self, command: Literal["build_clib"], reinit_subcommands: bool = False) -> build_clib: ... + def reinitialize_command( + self, command: Literal["build_clib"], reinit_subcommands: bool = False + ) -> build_clib: ... @overload - def reinitialize_command(self, command: Literal["build_ext"], reinit_subcommands: bool = False) -> build_ext: ... + def reinitialize_command( + self, command: Literal["build_ext"], reinit_subcommands: bool = False + ) -> build_ext: ... @overload - def reinitialize_command(self, command: Literal["build_py"], reinit_subcommands: bool = False) -> build_py: ... + def reinitialize_command( + self, command: Literal["build_py"], reinit_subcommands: bool = False + ) -> build_py: ... @overload - def reinitialize_command(self, command: Literal["build_scripts"], reinit_subcommands: bool = False) -> build_scripts: ... + def reinitialize_command( + self, command: Literal["build_scripts"], reinit_subcommands: bool = False + ) -> build_scripts: ... @overload - def reinitialize_command(self, command: Literal["check"], reinit_subcommands: bool = False) -> check: ... + def reinitialize_command( + self, command: Literal["check"], reinit_subcommands: bool = False + ) -> check: ... @overload - def reinitialize_command(self, command: Literal["clean"], reinit_subcommands: bool = False) -> clean: ... + def reinitialize_command( + self, command: Literal["clean"], reinit_subcommands: bool = False + ) -> clean: ... @overload - def reinitialize_command(self, command: Literal["config"], reinit_subcommands: bool = False) -> config: ... + def reinitialize_command( + self, command: Literal["config"], reinit_subcommands: bool = False + ) -> config: ... @overload - def reinitialize_command(self, command: Literal["install"], reinit_subcommands: bool = False) -> install: ... + def reinitialize_command( + self, command: Literal["install"], reinit_subcommands: bool = False + ) -> install: ... @overload - def reinitialize_command(self, command: Literal["install_data"], reinit_subcommands: bool = False) -> install_data: ... + def reinitialize_command( + self, command: Literal["install_data"], reinit_subcommands: bool = False + ) -> install_data: ... @overload def reinitialize_command( self, command: Literal["install_egg_info"], reinit_subcommands: bool = False ) -> install_egg_info: ... @overload - def reinitialize_command(self, command: Literal["install_headers"], reinit_subcommands: bool = False) -> install_headers: ... + def reinitialize_command( + self, command: Literal["install_headers"], reinit_subcommands: bool = False + ) -> install_headers: ... @overload - def reinitialize_command(self, command: Literal["install_lib"], reinit_subcommands: bool = False) -> install_lib: ... + def reinitialize_command( + self, command: Literal["install_lib"], reinit_subcommands: bool = False + ) -> install_lib: ... @overload - def reinitialize_command(self, command: Literal["install_scripts"], reinit_subcommands: bool = False) -> install_scripts: ... + def reinitialize_command( + self, command: Literal["install_scripts"], reinit_subcommands: bool = False + ) -> install_scripts: ... @overload - def reinitialize_command(self, command: Literal["register"], reinit_subcommands: bool = False) -> register: ... + def reinitialize_command( + self, command: Literal["register"], reinit_subcommands: bool = False + ) -> register: ... @overload - def reinitialize_command(self, command: Literal["sdist"], reinit_subcommands: bool = False) -> sdist: ... + def reinitialize_command( + self, command: Literal["sdist"], reinit_subcommands: bool = False + ) -> sdist: ... @overload - def reinitialize_command(self, command: Literal["upload"], reinit_subcommands: bool = False) -> upload: ... + def reinitialize_command( + self, command: Literal["upload"], reinit_subcommands: bool = False + ) -> upload: ... @overload - def reinitialize_command(self, command: str, reinit_subcommands: bool = False) -> Command: ... + def reinitialize_command( + self, command: str, reinit_subcommands: bool = False + ) -> Command: ... @overload - def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False) -> _CommandT: ... + def reinitialize_command( + self, command: _CommandT, reinit_subcommands: bool = False + ) -> _CommandT: ... def announce(self, msg, level: int = 20) -> None: ... def run_commands(self) -> None: ... def run_command(self, command: str) -> None: ... diff --git a/typings/distutils-stubs/version.pyi b/typings/distutils-stubs/version.pyi index afb8aa3abe9..b0cee01b152 100644 --- a/typings/distutils-stubs/version.pyi +++ b/typings/distutils-stubs/version.pyi @@ -1,5 +1,6 @@ from abc import abstractmethod from re import Pattern + from typing_extensions import Self class Version: