From c03eb1caba6abcb2c8fc4e8b7c24fbc1db9569ad Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 22 Jul 2024 01:48:08 -0400 Subject: [PATCH 1/8] setuptools update from typing merge --- stdlib/distutils/cmd.pyi | 11 ++++-- stdlib/distutils/command/bdist.pyi | 6 +-- stdlib/distutils/command/bdist_dumb.pyi | 6 +-- stdlib/distutils/command/bdist_msi.pyi | 6 +-- stdlib/distutils/command/bdist_rpm.pyi | 8 ++-- stdlib/distutils/command/bdist_wininst.pyi | 4 +- stdlib/distutils/command/build.pyi | 4 +- stdlib/distutils/command/build_clib.pyi | 6 +-- stdlib/distutils/command/build_ext.pyi | 6 +-- stdlib/distutils/command/build_py.pyi | 8 ++-- stdlib/distutils/command/build_scripts.pyi | 6 +-- stdlib/distutils/command/check.pyi | 6 +-- stdlib/distutils/command/clean.pyi | 6 +-- stdlib/distutils/command/install.pyi | 6 +-- stdlib/distutils/command/install_data.pyi | 6 +-- stdlib/distutils/command/install_headers.pyi | 6 +-- stdlib/distutils/command/install_lib.pyi | 8 ++-- stdlib/distutils/command/install_scripts.pyi | 6 +-- stdlib/distutils/command/sdist.pyi | 6 +-- stubs/libsass/sassutils/distutils.pyi | 4 +- stubs/setuptools/setuptools/__init__.pyi | 11 ++++-- .../setuptools/setuptools/_distutils/cmd.pyi | 8 +++- .../setuptools/_distutils/command/bdist.pyi | 2 +- .../_distutils/command/bdist_rpm.pyi | 7 ++-- .../setuptools/_distutils/command/build.pyi | 5 ++- .../_distutils/command/build_clib.pyi | 5 ++- .../_distutils/command/build_ext.pyi | 5 ++- .../_distutils/command/build_py.pyi | 7 ++-- .../setuptools/_distutils/command/install.pyi | 7 ++-- .../_distutils/command/install_lib.pyi | 7 ++-- .../_distutils/command/install_scripts.pyi | 5 ++- .../setuptools/_distutils/command/sdist.pyi | 8 ++-- stubs/setuptools/setuptools/build_meta.pyi | 21 ++++------ stubs/setuptools/setuptools/command/alias.pyi | 11 +++--- .../setuptools/command/bdist_egg.pyi | 9 +++-- .../setuptools/command/bdist_wheel.pyi | 4 +- .../setuptools/command/build_ext.pyi | 16 ++++---- .../setuptools/command/build_py.pyi | 18 ++++----- .../setuptools/setuptools/command/develop.pyi | 23 ++++++----- .../setuptools/command/dist_info.pyi | 5 +-- .../setuptools/command/easy_install.pyi | 38 ++++++++++--------- .../setuptools/command/editable_wheel.pyi | 22 +++++------ .../setuptools/command/egg_info.pyi | 11 +++--- .../setuptools/setuptools/command/install.pyi | 13 ++++--- .../setuptools/command/install_egg_info.pyi | 13 ++++--- .../setuptools/command/install_lib.pyi | 6 +-- .../setuptools/setuptools/command/rotate.pyi | 13 ++++--- stubs/setuptools/setuptools/command/sdist.pyi | 13 ++++--- .../setuptools/setuptools/command/setopt.pyi | 25 ++++++------ stubs/setuptools/setuptools/command/test.pyi | 21 +++++----- .../setuptools/command/upload_docs.pyi | 7 ++-- .../setuptools/setuptools/config/__init__.pyi | 13 +++++-- stubs/setuptools/setuptools/config/expand.pyi | 2 +- .../setuptools/config/pyprojecttoml.pyi | 9 +++-- .../setuptools/setuptools/config/setupcfg.pyi | 25 ++++++------ stubs/setuptools/setuptools/depends.pyi | 4 +- stubs/setuptools/setuptools/discovery.pyi | 9 +++-- stubs/setuptools/setuptools/dist.pyi | 3 +- stubs/setuptools/setuptools/extension.pyi | 4 +- stubs/setuptools/setuptools/modified.pyi | 7 +--- stubs/setuptools/setuptools/msvc.pyi | 2 +- stubs/setuptools/setuptools/namespaces.pyi | 4 +- stubs/setuptools/setuptools/package_index.pyi | 30 ++++++++------- stubs/setuptools/setuptools/sandbox.pyi | 6 +-- stubs/setuptools/setuptools/warnings.pyi | 6 ++- stubs/setuptools/setuptools/wheel.pyi | 7 ++-- 66 files changed, 333 insertions(+), 289 deletions(-) diff --git a/stdlib/distutils/cmd.pyi b/stdlib/distutils/cmd.pyi index defea50e78dc..0762ab5e768b 100644 --- a/stdlib/distutils/cmd.pyi +++ b/stdlib/distutils/cmd.pyi @@ -3,7 +3,9 @@ from abc import abstractmethod from collections.abc import Callable, Iterable from distutils.dist import Distribution from distutils.file_util import _BytesPathT, _StrPathT -from typing import Any, ClassVar, Literal, overload +from typing import Any, ClassVar, Literal, TypeVar, overload + +_CommandT = TypeVar("_CommandT", bound=Command) class Command: distribution: Distribution @@ -19,13 +21,16 @@ class Command: def announce(self, msg: str, level: int = 1) -> None: ... def debug_print(self, msg: str) -> None: ... def ensure_string(self, option: str, default: str | None = None) -> None: ... - def ensure_string_list(self, option: str | list[str]) -> None: ... + def ensure_string_list(self, option: str) -> None: ... 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 get_finalized_command(self, command: str, create: bool | Literal[0, 1] = 1) -> Command: ... - def reinitialize_command(self, command: Command | str, reinit_subcommands: bool | Literal[0, 1] = 0) -> Command: ... + @overload + def reinitialize_command(self, command: str, reinit_subcommands: bool | Literal[0, 1] = 0) -> Command: ... + @overload + def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool | Literal[0, 1] = 0) -> _CommandT: ... def run_command(self, command: str) -> None: ... def get_sub_commands(self) -> list[str]: ... def warn(self, msg: str) -> None: ... diff --git a/stdlib/distutils/command/bdist.pyi b/stdlib/distutils/command/bdist.pyi index e1f141d3a40f..e395fd8f993c 100644 --- a/stdlib/distutils/command/bdist.pyi +++ b/stdlib/distutils/command/bdist.pyi @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command @@ -6,8 +6,8 @@ def show_formats() -> None: ... class bdist(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] help_options: Any no_format_option: Any default_format: Any diff --git a/stdlib/distutils/command/bdist_dumb.pyi b/stdlib/distutils/command/bdist_dumb.pyi index 74cca4d13cd0..c86f58718842 100644 --- a/stdlib/distutils/command/bdist_dumb.pyi +++ b/stdlib/distutils/command/bdist_dumb.pyi @@ -1,11 +1,11 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command class bdist_dumb(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] default_format: Any bdist_dir: Any plat_name: Any diff --git a/stdlib/distutils/command/bdist_msi.pyi b/stdlib/distutils/command/bdist_msi.pyi index d1eb374ff52b..d0eac1a3be5b 100644 --- a/stdlib/distutils/command/bdist_msi.pyi +++ b/stdlib/distutils/command/bdist_msi.pyi @@ -1,5 +1,5 @@ import sys -from typing import Any, Literal +from typing import Any, ClassVar, Literal from ..cmd import Command @@ -16,8 +16,8 @@ if sys.platform == "win32": class bdist_msi(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] all_versions: Any other_version: str if sys.version_info >= (3, 9): diff --git a/stdlib/distutils/command/bdist_rpm.pyi b/stdlib/distutils/command/bdist_rpm.pyi index 76691310b599..89c43e1b974c 100644 --- a/stdlib/distutils/command/bdist_rpm.pyi +++ b/stdlib/distutils/command/bdist_rpm.pyi @@ -1,12 +1,12 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command class bdist_rpm(Command): description: str - user_options: Any - boolean_options: Any - negative_opt: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] bdist_base: Any rpm_base: Any dist_dir: Any diff --git a/stdlib/distutils/command/bdist_wininst.pyi b/stdlib/distutils/command/bdist_wininst.pyi index 8491d3126200..cf333bc5400d 100644 --- a/stdlib/distutils/command/bdist_wininst.pyi +++ b/stdlib/distutils/command/bdist_wininst.pyi @@ -1,10 +1,10 @@ from _typeshed import StrOrBytesPath from distutils.cmd import Command -from typing import Any, ClassVar +from typing import ClassVar class bdist_wininst(Command): description: ClassVar[str] - user_options: ClassVar[list[tuple[Any, ...]]] + user_options: ClassVar[list[tuple[str, str | None, str]]] boolean_options: ClassVar[list[str]] def initialize_options(self) -> None: ... diff --git a/stdlib/distutils/command/build.pyi b/stdlib/distutils/command/build.pyi index 31fc036d4f97..98e5088108ab 100644 --- a/stdlib/distutils/command/build.pyi +++ b/stdlib/distutils/command/build.pyi @@ -7,8 +7,8 @@ def show_compilers() -> None: ... class build(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] help_options: Any build_base: str build_purelib: Any diff --git a/stdlib/distutils/command/build_clib.pyi b/stdlib/distutils/command/build_clib.pyi index 32ab182b30d0..e1349c7b27bc 100644 --- a/stdlib/distutils/command/build_clib.pyi +++ b/stdlib/distutils/command/build_clib.pyi @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command @@ -6,8 +6,8 @@ def show_compilers() -> None: ... class build_clib(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str, str]]] + boolean_options: ClassVar[list[str]] help_options: Any build_clib: Any build_temp: Any diff --git a/stdlib/distutils/command/build_ext.pyi b/stdlib/distutils/command/build_ext.pyi index 5eb541fb9101..ea0065dcd0f4 100644 --- a/stdlib/distutils/command/build_ext.pyi +++ b/stdlib/distutils/command/build_ext.pyi @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command @@ -9,8 +9,8 @@ def show_compilers() -> None: ... class build_ext(Command): description: str sep_by: Any - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] help_options: Any extensions: Any build_lib: Any diff --git a/stdlib/distutils/command/build_py.pyi b/stdlib/distutils/command/build_py.pyi index 4c607c6dabe9..90f06751416a 100644 --- a/stdlib/distutils/command/build_py.pyi +++ b/stdlib/distutils/command/build_py.pyi @@ -1,13 +1,13 @@ -from typing import Any, Literal +from typing import Any, ClassVar, Literal from ..cmd import Command from ..util import Mixin2to3 as Mixin2to3 class build_py(Command): description: str - user_options: Any - boolean_options: Any - negative_opt: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] build_lib: Any py_modules: Any package: Any diff --git a/stdlib/distutils/command/build_scripts.pyi b/stdlib/distutils/command/build_scripts.pyi index 42135eceafef..7871bb8a5719 100644 --- a/stdlib/distutils/command/build_scripts.pyi +++ b/stdlib/distutils/command/build_scripts.pyi @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command from ..util import Mixin2to3 as Mixin2to3 @@ -7,8 +7,8 @@ first_line_re: Any class build_scripts(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str, str]]] + boolean_options: ClassVar[list[str]] build_dir: Any scripts: Any force: Any diff --git a/stdlib/distutils/command/check.pyi b/stdlib/distutils/command/check.pyi index da041d82587d..c67e4cbfdfe0 100644 --- a/stdlib/distutils/command/check.pyi +++ b/stdlib/distutils/command/check.pyi @@ -1,4 +1,4 @@ -from typing import Any, Literal +from typing import Any, ClassVar, Literal from typing_extensions import TypeAlias from ..cmd import Command @@ -26,8 +26,8 @@ HAS_DOCUTILS: bool class check(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str, str]]] + boolean_options: ClassVar[list[str]] restructuredtext: int metadata: int strict: int diff --git a/stdlib/distutils/command/clean.pyi b/stdlib/distutils/command/clean.pyi index 99560aa8a716..55f0a0eeaf10 100644 --- a/stdlib/distutils/command/clean.pyi +++ b/stdlib/distutils/command/clean.pyi @@ -1,11 +1,11 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command class clean(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] build_base: Any build_lib: Any build_temp: Any diff --git a/stdlib/distutils/command/install.pyi b/stdlib/distutils/command/install.pyi index 8b2295d7a3c7..b0a5a82fc3f6 100644 --- a/stdlib/distutils/command/install.pyi +++ b/stdlib/distutils/command/install.pyi @@ -9,9 +9,9 @@ INSTALL_SCHEMES: dict[str, dict[Any, Any]] class install(Command): description: str - user_options: Any - boolean_options: Any - negative_opt: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] prefix: str | None exec_prefix: Any home: str | None diff --git a/stdlib/distutils/command/install_data.pyi b/stdlib/distutils/command/install_data.pyi index 6cc9b528ac9d..342c7a7ccca4 100644 --- a/stdlib/distutils/command/install_data.pyi +++ b/stdlib/distutils/command/install_data.pyi @@ -1,11 +1,11 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command class install_data(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] install_dir: Any outfiles: Any root: Any diff --git a/stdlib/distutils/command/install_headers.pyi b/stdlib/distutils/command/install_headers.pyi index 795bd1cf8356..7854d2393a98 100644 --- a/stdlib/distutils/command/install_headers.pyi +++ b/stdlib/distutils/command/install_headers.pyi @@ -1,11 +1,11 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command class install_headers(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str, str]]] + boolean_options: ClassVar[list[str]] install_dir: Any force: int outfiles: Any diff --git a/stdlib/distutils/command/install_lib.pyi b/stdlib/distutils/command/install_lib.pyi index a6a5e4e73f4c..718d082b7b07 100644 --- a/stdlib/distutils/command/install_lib.pyi +++ b/stdlib/distutils/command/install_lib.pyi @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command @@ -6,9 +6,9 @@ PYTHON_SOURCE_EXTENSION: str class install_lib(Command): description: str - user_options: Any - boolean_options: Any - negative_opt: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] install_dir: Any build_dir: Any force: int diff --git a/stdlib/distutils/command/install_scripts.pyi b/stdlib/distutils/command/install_scripts.pyi index 92728a16a747..5ee5589ad33d 100644 --- a/stdlib/distutils/command/install_scripts.pyi +++ b/stdlib/distutils/command/install_scripts.pyi @@ -1,11 +1,11 @@ -from typing import Any +from typing import Any, ClassVar from ..cmd import Command class install_scripts(Command): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] install_dir: Any force: int build_dir: Any diff --git a/stdlib/distutils/command/sdist.pyi b/stdlib/distutils/command/sdist.pyi index db303f77a463..24d16b05e719 100644 --- a/stdlib/distutils/command/sdist.pyi +++ b/stdlib/distutils/command/sdist.pyi @@ -8,10 +8,10 @@ def show_formats() -> None: ... class sdist(Command): description: str def checking_metadata(self): ... - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] help_options: Any - negative_opt: Any + negative_opt: ClassVar[dict[str, str]] # Any to work around variance issues sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] READMES: Any diff --git a/stubs/libsass/sassutils/distutils.pyi b/stubs/libsass/sassutils/distutils.pyi index 30948834652d..a4a74cb25e0e 100644 --- a/stubs/libsass/sassutils/distutils.pyi +++ b/stubs/libsass/sassutils/distutils.pyi @@ -1,3 +1,5 @@ +from typing import ClassVar + from sassutils.builder import Manifest as Manifest from setuptools import Command, Distribution @@ -5,7 +7,7 @@ def validate_manifests(dist: Distribution, attr: str, value: object) -> None: .. class build_sass(Command): description: str - user_options: list[tuple[str, str, str]] + user_options: ClassVar[list[tuple[str, str, str]]] package_dir: dict[str, str] | None output_style: str def initialize_options(self) -> None: ... diff --git a/stubs/setuptools/setuptools/__init__.pyi b/stubs/setuptools/setuptools/__init__.pyi index e16ea24497c6..06661fdb6282 100644 --- a/stubs/setuptools/setuptools/__init__.pyi +++ b/stubs/setuptools/setuptools/__init__.pyi @@ -1,7 +1,7 @@ from _typeshed import StrPath from abc import abstractmethod from collections.abc import Iterable, Mapping, Sequence -from typing import Any +from typing import Any, TypeVar, overload from ._distutils.cmd import Command as _Command from .depends import Require as Require @@ -9,6 +9,8 @@ from .dist import Distribution as Distribution from .extension import Extension as Extension from .warnings import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning +_CommandT = TypeVar("_CommandT", bound=Command) + __all__ = [ "setup", "Distribution", @@ -75,8 +77,11 @@ class Command(_Command): command_consumes_arguments: bool distribution: Distribution def __init__(self, dist: Distribution, **kw: Any) -> None: ... - def ensure_string_list(self, option: str | list[str]) -> None: ... - def reinitialize_command(self, command: _Command | str, reinit_subcommands: bool = False, **kw: Any) -> _Command: ... # type: ignore[override] + def ensure_string_list(self, option: str) -> None: ... + @overload # type:ignore[override] # Extra **kw param + def reinitialize_command(self, command: str, reinit_subcommands: bool = False, **kw) -> Command: ... + @overload + def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False, **kw) -> _CommandT: ... @abstractmethod def initialize_options(self) -> None: ... @abstractmethod diff --git a/stubs/setuptools/setuptools/_distutils/cmd.pyi b/stubs/setuptools/setuptools/_distutils/cmd.pyi index ee95d23c9486..fdd4fb222e3f 100644 --- a/stubs/setuptools/setuptools/_distutils/cmd.pyi +++ b/stubs/setuptools/setuptools/_distutils/cmd.pyi @@ -7,6 +7,7 @@ from .dist import Distribution _StrPathT = TypeVar("_StrPathT", bound=StrPath) _BytesPathT = TypeVar("_BytesPathT", bound=BytesPath) +_CommandT = TypeVar("_CommandT", bound=Command) class Command: distribution: Distribution @@ -23,13 +24,16 @@ class Command: def announce(self, msg: str, level: int = ...) -> None: ... def debug_print(self, msg: str) -> None: ... def ensure_string(self, option: str, default: str | None = ...) -> None: ... - def ensure_string_list(self, option: str | list[str]) -> None: ... + def ensure_string_list(self, option: str) -> None: ... 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 get_finalized_command(self, command: str, create: bool = True) -> Command: ... - def reinitialize_command(self, command: Command | str, reinit_subcommands: bool = False) -> Command: ... + @overload + def reinitialize_command(self, command: str, reinit_subcommands: bool = False) -> Command: ... + @overload + 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: ... diff --git a/stubs/setuptools/setuptools/_distutils/command/bdist.pyi b/stubs/setuptools/setuptools/_distutils/command/bdist.pyi index d12773033c5d..f455e8c48d09 100644 --- a/stubs/setuptools/setuptools/_distutils/command/bdist.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/bdist.pyi @@ -12,7 +12,7 @@ class ListCompat(dict[str, tuple[str, str]]): class bdist(Command): description: ClassVar[str] - user_options: ClassVar[list[tuple[str | None, str | None, str | None]]] + user_options: ClassVar[list[tuple[str, str | None, str | None]]] boolean_options: ClassVar[list[str]] help_options: ClassVar[list[tuple[str | None, ...]]] no_format_option: ClassVar[tuple[str, ...]] diff --git a/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi b/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi index 929b1b4a97a7..83b4161094c5 100644 --- a/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi @@ -1,12 +1,13 @@ from _typeshed import Incomplete +from typing import ClassVar from ..cmd import Command class bdist_rpm(Command): description: str - user_options: Incomplete - boolean_options: Incomplete - negative_opt: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] bdist_base: Incomplete rpm_base: Incomplete dist_dir: Incomplete diff --git a/stubs/setuptools/setuptools/_distutils/command/build.pyi b/stubs/setuptools/setuptools/_distutils/command/build.pyi index 02f82169ae2c..7ea3681a61cf 100644 --- a/stubs/setuptools/setuptools/_distutils/command/build.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/build.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from typing import ClassVar from ..cmd import Command @@ -6,8 +7,8 @@ def show_compilers() -> None: ... class build(Command): description: str - user_options: Incomplete - boolean_options: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] help_options: Incomplete build_base: str build_purelib: Incomplete diff --git a/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi b/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi index 5a9b049ad429..8d264a1128f6 100644 --- a/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi @@ -1,11 +1,12 @@ from _typeshed import Incomplete +from typing import ClassVar from ..cmd import Command class build_clib(Command): description: str - user_options: Incomplete - boolean_options: Incomplete + user_options: ClassVar[list[tuple[str, str, str]]] + boolean_options: ClassVar[list[str]] help_options: Incomplete build_clib: Incomplete build_temp: Incomplete diff --git a/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi b/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi index 67b31e7bb28f..22c9f19aa594 100644 --- a/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from typing import ClassVar from ..cmd import Command from ..extension import Extension @@ -6,8 +7,8 @@ from ..extension import Extension class build_ext(Command): description: str sep_by: Incomplete - user_options: Incomplete - boolean_options: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] help_options: Incomplete extensions: Incomplete build_lib: Incomplete diff --git a/stubs/setuptools/setuptools/_distutils/command/build_py.pyi b/stubs/setuptools/setuptools/_distutils/command/build_py.pyi index 314d97ff3625..67515b9bf052 100644 --- a/stubs/setuptools/setuptools/_distutils/command/build_py.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/build_py.pyi @@ -1,12 +1,13 @@ from _typeshed import Incomplete +from typing import ClassVar from ..cmd import Command class build_py(Command): description: str - user_options: Incomplete - boolean_options: Incomplete - negative_opt: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] build_lib: Incomplete py_modules: Incomplete package: Incomplete diff --git a/stubs/setuptools/setuptools/_distutils/command/install.pyi b/stubs/setuptools/setuptools/_distutils/command/install.pyi index 44f557e58314..8e092f7d6c08 100644 --- a/stubs/setuptools/setuptools/_distutils/command/install.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/install.pyi @@ -1,12 +1,13 @@ from _typeshed import Incomplete +from typing import ClassVar from ..cmd import Command class install(Command): description: str - user_options: Incomplete - boolean_options: Incomplete - negative_opt: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] prefix: str | None exec_prefix: Incomplete home: str | None diff --git a/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi b/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi index 694a23ba82f4..7edc148be97a 100644 --- a/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi @@ -1,12 +1,13 @@ from _typeshed import Incomplete +from typing import ClassVar from ..cmd import Command class install_lib(Command): description: str - user_options: Incomplete - boolean_options: Incomplete - negative_opt: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] install_dir: Incomplete build_dir: Incomplete force: int diff --git a/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi b/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi index fb20bf062aa3..b9eab32f9dd3 100644 --- a/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi @@ -1,11 +1,12 @@ from _typeshed import Incomplete +from typing import ClassVar from ..cmd import Command class install_scripts(Command): description: str - user_options: Incomplete - boolean_options: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] install_dir: Incomplete force: int build_dir: Incomplete diff --git a/stubs/setuptools/setuptools/_distutils/command/sdist.pyi b/stubs/setuptools/setuptools/_distutils/command/sdist.pyi index bb30ab1415af..db40a2b00343 100644 --- a/stubs/setuptools/setuptools/_distutils/command/sdist.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/sdist.pyi @@ -11,11 +11,11 @@ class sdist(Command): def checking_metadata(self): ... - user_options: Incomplete - boolean_options: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] help_options: Incomplete - negative_opt: Incomplete - READMES: Incomplete + negative_opt: ClassVar[dict[str, str]] + READMES: ClassVar[tuple[str, ...]] template: Incomplete manifest: Incomplete use_defaults: int diff --git a/stubs/setuptools/setuptools/build_meta.pyi b/stubs/setuptools/setuptools/build_meta.pyi index cf04af017fb1..fb3bcbaab48b 100644 --- a/stubs/setuptools/setuptools/build_meta.pyi +++ b/stubs/setuptools/setuptools/build_meta.pyi @@ -1,5 +1,4 @@ from _typeshed import StrPath -from collections.abc import Mapping from typing import Any from typing_extensions import TypeAlias @@ -31,22 +30,18 @@ class Distribution(dist.Distribution): class _BuildMetaBackend: def run_setup(self, setup_script: str = "setup.py") -> None: ... - def get_requires_for_build_wheel(self, config_settings: Mapping[str, Any] | None = None) -> list[str]: ... - def get_requires_for_build_sdist(self, config_settings: Mapping[str, Any] | None = None) -> list[str]: ... - def prepare_metadata_for_build_wheel( - self, metadata_directory: str, config_settings: Mapping[str, Any] | None = None - ) -> str: ... + def get_requires_for_build_wheel(self, config_settings: _ConfigSettings = None) -> list[str]: ... + def get_requires_for_build_sdist(self, config_settings: _ConfigSettings = None) -> list[str]: ... + def prepare_metadata_for_build_wheel(self, metadata_directory: str, config_settings: _ConfigSettings = None) -> str: ... def build_wheel( - self, wheel_directory: StrPath, config_settings: _ConfigSettings | None = None, metadata_directory: StrPath | None = None + self, wheel_directory: StrPath, config_settings: _ConfigSettings = None, metadata_directory: StrPath | None = None ) -> str: ... - def build_sdist(self, sdist_directory: StrPath, config_settings: _ConfigSettings | None = None) -> str: ... + def build_sdist(self, sdist_directory: StrPath, config_settings: _ConfigSettings = None) -> str: ... def build_editable( - self, wheel_directory: StrPath, config_settings: _ConfigSettings | None = None, metadata_directory: str | None = None - ) -> str: ... - def get_requires_for_build_editable(self, config_settings: Mapping[str, Any] | None = None) -> list[str]: ... - def prepare_metadata_for_build_editable( - self, metadata_directory: str, config_settings: Mapping[str, Any] | None = None + self, wheel_directory: StrPath, config_settings: _ConfigSettings = None, metadata_directory: StrPath | None = None ) -> str: ... + def get_requires_for_build_editable(self, config_settings: _ConfigSettings = None) -> list[str]: ... + def prepare_metadata_for_build_editable(self, metadata_directory: str, config_settings: _ConfigSettings = None) -> str: ... class _BuildMetaLegacyBackend(_BuildMetaBackend): def run_setup(self, setup_script: str = "setup.py") -> None: ... diff --git a/stubs/setuptools/setuptools/command/alias.pyi b/stubs/setuptools/setuptools/command/alias.pyi index 6486ffaa845a..cd3b4d9b5b74 100644 --- a/stubs/setuptools/setuptools/command/alias.pyi +++ b/stubs/setuptools/setuptools/command/alias.pyi @@ -1,4 +1,5 @@ -from typing import Any +from _typeshed import Incomplete +from typing import ClassVar from .setopt import option_base @@ -7,10 +8,10 @@ def shquote(arg): ... class alias(option_base): description: str command_consumes_arguments: bool - user_options: Any - boolean_options: Any - args: Any - remove: Any + user_options: ClassVar[list[tuple[str, str, str]]] + boolean_options: ClassVar[list[str]] + args: Incomplete + remove: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/bdist_egg.pyi b/stubs/setuptools/setuptools/command/bdist_egg.pyi index 356df96c7bee..9b0e76a6aae8 100644 --- a/stubs/setuptools/setuptools/command/bdist_egg.pyi +++ b/stubs/setuptools/setuptools/command/bdist_egg.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete from collections.abc import Generator +from typing import ClassVar from .. import Command @@ -9,8 +10,8 @@ def write_stub(resource, pyfile) -> None: ... class bdist_egg(Command): description: str - user_options: Incomplete - boolean_options: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] bdist_dir: Incomplete plat_name: Incomplete keep_temp: bool @@ -32,7 +33,7 @@ class bdist_egg(Command): def copy_metadata_to(self, target_dir) -> None: ... def get_ext_outputs(self): ... -NATIVE_EXTENSIONS: Incomplete +NATIVE_EXTENSIONS: dict[str, None] def walk_egg(egg_dir) -> Generator[Incomplete, None, None]: ... def analyze_egg(egg_dir, stubs): ... @@ -44,7 +45,7 @@ def scan_module(egg_dir, base, name, stubs): ... def iter_symbols(code) -> Generator[Incomplete, None, None]: ... def can_scan(): ... -INSTALL_DIRECTORY_ATTRS: Incomplete +INSTALL_DIRECTORY_ATTRS: list[str] def make_zipfile( zip_filename, base_dir, verbose: bool = False, dry_run: bool = False, compress: bool = True, mode: str = "w" diff --git a/stubs/setuptools/setuptools/command/bdist_wheel.pyi b/stubs/setuptools/setuptools/command/bdist_wheel.pyi index 9f416a7c4d82..822c8b539a80 100644 --- a/stubs/setuptools/setuptools/command/bdist_wheel.pyi +++ b/stubs/setuptools/setuptools/command/bdist_wheel.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Callable, Iterable from types import TracebackType -from typing import Any, ClassVar, Final, Literal +from typing import ClassVar, Final, Literal from setuptools import Command @@ -26,7 +26,7 @@ def remove_readonly_exc(func: Callable[..., object], path: str, exc: Exception) class bdist_wheel(Command): description: ClassVar[str] supported_compressions: ClassVar[dict[str, int]] - user_options: ClassVar[list[tuple[Any, ...]]] + user_options: ClassVar[list[tuple[str, str | None, str]]] boolean_options: ClassVar[list[str]] bdist_dir: str | None diff --git a/stubs/setuptools/setuptools/command/build_ext.pyi b/stubs/setuptools/setuptools/command/build_ext.pyi index 584bfbbc2765..8cd8c68e9c43 100644 --- a/stubs/setuptools/setuptools/command/build_ext.pyi +++ b/stubs/setuptools/setuptools/command/build_ext.pyi @@ -1,5 +1,7 @@ from _typeshed import Incomplete -from typing import Any, ClassVar +from typing import ClassVar + +from setuptools.extension import Library from .._distutils.command.build_ext import build_ext as _build_ext @@ -12,19 +14,19 @@ def get_abi3_suffix(): ... class build_ext(_build_ext): editable_mode: ClassVar[bool] - inplace: Any + inplace: bool def run(self) -> None: ... def copy_extensions_to_source(self) -> None: ... def get_ext_filename(self, fullname): ... - shlib_compiler: Any - shlibs: Any - ext_map: Any + shlib_compiler: Incomplete + shlibs: list[Library] + ext_map: dict[Incomplete, Incomplete] def initialize_options(self) -> None: ... - extensions: Any + extensions: list[Incomplete] def finalize_options(self) -> None: ... def setup_shlib_compiler(self) -> None: ... def get_export_symbols(self, ext): ... - compiler: Any + compiler: Incomplete def build_extension(self, ext) -> None: ... def links_to_dynamic(self, ext): ... def get_outputs(self): ... diff --git a/stubs/setuptools/setuptools/command/build_py.pyi b/stubs/setuptools/setuptools/command/build_py.pyi index ea6e94ea11bf..763eef8e25e5 100644 --- a/stubs/setuptools/setuptools/command/build_py.pyi +++ b/stubs/setuptools/setuptools/command/build_py.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete, StrPath -from typing import Any, ClassVar +from typing import ClassVar from .._distutils.cmd import _StrPathT from .._distutils.command import build_py as orig @@ -8,32 +8,32 @@ def make_writable(target) -> None: ... class build_py(orig.build_py): editable_mode: ClassVar[bool] - package_data: Any - exclude_package_data: Any + package_data: Incomplete + exclude_package_data: Incomplete def finalize_options(self) -> None: ... - def copy_file( # type: ignore[override] + def copy_file( # type: ignore[override] # No overload, str support only self, infile: StrPath, outfile: _StrPathT, preserve_mode: bool = True, preserve_times: bool = True, link: str | None = None, - level=1, + level: int = 1, ) -> tuple[_StrPathT | str, bool]: ... def run(self) -> None: ... - data_files: Any + data_files: list[Incomplete] def __getattr__(self, attr: str): ... def build_module(self, module, module_file, package): ... def get_data_files_without_manifest(self) -> list[tuple[Incomplete, Incomplete, Incomplete, list[Incomplete]]]: ... def find_data_files(self, package, src_dir): ... - def get_outputs(self, include_bytecode: bool = True) -> list[str]: ... # type: ignore[override] + def get_outputs(self, include_bytecode: bool = True) -> list[str]: ... # type: ignore[override] # Using a real boolean instead of 0|1 def build_package_data(self) -> None: ... - manifest_files: Any + manifest_files: dict[Incomplete, Incomplete] def get_output_mapping(self) -> dict[str, str]: ... def analyze_manifest(self) -> None: ... def get_data_files(self) -> None: ... def check_package(self, package, package_dir): ... - packages_checked: Any + packages_checked: dict[Incomplete, Incomplete] def initialize_options(self) -> None: ... def get_package_dir(self, package): ... def exclude_data_files(self, package, src_dir, files): ... diff --git a/stubs/setuptools/setuptools/command/develop.pyi b/stubs/setuptools/setuptools/command/develop.pyi index ebefbc2d49b7..7aa8288f0e0a 100644 --- a/stubs/setuptools/setuptools/command/develop.pyi +++ b/stubs/setuptools/setuptools/command/develop.pyi @@ -1,24 +1,27 @@ -from typing import Any +from _typeshed import Incomplete +from typing import ClassVar + +from pkg_resources import Distribution from .. import namespaces from .easy_install import easy_install class develop(namespaces.DevelopInstaller, easy_install): description: str - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] command_consumes_arguments: bool multi_version: bool def run(self) -> None: ... # type: ignore[override] - uninstall: Any - egg_path: Any - setup_path: Any + uninstall: Incomplete + egg_path: Incomplete + setup_path: Incomplete always_copy_from: str def initialize_options(self) -> None: ... - args: Any - egg_link: Any - egg_base: Any - dist: Any + args: list[Incomplete] + egg_link: Incomplete + egg_base: Incomplete + dist: Distribution def finalize_options(self) -> None: ... def install_for_development(self) -> None: ... def uninstall_link(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/dist_info.pyi b/stubs/setuptools/setuptools/command/dist_info.pyi index 723a764d7ba3..1343b926905b 100644 --- a/stubs/setuptools/setuptools/command/dist_info.pyi +++ b/stubs/setuptools/setuptools/command/dist_info.pyi @@ -1,13 +1,12 @@ -from typing import Any, ClassVar +from typing import ClassVar from .._distutils.cmd import Command class dist_info(Command): description: str - user_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] boolean_options: ClassVar[list[str]] negative_opt: ClassVar[dict[str, str]] - egg_base: Any def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/easy_install.pyi b/stubs/setuptools/setuptools/command/easy_install.pyi index 9700eabb193f..1407b0a439f4 100644 --- a/stubs/setuptools/setuptools/command/easy_install.pyi +++ b/stubs/setuptools/setuptools/command/easy_install.pyi @@ -1,9 +1,10 @@ from _typeshed import Incomplete from collections.abc import Iterable, Iterator -from typing import ClassVar, TypedDict +from typing import Any, ClassVar, Literal, TypedDict, type_check_only from typing_extensions import Self from pkg_resources import Environment +from setuptools.package_index import PackageIndex from .. import Command, SetuptoolsDeprecationWarning @@ -12,10 +13,10 @@ __all__ = ["easy_install", "PthDistributions", "extract_wininst_cfg", "get_exe_p class easy_install(Command): description: str command_consumes_arguments: bool - user_options: Incomplete - boolean_options: Incomplete - negative_opt: Incomplete - create_index: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] + create_index: ClassVar[type[PackageIndex]] user: bool zip_ok: Incomplete install_dir: Incomplete @@ -36,22 +37,22 @@ class easy_install(Command): install_data: Incomplete install_base: Incomplete install_platbase: Incomplete - install_userbase: Incomplete - install_usersite: Incomplete + install_userbase: str | None + install_usersite: str | None no_find_links: Incomplete package_index: Incomplete pth_file: Incomplete site_dirs: Incomplete installed_projects: Incomplete - verbose: Incomplete + verbose: bool | Literal[0, 1] def initialize_options(self) -> None: ... def delete_blockers(self, blockers) -> None: ... - config_vars: Incomplete + config_vars: dict[str, Any] script_dir: Incomplete - all_site_dirs: Incomplete - shadow_path: Incomplete - local_index: Incomplete - outputs: Incomplete + all_site_dirs: list[str] + shadow_path: list[str] + local_index: Environment + outputs: list[Incomplete] def finalize_options(self) -> None: ... def expand_basedirs(self) -> None: ... def expand_dirs(self) -> None: ... @@ -89,8 +90,8 @@ class easy_install(Command): def unpack_and_compile(self, egg_path, destination): ... def byte_compile(self, to_compile) -> None: ... def create_home_path(self) -> None: ... - INSTALL_SCHEMES: Incomplete - DEFAULT_SCHEME: Incomplete + INSTALL_SCHEMES: dict[str, dict[str, str]] + DEFAULT_SCHEME: dict[str, str] def extract_wininst_cfg(dist_filename): ... def get_exe_prefixes(exe_filename): ... @@ -98,7 +99,7 @@ def get_exe_prefixes(exe_filename): ... class PthDistributions(Environment): dirty: bool filename: Incomplete - sitedirs: Incomplete + sitedirs: list[str] basedir: Incomplete paths: list[str] def __init__(self, filename, sitedirs=()) -> None: ... @@ -108,9 +109,10 @@ class PthDistributions(Environment): def make_relative(self, path): ... class RewritePthDistributions(PthDistributions): - prelude: Incomplete - postlude: Incomplete + prelude: str + postlude: str +@type_check_only class _SplitArgs(TypedDict, total=False): comments: bool posix: bool diff --git a/stubs/setuptools/setuptools/command/editable_wheel.pyi b/stubs/setuptools/setuptools/command/editable_wheel.pyi index 18d5bec23827..e8f637bd0c1d 100644 --- a/stubs/setuptools/setuptools/command/editable_wheel.pyi +++ b/stubs/setuptools/setuptools/command/editable_wheel.pyi @@ -3,7 +3,7 @@ from collections.abc import Iterator from enum import Enum from pathlib import Path from types import TracebackType -from typing import Protocol +from typing import ClassVar, Protocol from typing_extensions import Self, TypeAlias from .. import Command, errors, namespaces @@ -22,13 +22,13 @@ class _EditableMode(Enum): class editable_wheel(Command): description: str - user_options: Incomplete + user_options: ClassVar[list[tuple[str, str | None, str]]] dist_dir: Incomplete dist_info_dir: Incomplete project_dir: Incomplete mode: Incomplete def initialize_options(self) -> None: ... - package_dir: Incomplete + package_dir: dict[Incomplete, Incomplete] def finalize_options(self) -> None: ... def run(self) -> None: ... @@ -40,9 +40,9 @@ class EditableStrategy(Protocol): ) -> None: ... class _StaticPth: - dist: Incomplete - name: Incomplete - path_entries: Incomplete + dist: Distribution + name: str + path_entries: list[Path] def __init__(self, dist: Distribution, name: str, path_entries: list[Path]) -> None: ... def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]): ... def __enter__(self) -> Self: ... @@ -51,8 +51,8 @@ class _StaticPth: ) -> None: ... class _LinkTree(_StaticPth): - auxiliary_dir: Incomplete - build_lib: Incomplete + auxiliary_dir: Path + build_lib: Path def __init__(self, dist: Distribution, name: str, auxiliary_dir: StrPath, build_lib: StrPath) -> None: ... def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]): ... def __enter__(self) -> Self: ... @@ -61,8 +61,8 @@ class _LinkTree(_StaticPth): ) -> None: ... class _TopLevelFinder: - dist: Incomplete - name: Incomplete + dist: Distribution + name: str def __init__(self, dist: Distribution, name: str) -> None: ... def template_vars(self) -> tuple[str, str, dict[str, str], dict[str, list[str]]]: ... def get_implementation(self) -> Iterator[tuple[str, bytes]]: ... @@ -77,7 +77,7 @@ class _NamespaceInstaller(namespaces.Installer): src_root: Incomplete installation_dir: Incomplete editable_name: Incomplete - outputs: Incomplete + outputs: list[Incomplete] dry_run: bool def __init__(self, distribution, installation_dir, editable_name, src_root) -> None: ... diff --git a/stubs/setuptools/setuptools/command/egg_info.pyi b/stubs/setuptools/setuptools/command/egg_info.pyi index b5fba6b76335..c318c8134638 100644 --- a/stubs/setuptools/setuptools/command/egg_info.pyi +++ b/stubs/setuptools/setuptools/command/egg_info.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from typing import Final +from typing import ClassVar, Final from .. import Command, SetuptoolsDeprecationWarning from .._distutils.filelist import FileList as _FileList @@ -21,14 +21,13 @@ class InfoCommon: class egg_info(InfoCommon, Command): description: str - user_options: Incomplete - boolean_options: Incomplete - negative_opt: Incomplete + user_options: ClassVar[list[tuple[str, str, str]]] + boolean_options: ClassVar[list[str]] + negative_opt: ClassVar[dict[str, str]] egg_base: Incomplete egg_name: Incomplete egg_info: Incomplete egg_version: Incomplete - broken_egg_info: bool def initialize_options(self) -> None: ... @property def tag_svn_revision(self) -> None: ... @@ -65,7 +64,7 @@ class manifest_maker(sdist): force_manifest: bool def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... - filelist: Incomplete + filelist: FileList def run(self) -> None: ... def write_manifest(self) -> None: ... def warn(self, msg) -> None: ... diff --git a/stubs/setuptools/setuptools/command/install.pyi b/stubs/setuptools/setuptools/command/install.pyi index b5fa8d634047..d5f499e7403d 100644 --- a/stubs/setuptools/setuptools/command/install.pyi +++ b/stubs/setuptools/setuptools/command/install.pyi @@ -1,18 +1,19 @@ +from _typeshed import Incomplete from collections.abc import Callable -from typing import Any +from typing import Any, ClassVar from .._distutils.command import install as orig class install(orig.install): - user_options: Any - boolean_options: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + boolean_options: ClassVar[list[str]] # Any to work around variance issues new_commands: list[tuple[str, Callable[[Any], bool]] | None] - old_and_unmanageable: Any - single_version_externally_managed: Any + old_and_unmanageable: Incomplete + single_version_externally_managed: bool | None def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... - path_file: Any + path_file: Incomplete extra_dirs: str def handle_extra_path(self): ... def run(self): ... diff --git a/stubs/setuptools/setuptools/command/install_egg_info.pyi b/stubs/setuptools/setuptools/command/install_egg_info.pyi index a37c98cca4fd..d1a8dd4fef53 100644 --- a/stubs/setuptools/setuptools/command/install_egg_info.pyi +++ b/stubs/setuptools/setuptools/command/install_egg_info.pyi @@ -1,15 +1,16 @@ -from typing import Any +from _typeshed import Incomplete +from typing import ClassVar from .. import Command, namespaces class install_egg_info(namespaces.Installer, Command): description: str - user_options: Any - install_dir: Any + user_options: ClassVar[list[tuple[str, str, str]]] + install_dir: Incomplete def initialize_options(self) -> None: ... - source: Any - target: Any - outputs: Any + source: Incomplete + target: str + outputs: list[Incomplete] def finalize_options(self) -> None: ... def run(self) -> None: ... def get_outputs(self): ... diff --git a/stubs/setuptools/setuptools/command/install_lib.pyi b/stubs/setuptools/setuptools/command/install_lib.pyi index 79e3e59e0405..2da4a2e50bc8 100644 --- a/stubs/setuptools/setuptools/command/install_lib.pyi +++ b/stubs/setuptools/setuptools/command/install_lib.pyi @@ -9,9 +9,9 @@ class install_lib(orig.install_lib): self, infile: StrPath, outfile: str, - preserve_mode: bool = True, # type: ignore[override] - preserve_times: bool = True, # type: ignore[override] - preserve_symlinks: bool = False, # type: ignore[override] + preserve_mode: bool = True, + preserve_times: bool = True, + preserve_symlinks: bool = False, level: Unused = 1, ): ... def get_outputs(self): ... diff --git a/stubs/setuptools/setuptools/command/rotate.pyi b/stubs/setuptools/setuptools/command/rotate.pyi index 7deb47389fb2..653a380bc29a 100644 --- a/stubs/setuptools/setuptools/command/rotate.pyi +++ b/stubs/setuptools/setuptools/command/rotate.pyi @@ -1,14 +1,15 @@ -from typing import Any +from _typeshed import Incomplete +from typing import ClassVar from .. import Command class rotate(Command): description: str - user_options: Any - boolean_options: list[str] - match: Any - dist_dir: Any - keep: Any + user_options: ClassVar[list[tuple[str, str, str]]] + boolean_options: ClassVar[list[str]] + match: Incomplete + dist_dir: Incomplete + keep: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/sdist.pyi b/stubs/setuptools/setuptools/command/sdist.pyi index fe4b59d73dad..1dba62b5ba1e 100644 --- a/stubs/setuptools/setuptools/command/sdist.pyi +++ b/stubs/setuptools/setuptools/command/sdist.pyi @@ -1,15 +1,16 @@ -from typing import Any +from _typeshed import Incomplete +from typing import ClassVar from .._distutils.command import sdist as orig def walk_revctrl(dirname: str = "") -> None: ... class sdist(orig.sdist): - user_options: Any - negative_opt: Any - README_EXTENSIONS: Any - READMES: Any - filelist: Any + user_options: ClassVar[list[tuple[str, str | None, str]]] + negative_opt: ClassVar[dict[str, str]] + README_EXTENSIONS: ClassVar[list[str]] + READMES: ClassVar[tuple[str, ...]] + filelist: Incomplete def run(self) -> None: ... def initialize_options(self) -> None: ... def make_distribution(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/setopt.pyi b/stubs/setuptools/setuptools/command/setopt.pyi index c57c3601d5ff..0e16758cf7f4 100644 --- a/stubs/setuptools/setuptools/command/setopt.pyi +++ b/stubs/setuptools/setuptools/command/setopt.pyi @@ -1,5 +1,6 @@ +from _typeshed import Incomplete from abc import abstractmethod -from typing import Any +from typing import ClassVar from .. import Command @@ -9,11 +10,11 @@ def config_file(kind: str = "local"): ... def edit_config(filename, settings, dry_run: bool = False) -> None: ... class option_base(Command): - user_options: Any - boolean_options: Any - global_config: Any - user_config: Any - filename: Any + user_options: ClassVar[list[tuple[str, str, str]]] + boolean_options: ClassVar[list[str]] + global_config: Incomplete + user_config: Incomplete + filename: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... @abstractmethod @@ -21,12 +22,12 @@ class option_base(Command): class setopt(option_base): description: str - user_options: Any - boolean_options: Any - command: Any - option: Any - set_value: Any - remove: Any + user_options: ClassVar[list[tuple[str, str, str]]] + boolean_options: ClassVar[list[str]] + command: Incomplete + option: Incomplete + set_value: Incomplete + remove: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/command/test.pyi b/stubs/setuptools/setuptools/command/test.pyi index c475e1d097bc..3c2c22673f13 100644 --- a/stubs/setuptools/setuptools/command/test.pyi +++ b/stubs/setuptools/setuptools/command/test.pyi @@ -1,33 +1,34 @@ from _typeshed import Incomplete, Unused from collections.abc import Callable from types import ModuleType -from typing import Any, Generic, TypeVar, overload +from typing import ClassVar, Generic, TypeVar, overload from typing_extensions import Self from unittest import TestLoader, TestSuite from .. import Command _T = TypeVar("_T") +_R = TypeVar("_R") class ScanningLoader(TestLoader): def __init__(self) -> None: ... def loadTestsFromModule(self, module: ModuleType, pattern: Incomplete | None = None) -> list[TestSuite]: ... # type: ignore[override] -class NonDataProperty(Generic[_T]): - fget: Callable[..., _T] - def __init__(self, fget: Callable[..., _T]) -> None: ... +class NonDataProperty(Generic[_T, _R]): + fget: Callable[[_T], _R] + def __init__(self, fget: Callable[[_T], _R]) -> None: ... @overload def __get__(self, obj: None, objtype: Unused = None) -> Self: ... @overload - def __get__(self, obj: Any, objtype: Unused = None) -> _T: ... + def __get__(self, obj: _T, objtype: Unused = None) -> _R: ... class test(Command): description: str - user_options: Any - test_suite: Any - test_module: Any - test_loader: Any - test_runner: Any + user_options: ClassVar[list[tuple[str, str, str]]] + test_suite: Incomplete + test_module: Incomplete + test_loader: Incomplete + test_runner: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... @NonDataProperty diff --git a/stubs/setuptools/setuptools/command/upload_docs.pyi b/stubs/setuptools/setuptools/command/upload_docs.pyi index 57e0c20ec7e2..3e75d483e019 100644 --- a/stubs/setuptools/setuptools/command/upload_docs.pyi +++ b/stubs/setuptools/setuptools/command/upload_docs.pyi @@ -1,3 +1,4 @@ +from _typeshed import Incomplete from collections.abc import Callable from typing import Any, ClassVar @@ -7,12 +8,12 @@ class upload_docs(upload): DEFAULT_REPOSITORY: ClassVar[str] description: ClassVar[str] user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] + boolean_options = upload.boolean_options def has_sphinx(self): ... # Any to work around variance issues sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] - upload_dir: Any - target_dir: Any + upload_dir: Incomplete + target_dir: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def create_zipfile(self, filename) -> None: ... diff --git a/stubs/setuptools/setuptools/config/__init__.pyi b/stubs/setuptools/setuptools/config/__init__.pyi index ca745c9194b9..dbb468cd5d8c 100644 --- a/stubs/setuptools/setuptools/config/__init__.pyi +++ b/stubs/setuptools/setuptools/config/__init__.pyi @@ -1,9 +1,16 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, StrPath from collections.abc import Callable from typing import TypeVar +from setuptools.config.setupcfg import AllCommandOptions, ConfigMetadataHandler, ConfigOptionsHandler +from setuptools.dist import Distribution + Fn = TypeVar("Fn", bound=Callable[..., Incomplete]) # noqa: Y001 # Exists at runtime __all__ = ("parse_configuration", "read_configuration") -def read_configuration(filepath, find_others: bool = False, ignore_option_errors: bool = False): ... -def parse_configuration(distribution, command_options, ignore_option_errors: bool = False): ... +def read_configuration( + filepath: StrPath, find_others: bool = False, ignore_option_errors: bool = False +) -> dict[Incomplete, Incomplete]: ... +def parse_configuration( + distribution: Distribution, command_options: AllCommandOptions, ignore_option_errors: bool = False +) -> tuple[ConfigMetadataHandler, ConfigOptionsHandler]: ... diff --git a/stubs/setuptools/setuptools/config/expand.pyi b/stubs/setuptools/setuptools/config/expand.pyi index 8695c8605db1..ef5a0de5f660 100644 --- a/stubs/setuptools/setuptools/config/expand.pyi +++ b/stubs/setuptools/setuptools/config/expand.pyi @@ -12,7 +12,7 @@ _VCo = TypeVar("_VCo", covariant=True) class StaticModule: def __init__(self, name: str, spec: ModuleSpec) -> None: ... - def __getattr__(self, attr): ... + def __getattr__(self, attr: str): ... def glob_relative(patterns: Iterable[str], root_dir: StrPath | None = None) -> list[str]: ... def read_files(filepaths: StrPath | Iterable[StrPath], root_dir: StrPath | None = None) -> str: ... diff --git a/stubs/setuptools/setuptools/config/pyprojecttoml.pyi b/stubs/setuptools/setuptools/config/pyprojecttoml.pyi index 69f75652fae3..e61686654dfe 100644 --- a/stubs/setuptools/setuptools/config/pyprojecttoml.pyi +++ b/stubs/setuptools/setuptools/config/pyprojecttoml.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete, StrPath from types import TracebackType +from typing import Any from typing_extensions import Self from ..dist import Distribution @@ -11,7 +12,7 @@ def validate(config: dict[Incomplete, Incomplete], filepath: StrPath) -> bool: . def apply_configuration(dist: Distribution, filepath: StrPath, ignore_option_errors: bool = False) -> Distribution: ... def read_configuration( filepath: StrPath, expand: bool = True, ignore_option_errors: bool = False, dist: Distribution | None = None -): ... +) -> dict[str, Any]: ... def expand_configuration( config: dict[Incomplete, Incomplete], root_dir: StrPath | None = None, @@ -20,13 +21,13 @@ def expand_configuration( ) -> dict[Incomplete, Incomplete]: ... class _ConfigExpander: - config: Incomplete - root_dir: Incomplete + config: dict[Incomplete, Incomplete] + root_dir: StrPath project_cfg: Incomplete dynamic: Incomplete setuptools_cfg: Incomplete dynamic_cfg: Incomplete - ignore_option_errors: Incomplete + ignore_option_errors: bool def __init__( self, config: dict[Incomplete, Incomplete], diff --git a/stubs/setuptools/setuptools/config/setupcfg.pyi b/stubs/setuptools/setuptools/config/setupcfg.pyi index c231699aa817..f3ee84e961d0 100644 --- a/stubs/setuptools/setuptools/config/setupcfg.pyi +++ b/stubs/setuptools/setuptools/config/setupcfg.pyi @@ -1,12 +1,13 @@ from _typeshed import Incomplete, StrPath -from typing import Generic, TypeVar +from typing import Any, Generic, TypeVar +from typing_extensions import TypeAlias from .._distutils.dist import DistributionMetadata from ..dist import Distribution from . import expand -SingleCommandOptions: Incomplete -AllCommandOptions: Incomplete +SingleCommandOptions: TypeAlias = dict[str, tuple[str, Any]] +AllCommandOptions: TypeAlias = dict[str, SingleCommandOptions] Target = TypeVar("Target", bound=Distribution | DistributionMetadata) # noqa: Y001 # Exists at runtime def read_configuration( @@ -24,10 +25,10 @@ class ConfigHandler(Generic[Target]): section_prefix: str aliases: dict[str, str] ignore_option_errors: Incomplete - target_obj: Incomplete - sections: Incomplete - set_options: Incomplete - ensure_discovered: Incomplete + target_obj: Target + sections: dict[str, SingleCommandOptions] + set_options: list[str] + ensure_discovered: expand.EnsurePackagesDiscovered def __init__( self, target_obj: Target, @@ -43,10 +44,10 @@ class ConfigHandler(Generic[Target]): class ConfigMetadataHandler(ConfigHandler[DistributionMetadata]): section_prefix: str - aliases: Incomplete + aliases: dict[str, str] strict_mode: bool - package_dir: Incomplete - root_dir: Incomplete + package_dir: dict[Incomplete, Incomplete] | None + root_dir: StrPath def __init__( self, target_obj: DistributionMetadata, @@ -61,8 +62,8 @@ class ConfigMetadataHandler(ConfigHandler[DistributionMetadata]): class ConfigOptionsHandler(ConfigHandler[Distribution]): section_prefix: str - root_dir: Incomplete - package_dir: Incomplete + root_dir: str | None + package_dir: dict[str, str] def __init__( self, target_obj: Distribution, diff --git a/stubs/setuptools/setuptools/depends.pyi b/stubs/setuptools/setuptools/depends.pyi index c6376a641247..d47ac2d77af5 100644 --- a/stubs/setuptools/setuptools/depends.pyi +++ b/stubs/setuptools/setuptools/depends.pyi @@ -23,5 +23,5 @@ class Require: def is_present(self, paths: Incomplete | None = None): ... def is_current(self, paths: Incomplete | None = None): ... -def get_module_constant(module, symbol, default: int = -1, paths: Incomplete | None = None): ... -def extract_constant(code, symbol, default: int = -1): ... +def get_module_constant(module, symbol, default: str | int = -1, paths: Incomplete | None = None) -> Any: ... +def extract_constant(code, symbol, default: str | int = -1) -> Any: ... diff --git a/stubs/setuptools/setuptools/discovery.pyi b/stubs/setuptools/setuptools/discovery.pyi index 3a7635696675..16703597f440 100644 --- a/stubs/setuptools/setuptools/discovery.pyi +++ b/stubs/setuptools/setuptools/discovery.pyi @@ -1,3 +1,4 @@ +import itertools from _typeshed import Incomplete, StrPath from collections.abc import Iterable, Iterator, Mapping from typing_extensions import TypeAlias @@ -5,7 +6,7 @@ from typing_extensions import TypeAlias from . import Distribution StrIter: TypeAlias = Iterator[str] -chain_iter: Incomplete +chain_iter = itertools.chain.from_iterable class _Filter: def __init__(self, *patterns: str) -> None: ... @@ -19,16 +20,16 @@ class _Finder: def find(cls, where: StrPath = ".", exclude: Iterable[str] = (), include: Iterable[str] = ("*",)) -> list[str]: ... class PackageFinder(_Finder): - ALWAYS_EXCLUDE: Incomplete + ALWAYS_EXCLUDE: tuple[str, ...] class PEP420PackageFinder(PackageFinder): ... class ModuleFinder(_Finder): ... class FlatLayoutPackageFinder(PEP420PackageFinder): - DEFAULT_EXCLUDE: Incomplete + DEFAULT_EXCLUDE: tuple[str, ...] class FlatLayoutModuleFinder(ModuleFinder): - DEFAULT_EXCLUDE: Incomplete + DEFAULT_EXCLUDE: tuple[str, ...] class ConfigDiscovery: dist: Incomplete diff --git a/stubs/setuptools/setuptools/dist.pyi b/stubs/setuptools/setuptools/dist.pyi index 6c9cba974c75..fe2e76f635c1 100644 --- a/stubs/setuptools/setuptools/dist.pyi +++ b/stubs/setuptools/setuptools/dist.pyi @@ -1,3 +1,4 @@ +from _typeshed import StrPath from collections.abc import Iterable, Iterator, MutableMapping from typing import Any @@ -13,7 +14,7 @@ class Distribution(_Distribution): def __init__(self, attrs: MutableMapping[str, Any] | None = None) -> None: ... def warn_dash_deprecation(self, opt: str, section: str) -> str: ... def make_option_lowercase(self, opt: str, section: str) -> str: ... - def parse_config_files(self, filenames: Iterable[str] | None = None, ignore_option_errors: bool = False) -> None: ... + def parse_config_files(self, filenames: Iterable[StrPath] | None = None, ignore_option_errors: bool = False) -> None: ... def fetch_build_eggs(self, requires: str | Iterable[str]): ... def get_egg_cache_dir(self) -> str: ... def fetch_build_egg(self, req): ... diff --git a/stubs/setuptools/setuptools/extension.pyi b/stubs/setuptools/setuptools/extension.pyi index f32953d158bf..6cb7d7aad9dd 100644 --- a/stubs/setuptools/setuptools/extension.pyi +++ b/stubs/setuptools/setuptools/extension.pyi @@ -1,8 +1,6 @@ -from typing import Any - from ._distutils.extension import Extension as _Extension -have_pyrex: Any +def have_pyrex() -> bool: ... class Extension(_Extension): py_limited_api: bool diff --git a/stubs/setuptools/setuptools/modified.pyi b/stubs/setuptools/setuptools/modified.pyi index 3148cc626dc6..0437d4efc3ed 100644 --- a/stubs/setuptools/setuptools/modified.pyi +++ b/stubs/setuptools/setuptools/modified.pyi @@ -1,8 +1,3 @@ -from ._distutils._modified import ( - newer as newer, - newer_group as newer_group, - newer_pairwise as newer_pairwise, - newer_pairwise_group as newer_pairwise_group, -) +from ._distutils._modified import newer, newer_group, newer_pairwise, newer_pairwise_group __all__ = ["newer", "newer_pairwise", "newer_group", "newer_pairwise_group"] diff --git a/stubs/setuptools/setuptools/msvc.pyi b/stubs/setuptools/setuptools/msvc.pyi index 6ad7b176a91b..8abb08acfc83 100644 --- a/stubs/setuptools/setuptools/msvc.pyi +++ b/stubs/setuptools/setuptools/msvc.pyi @@ -87,7 +87,7 @@ class EnvironmentInfo: pi: Incomplete ri: Incomplete si: Incomplete - def __init__(self, arch, vc_ver: Incomplete | None = None, vc_min_ver: int = 0) -> None: ... + def __init__(self, arch, vc_ver: Incomplete | None = None, vc_min_ver: float = 0) -> None: ... @property def vs_ver(self): ... @property diff --git a/stubs/setuptools/setuptools/namespaces.pyi b/stubs/setuptools/setuptools/namespaces.pyi index b85fcec71da8..9170ecfdd5e6 100644 --- a/stubs/setuptools/setuptools/namespaces.pyi +++ b/stubs/setuptools/setuptools/namespaces.pyi @@ -1,6 +1,6 @@ -from typing import Any +import itertools -flatten: Any +flatten = itertools.chain.from_iterable class Installer: nspkg_ext: str diff --git a/stubs/setuptools/setuptools/package_index.pyi b/stubs/setuptools/setuptools/package_index.pyi index b32b580b1665..a1e3108c948b 100644 --- a/stubs/setuptools/setuptools/package_index.pyi +++ b/stubs/setuptools/setuptools/package_index.pyi @@ -1,6 +1,8 @@ import configparser from _typeshed import Incomplete -from typing import Any +from hashlib import _Hash +from re import Pattern +from urllib.request import urlopen from pkg_resources import Environment @@ -18,10 +20,10 @@ class ContentChecker: def report(self, reporter, template) -> None: ... class HashChecker(ContentChecker): - pattern: Any - hash_name: Any - hash: Any - expected: Any + pattern: Pattern[str] + hash_name: Incomplete + hash: _Hash + expected: Incomplete def __init__(self, hash_name, expected) -> None: ... @classmethod def from_url(cls, url): ... @@ -30,13 +32,13 @@ class HashChecker(ContentChecker): def report(self, reporter, template): ... class PackageIndex(Environment): - index_url: Any - scanned_urls: Any - fetched_urls: Any - package_pages: Any - allows: Any - to_scan: Any - opener: Any + index_url: str + scanned_urls: dict[Incomplete, Incomplete] + fetched_urls: dict[Incomplete, Incomplete] + package_pages: dict[Incomplete, Incomplete] + allows = Pattern().match + to_scan: list[Incomplete] + opener = urlopen def __init__( self, index_url: str = "https://pypi.org/simple/", @@ -81,8 +83,8 @@ class PackageIndex(Environment): def warn(self, msg, *args) -> None: ... class Credential: - username: Any - password: Any + username: Incomplete + password: Incomplete def __init__(self, username, password) -> None: ... def __iter__(self): ... diff --git a/stubs/setuptools/setuptools/sandbox.pyi b/stubs/setuptools/setuptools/sandbox.pyi index 32328ac7cac5..d083c3b1e345 100644 --- a/stubs/setuptools/setuptools/sandbox.pyi +++ b/stubs/setuptools/setuptools/sandbox.pyi @@ -1,6 +1,6 @@ import sys from types import TracebackType -from typing import Any, Literal +from typing import Literal from typing_extensions import Self from ._distutils.errors import DistutilsError @@ -56,10 +56,10 @@ class AbstractSandbox: def utime(self, path, *args, **kw): ... class DirectorySandbox(AbstractSandbox): - write_ops: Any + write_ops: dict[str, None] def __init__(self, sandbox, exceptions=...) -> None: ... def tmpnam(self) -> None: ... def open(self, file, flags, mode: int = 511, *args, **kw): ... # type: ignore[override] class SandboxViolation(DistutilsError): - tmpl: Any + tmpl: str diff --git a/stubs/setuptools/setuptools/warnings.pyi b/stubs/setuptools/setuptools/warnings.pyi index b75a929b68db..6bb52b66dc9c 100644 --- a/stubs/setuptools/setuptools/warnings.pyi +++ b/stubs/setuptools/setuptools/warnings.pyi @@ -1,10 +1,14 @@ +from typing_extensions import TypeAlias + +_DueDate: TypeAlias = tuple[int, int, int] # time tuple + class SetuptoolsWarning(UserWarning): @classmethod def emit( cls, summary: str | None = None, details: str | None = None, - due_date: tuple[int, int, int] | None = None, + due_date: _DueDate | None = None, see_docs: str | None = None, see_url: str | None = None, stacklevel: int = 2, diff --git a/stubs/setuptools/setuptools/wheel.pyi b/stubs/setuptools/setuptools/wheel.pyi index eeb7eee24b54..1f298a928014 100644 --- a/stubs/setuptools/setuptools/wheel.pyi +++ b/stubs/setuptools/setuptools/wheel.pyi @@ -1,14 +1,15 @@ +from _typeshed import Incomplete from collections.abc import Generator -from typing import Any +from re import Pattern -WHEEL_NAME: Any +WHEEL_NAME = Pattern().match NAMESPACE_PACKAGE_INIT: str def unpack(src_dir, dst_dir) -> None: ... def disable_info_traces() -> Generator[None, None, None]: ... class Wheel: - filename: Any + filename: Incomplete def __init__(self, filename) -> None: ... def tags(self): ... def is_compatible(self): ... From 2e4091b796ff9e3174f938e6ed1206383a7950ac Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 22 Jul 2024 02:00:31 -0400 Subject: [PATCH 2/8] pytype fix --- stubs/setuptools/setuptools/package_index.pyi | 2 +- stubs/setuptools/setuptools/wheel.pyi | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/stubs/setuptools/setuptools/package_index.pyi b/stubs/setuptools/setuptools/package_index.pyi index a1e3108c948b..bd2cfc5c7675 100644 --- a/stubs/setuptools/setuptools/package_index.pyi +++ b/stubs/setuptools/setuptools/package_index.pyi @@ -36,7 +36,7 @@ class PackageIndex(Environment): scanned_urls: dict[Incomplete, Incomplete] fetched_urls: dict[Incomplete, Incomplete] package_pages: dict[Incomplete, Incomplete] - allows = Pattern().match + allows: Incomplete to_scan: list[Incomplete] opener = urlopen def __init__( diff --git a/stubs/setuptools/setuptools/wheel.pyi b/stubs/setuptools/setuptools/wheel.pyi index 1f298a928014..240e43d1ec59 100644 --- a/stubs/setuptools/setuptools/wheel.pyi +++ b/stubs/setuptools/setuptools/wheel.pyi @@ -1,8 +1,7 @@ from _typeshed import Incomplete from collections.abc import Generator -from re import Pattern -WHEEL_NAME = Pattern().match +WHEEL_NAME: Incomplete NAMESPACE_PACKAGE_INIT: str def unpack(src_dir, dst_dir) -> None: ... From 99d2f9991c7e557150ce1d8c3226724331cc7b61 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 22 Jul 2024 02:16:13 -0400 Subject: [PATCH 3/8] dicts to mapping --- stubs/setuptools/setuptools/build_meta.pyi | 3 ++- stubs/setuptools/setuptools/command/editable_wheel.pyi | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/stubs/setuptools/setuptools/build_meta.pyi b/stubs/setuptools/setuptools/build_meta.pyi index fb3bcbaab48b..beeeed14b940 100644 --- a/stubs/setuptools/setuptools/build_meta.pyi +++ b/stubs/setuptools/setuptools/build_meta.pyi @@ -1,4 +1,5 @@ from _typeshed import StrPath +from collections.abc import Mapping from typing import Any from typing_extensions import TypeAlias @@ -17,7 +18,7 @@ __all__ = [ "SetupRequirementsError", ] -_ConfigSettings: TypeAlias = dict[str, str | list[str] | None] | None +_ConfigSettings: TypeAlias = Mapping[str, str | list[str] | None] | None class SetupRequirementsError(BaseException): specifiers: Any diff --git a/stubs/setuptools/setuptools/command/editable_wheel.pyi b/stubs/setuptools/setuptools/command/editable_wheel.pyi index e8f637bd0c1d..3d8f73bcc0b6 100644 --- a/stubs/setuptools/setuptools/command/editable_wheel.pyi +++ b/stubs/setuptools/setuptools/command/editable_wheel.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete, StrPath -from collections.abc import Iterator +from collections.abc import Iterator, Mapping from enum import Enum from pathlib import Path from types import TracebackType @@ -33,7 +33,7 @@ class editable_wheel(Command): def run(self) -> None: ... class EditableStrategy(Protocol): - def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]) -> None: ... + def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]) -> None: ... def __enter__(self): ... def __exit__( self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None @@ -44,7 +44,7 @@ class _StaticPth: name: str path_entries: list[Path] def __init__(self, dist: Distribution, name: str, path_entries: list[Path]) -> None: ... - def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]): ... + def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ... def __enter__(self) -> Self: ... def __exit__( self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None @@ -54,7 +54,7 @@ class _LinkTree(_StaticPth): auxiliary_dir: Path build_lib: Path def __init__(self, dist: Distribution, name: str, auxiliary_dir: StrPath, build_lib: StrPath) -> None: ... - def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]): ... + def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ... def __enter__(self) -> Self: ... def __exit__( self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None @@ -66,7 +66,7 @@ class _TopLevelFinder: def __init__(self, dist: Distribution, name: str) -> None: ... def template_vars(self) -> tuple[str, str, dict[str, str], dict[str, list[str]]]: ... def get_implementation(self) -> Iterator[tuple[str, bytes]]: ... - def __call__(self, wheel: _WheelFile, files: list[str], mapping: dict[str, str]): ... + def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ... def __enter__(self) -> Self: ... def __exit__( self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None From 33750e56e5218d055276d63b4c02822720726867 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 22 Jul 2024 12:13:53 -0400 Subject: [PATCH 4/8] More correct Command base class for reinitialize_command --- stubs/setuptools/setuptools/__init__.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stubs/setuptools/setuptools/__init__.pyi b/stubs/setuptools/setuptools/__init__.pyi index 06661fdb6282..f324ed7e1581 100644 --- a/stubs/setuptools/setuptools/__init__.pyi +++ b/stubs/setuptools/setuptools/__init__.pyi @@ -9,7 +9,7 @@ from .dist import Distribution as Distribution from .extension import Extension as Extension from .warnings import SetuptoolsDeprecationWarning as SetuptoolsDeprecationWarning -_CommandT = TypeVar("_CommandT", bound=Command) +_CommandT = TypeVar("_CommandT", bound=_Command) __all__ = [ "setup", @@ -78,8 +78,8 @@ class Command(_Command): distribution: Distribution def __init__(self, dist: Distribution, **kw: Any) -> None: ... def ensure_string_list(self, option: str) -> None: ... - @overload # type:ignore[override] # Extra **kw param - def reinitialize_command(self, command: str, reinit_subcommands: bool = False, **kw) -> Command: ... + @overload # type: ignore[override] # Extra **kw param + def reinitialize_command(self, command: str, reinit_subcommands: bool = False, **kw) -> _Command: ... @overload def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False, **kw) -> _CommandT: ... @abstractmethod From 633477349cefca409496dfa877af3b146d0f9b72 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 23 Jul 2024 14:47:04 -0400 Subject: [PATCH 5/8] Discard changes to stubs/setuptools/setuptools/command/alias.pyi --- stubs/setuptools/setuptools/command/alias.pyi | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stubs/setuptools/setuptools/command/alias.pyi b/stubs/setuptools/setuptools/command/alias.pyi index cd3b4d9b5b74..a3cf5e8df29c 100644 --- a/stubs/setuptools/setuptools/command/alias.pyi +++ b/stubs/setuptools/setuptools/command/alias.pyi @@ -1,5 +1,4 @@ -from _typeshed import Incomplete -from typing import ClassVar +from typing import Any, ClassVar from .setopt import option_base @@ -10,8 +9,8 @@ class alias(option_base): command_consumes_arguments: bool user_options: ClassVar[list[tuple[str, str, str]]] boolean_options: ClassVar[list[str]] - args: Incomplete - remove: Incomplete + args: Any + remove: Any def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... From d184c0988674b9f4b4969a29c87066b86d70e30c Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 23 Jul 2024 14:48:31 -0400 Subject: [PATCH 6/8] Discard changes to stubs/setuptools/setuptools/command/build_ext.pyi --- .../setuptools/setuptools/command/build_ext.pyi | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/stubs/setuptools/setuptools/command/build_ext.pyi b/stubs/setuptools/setuptools/command/build_ext.pyi index 8cd8c68e9c43..584bfbbc2765 100644 --- a/stubs/setuptools/setuptools/command/build_ext.pyi +++ b/stubs/setuptools/setuptools/command/build_ext.pyi @@ -1,7 +1,5 @@ from _typeshed import Incomplete -from typing import ClassVar - -from setuptools.extension import Library +from typing import Any, ClassVar from .._distutils.command.build_ext import build_ext as _build_ext @@ -14,19 +12,19 @@ def get_abi3_suffix(): ... class build_ext(_build_ext): editable_mode: ClassVar[bool] - inplace: bool + inplace: Any def run(self) -> None: ... def copy_extensions_to_source(self) -> None: ... def get_ext_filename(self, fullname): ... - shlib_compiler: Incomplete - shlibs: list[Library] - ext_map: dict[Incomplete, Incomplete] + shlib_compiler: Any + shlibs: Any + ext_map: Any def initialize_options(self) -> None: ... - extensions: list[Incomplete] + extensions: Any def finalize_options(self) -> None: ... def setup_shlib_compiler(self) -> None: ... def get_export_symbols(self, ext): ... - compiler: Incomplete + compiler: Any def build_extension(self, ext) -> None: ... def links_to_dynamic(self, ext): ... def get_outputs(self): ... From 24a8081f8b476b55b9507867bf56083f15820278 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 23 Jul 2024 14:54:09 -0400 Subject: [PATCH 7/8] Discard changes to stubs/setuptools/setuptools/command/develop.pyi --- .../setuptools/setuptools/command/develop.pyi | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/stubs/setuptools/setuptools/command/develop.pyi b/stubs/setuptools/setuptools/command/develop.pyi index 7aa8288f0e0a..2690ff1b43bf 100644 --- a/stubs/setuptools/setuptools/command/develop.pyi +++ b/stubs/setuptools/setuptools/command/develop.pyi @@ -1,7 +1,4 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from pkg_resources import Distribution +from typing import Any, ClassVar from .. import namespaces from .easy_install import easy_install @@ -13,15 +10,15 @@ class develop(namespaces.DevelopInstaller, easy_install): command_consumes_arguments: bool multi_version: bool def run(self) -> None: ... # type: ignore[override] - uninstall: Incomplete - egg_path: Incomplete - setup_path: Incomplete + uninstall: Any + egg_path: Any + setup_path: Any always_copy_from: str def initialize_options(self) -> None: ... - args: list[Incomplete] - egg_link: Incomplete - egg_base: Incomplete - dist: Distribution + args: Any + egg_link: Any + egg_base: Any + dist: Any def finalize_options(self) -> None: ... def install_for_development(self) -> None: ... def uninstall_link(self) -> None: ... From 7e8f7eea914bc84663402f18ed377aa65e7dec5a Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 23 Jul 2024 14:58:39 -0400 Subject: [PATCH 8/8] Discard changes to stubs/setuptools/setuptools/wheel.pyi --- stubs/setuptools/setuptools/wheel.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stubs/setuptools/setuptools/wheel.pyi b/stubs/setuptools/setuptools/wheel.pyi index 240e43d1ec59..eeb7eee24b54 100644 --- a/stubs/setuptools/setuptools/wheel.pyi +++ b/stubs/setuptools/setuptools/wheel.pyi @@ -1,14 +1,14 @@ -from _typeshed import Incomplete from collections.abc import Generator +from typing import Any -WHEEL_NAME: Incomplete +WHEEL_NAME: Any NAMESPACE_PACKAGE_INIT: str def unpack(src_dir, dst_dir) -> None: ... def disable_info_traces() -> Generator[None, None, None]: ... class Wheel: - filename: Incomplete + filename: Any def __init__(self, filename) -> None: ... def tags(self): ... def is_compatible(self): ...