From f3afde931f2036f9bba19bdb9996b313d886828e Mon Sep 17 00:00:00 2001 From: donBarbos Date: Sun, 4 May 2025 17:34:40 +0400 Subject: [PATCH 1/2] Bump setuptools to 80.3.* --- stubs/setuptools/METADATA.toml | 2 +- stubs/setuptools/setuptools/_scripts.pyi | 46 ++++++ .../setuptools/command/easy_install.pyi | 152 +----------------- stubs/setuptools/setuptools/package_index.pyi | 99 ------------ 4 files changed, 53 insertions(+), 246 deletions(-) create mode 100644 stubs/setuptools/setuptools/_scripts.pyi delete mode 100644 stubs/setuptools/setuptools/package_index.pyi diff --git a/stubs/setuptools/METADATA.toml b/stubs/setuptools/METADATA.toml index f41550888041..9e2fd9acc0a1 100644 --- a/stubs/setuptools/METADATA.toml +++ b/stubs/setuptools/METADATA.toml @@ -1,4 +1,4 @@ -version = "80.1.*" +version = "80.3.*" upstream_repository = "https://github.com/pypa/setuptools" extra_description = """\ Given that `pkg_resources` is typed since `setuptools >= 71.1`, \ diff --git a/stubs/setuptools/setuptools/_scripts.pyi b/stubs/setuptools/setuptools/_scripts.pyi new file mode 100644 index 000000000000..43d7a60606fa --- /dev/null +++ b/stubs/setuptools/setuptools/_scripts.pyi @@ -0,0 +1,46 @@ +from _typeshed import Incomplete, Unused +from collections.abc import Iterable, Iterator +from typing import ClassVar, Literal, TypedDict +from typing_extensions import Self + +class _SplitArgs(TypedDict, total=False): + comments: bool + posix: bool + +class CommandSpec(list[str]): + options: list[str] + split_args: ClassVar[_SplitArgs] + @classmethod + def best(cls) -> type[CommandSpec]: ... + @classmethod + def from_param(cls, param: Self | str | Iterable[str] | None) -> Self: ... + @classmethod + def from_environment(cls) -> CommandSpec: ... + @classmethod + def from_string(cls, string: str) -> CommandSpec: ... + def install_options(self, script_text: str) -> None: ... + def as_header(self) -> str: ... + +class WindowsCommandSpec(CommandSpec): ... + +class ScriptWriter: + template: ClassVar[str] + command_spec_class: ClassVar[type[CommandSpec]] + @classmethod + def get_args(cls, dist, header: Incomplete | None = None) -> Iterator[tuple[str, str]]: ... + @classmethod + def best(cls) -> type[ScriptWriter]: ... + @classmethod + def get_header(cls, script_text: str = "", executable: str | CommandSpec | Iterable[str] | None = None) -> str: ... + +class WindowsScriptWriter(ScriptWriter): + command_spec_class: ClassVar[type[WindowsCommandSpec]] + @classmethod + def best(cls) -> type[WindowsScriptWriter]: ... + +class WindowsExecutableLauncherWriter(WindowsScriptWriter): ... + +def get_win_launcher(type: Literal["cli", "gui"]) -> bytes: ... +def load_launcher_manifest(name: Unused) -> str: ... +def is_64bit() -> bool: ... +def isascii(s: str) -> bool: ... diff --git a/stubs/setuptools/setuptools/command/easy_install.pyi b/stubs/setuptools/setuptools/command/easy_install.pyi index 0f79115b0e3b..101bc1d69449 100644 --- a/stubs/setuptools/setuptools/command/easy_install.pyi +++ b/stubs/setuptools/setuptools/command/easy_install.pyi @@ -1,151 +1,11 @@ -from _typeshed import Incomplete -from collections.abc import Iterable, Iterator -from typing import Any, ClassVar, Literal, NoReturn, TypedDict -from typing_extensions import Self +from abc import abstractmethod -from pkg_resources import Distribution, Environment -from setuptools.package_index import PackageIndex - -from .. import Command, SetuptoolsDeprecationWarning - -__all__ = ["PthDistributions", "easy_install", "extract_wininst_cfg", "get_exe_prefixes"] +from setuptools import Command class easy_install(Command): - description: str - command_consumes_arguments: bool - 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 - index_url: Incomplete - find_links: Incomplete - build_directory: Incomplete - args: Incomplete - optimize: Incomplete - upgrade: Incomplete - editable: Incomplete - root: Incomplete - version: Incomplete - install_purelib: Incomplete - install_platlib: Incomplete - install_headers: Incomplete - install_lib: Incomplete - install_scripts: Incomplete - install_data: Incomplete - install_base: Incomplete - install_platbase: 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: bool | Literal[0, 1] + @abstractmethod def initialize_options(self) -> None: ... - def delete_blockers(self, blockers) -> None: ... - config_vars: dict[str, Any] - script_dir: Incomplete - all_site_dirs: list[str] - shadow_path: list[str] - local_index: Environment - outputs: list[str] + @abstractmethod def finalize_options(self) -> None: ... - def expand_basedirs(self) -> None: ... - def expand_dirs(self) -> None: ... - def run(self, show_deprecation: bool = True) -> NoReturn: ... - def pseudo_tempname(self): ... - def warn_deprecated_options(self) -> None: ... - def check_site_dir(self) -> None: ... - def cant_write_to_target(self) -> NoReturn: ... - def check_pth_processing(self): ... - def install_egg_scripts(self, dist) -> None: ... - def add_output(self, path) -> None: ... - def not_editable(self, spec) -> None: ... - def check_editable(self, spec) -> None: ... - def easy_install(self, spec, deps: bool = False) -> Distribution | None: ... - def install_item(self, spec, download, tmpdir, deps, install_needed: bool = False) -> Distribution | None: ... - def select_scheme(self, name) -> None: ... - def process_distribution(self, requirement, dist, deps: bool = True, *info) -> None: ... - def should_unzip(self, dist) -> bool: ... - def maybe_move(self, spec, dist_filename, setup_base): ... - def install_wrapper_scripts(self, dist) -> None: ... - def install_script(self, dist, script_name, script_text, dev_path: Incomplete | None = None) -> None: ... - def write_script(self, script_name, contents, mode: str = "t", blockers=()) -> None: ... - def install_eggs(self, spec, dist_filename, tmpdir) -> list[Distribution]: ... - def egg_distribution(self, egg_path): ... - def install_egg(self, egg_path, tmpdir): ... - def install_exe(self, dist_filename, tmpdir): ... - def exe_to_egg(self, dist_filename, egg_tmp) -> None: ... - def install_wheel(self, wheel_path, tmpdir): ... - def installation_report(self, req, dist, what: str = "Installed") -> str: ... - def report_editable(self, spec, setup_script): ... - def run_setup(self, setup_script, setup_base, args) -> NoReturn: ... - def build_and_install(self, setup_script, setup_base): ... - def update_pth(self, dist) -> None: ... - def unpack_progress(self, src, dst): ... - def unpack_and_compile(self, egg_path, destination): ... - def byte_compile(self, to_compile) -> None: ... - def create_home_path(self) -> None: ... - INSTALL_SCHEMES: ClassVar[dict[str, dict[str, str]]] - DEFAULT_SCHEME: ClassVar[dict[str, str]] - -def extract_wininst_cfg(dist_filename): ... -def get_exe_prefixes(exe_filename): ... - -class PthDistributions(Environment): - dirty: bool - filename: Incomplete - sitedirs: list[str] - basedir: Incomplete - paths: list[str] - def __init__(self, filename, sitedirs=()) -> None: ... - def save(self) -> None: ... - def add(self, dist) -> None: ... - def remove(self, dist) -> None: ... - def make_relative(self, path): ... - -class RewritePthDistributions(PthDistributions): - prelude: str - postlude: str - -class _SplitArgs(TypedDict, total=False): - comments: bool - posix: bool - -class CommandSpec(list[str]): - options: list[str] - split_args: ClassVar[_SplitArgs] - @classmethod - def best(cls) -> type[CommandSpec]: ... - @classmethod - def from_param(cls, param: Self | str | Iterable[str] | None) -> Self: ... - @classmethod - def from_environment(cls) -> CommandSpec: ... - @classmethod - def from_string(cls, string: str) -> CommandSpec: ... - def install_options(self, script_text: str) -> None: ... - def as_header(self) -> str: ... - -class WindowsCommandSpec(CommandSpec): ... - -class ScriptWriter: - template: ClassVar[str] - command_spec_class: ClassVar[type[CommandSpec]] - @classmethod - def get_args(cls, dist, header: Incomplete | None = None) -> Iterator[tuple[str, str]]: ... - @classmethod - def best(cls) -> type[ScriptWriter]: ... - @classmethod - def get_header(cls, script_text: str = "", executable: str | CommandSpec | Iterable[str] | None = None) -> str: ... - -class WindowsScriptWriter(ScriptWriter): - command_spec_class: ClassVar[type[WindowsCommandSpec]] - @classmethod - def best(cls) -> type[WindowsScriptWriter]: ... - -class WindowsExecutableLauncherWriter(WindowsScriptWriter): ... -class EasyInstallDeprecationWarning(SetuptoolsDeprecationWarning): ... + @abstractmethod + def run(self) -> None: ... diff --git a/stubs/setuptools/setuptools/package_index.pyi b/stubs/setuptools/setuptools/package_index.pyi deleted file mode 100644 index 37871ddfe342..000000000000 --- a/stubs/setuptools/setuptools/package_index.pyi +++ /dev/null @@ -1,99 +0,0 @@ -import configparser -import urllib.request -from _typeshed import Incomplete -from collections.abc import Generator -from hashlib import _Hash -from re import Pattern -from typing import ClassVar -from typing_extensions import NamedTuple - -from pkg_resources import Distribution, Environment - -__all__ = ["PackageIndex", "distros_for_url", "parse_bdist_wininst", "interpret_distro_name"] - -def parse_bdist_wininst(name): ... -def distros_for_url(url, metadata: Incomplete | None = None) -> Generator[Distribution]: ... -def distros_for_location( - location, basename, metadata: Incomplete | None = None -) -> list[Distribution] | Generator[Distribution]: ... -def interpret_distro_name( - location, basename, metadata, py_version: Incomplete | None = None, precedence=1, platform: Incomplete | None = None -) -> Generator[Distribution]: ... - -class ContentChecker: - def feed(self, block) -> None: ... - def is_valid(self): ... - def report(self, reporter, template) -> None: ... - -class HashChecker(ContentChecker): - pattern: ClassVar[Pattern[str]] - hash_name: Incomplete - hash: _Hash - expected: Incomplete - def __init__(self, hash_name, expected) -> None: ... - @classmethod - def from_url(cls, url): ... - def feed(self, block) -> None: ... - def is_valid(self): ... - def report(self, reporter, template): ... - -class PackageIndex(Environment): - index_url: str - scanned_urls: dict[Incomplete, Incomplete] - fetched_urls: dict[Incomplete, Incomplete] - package_pages: dict[Incomplete, Incomplete] - allows: Incomplete - to_scan: list[Incomplete] - opener = urllib.request.urlopen - def __init__( - self, - index_url: str = "https://pypi.org/simple/", - hosts=("*",), - ca_bundle: Incomplete | None = None, - verify_ssl: bool = True, - *args, - **kw, - ) -> None: ... - def process_url(self, url, retrieve: bool = False) -> None: ... - def process_filename(self, fn, nested: bool = False) -> None: ... - def url_ok(self, url, fatal: bool = False): ... - def scan_egg_links(self, search_path) -> None: ... - def scan_egg_link(self, path, entry) -> None: ... - def process_index(self, url, page): ... - def need_version_info(self, url) -> None: ... - def scan_all(self, msg: Incomplete | None = None, *args) -> None: ... - def find_packages(self, requirement) -> None: ... - def obtain(self, requirement, installer: Incomplete | None = None): ... - def check_hash(self, checker, filename, tfp) -> None: ... - def add_find_links(self, urls) -> None: ... - def prescan(self) -> None: ... - def not_found_in_index(self, requirement) -> None: ... - def download(self, spec, tmpdir): ... - def fetch_distribution( - self, - requirement, - tmpdir, - force_scan: bool = False, - source: bool = False, - develop_ok: bool = False, - local_index: Incomplete | None = None, - ): ... - def fetch(self, requirement, tmpdir, force_scan: bool = False, source: bool = False): ... - def gen_setup(self, filename, fragment, tmpdir): ... - dl_blocksize: int - def reporthook(self, url, filename, blocknum, blksize, size) -> None: ... - def open_url(self, url, warning: Incomplete | None = None): ... - def scan_url(self, url) -> None: ... - def debug(self, msg, *args) -> None: ... - def info(self, msg, *args) -> None: ... - def warn(self, msg, *args) -> None: ... - -class Credential(NamedTuple): - username: str - password: str - -class PyPIConfig(configparser.RawConfigParser): - def __init__(self) -> None: ... - @property - def creds_by_repository(self): ... - def find_credential(self, url): ... From abbe41b5df70744c21c501377fbef626cdd93cbb Mon Sep 17 00:00:00 2001 From: donBarbos Date: Mon, 5 May 2025 04:11:02 +0400 Subject: [PATCH 2/2] Remove private file --- stubs/setuptools/setuptools/_scripts.pyi | 46 ------------------------ 1 file changed, 46 deletions(-) delete mode 100644 stubs/setuptools/setuptools/_scripts.pyi diff --git a/stubs/setuptools/setuptools/_scripts.pyi b/stubs/setuptools/setuptools/_scripts.pyi deleted file mode 100644 index 43d7a60606fa..000000000000 --- a/stubs/setuptools/setuptools/_scripts.pyi +++ /dev/null @@ -1,46 +0,0 @@ -from _typeshed import Incomplete, Unused -from collections.abc import Iterable, Iterator -from typing import ClassVar, Literal, TypedDict -from typing_extensions import Self - -class _SplitArgs(TypedDict, total=False): - comments: bool - posix: bool - -class CommandSpec(list[str]): - options: list[str] - split_args: ClassVar[_SplitArgs] - @classmethod - def best(cls) -> type[CommandSpec]: ... - @classmethod - def from_param(cls, param: Self | str | Iterable[str] | None) -> Self: ... - @classmethod - def from_environment(cls) -> CommandSpec: ... - @classmethod - def from_string(cls, string: str) -> CommandSpec: ... - def install_options(self, script_text: str) -> None: ... - def as_header(self) -> str: ... - -class WindowsCommandSpec(CommandSpec): ... - -class ScriptWriter: - template: ClassVar[str] - command_spec_class: ClassVar[type[CommandSpec]] - @classmethod - def get_args(cls, dist, header: Incomplete | None = None) -> Iterator[tuple[str, str]]: ... - @classmethod - def best(cls) -> type[ScriptWriter]: ... - @classmethod - def get_header(cls, script_text: str = "", executable: str | CommandSpec | Iterable[str] | None = None) -> str: ... - -class WindowsScriptWriter(ScriptWriter): - command_spec_class: ClassVar[type[WindowsCommandSpec]] - @classmethod - def best(cls) -> type[WindowsScriptWriter]: ... - -class WindowsExecutableLauncherWriter(WindowsScriptWriter): ... - -def get_win_launcher(type: Literal["cli", "gui"]) -> bytes: ... -def load_launcher_manifest(name: Unused) -> str: ... -def is_64bit() -> bool: ... -def isascii(s: str) -> bool: ...