From 12c451c70b8727c2ef65d62121a2cdd0215e2d9f Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Wed, 30 Aug 2023 11:19:37 +0100 Subject: [PATCH] setuptools: add various missing objects and annotations --- stubs/setuptools/setuptools/_distutils/ccompiler.pyi | 11 ++++++++++- stubs/setuptools/setuptools/_distutils/cmd.pyi | 1 + .../setuptools/_distutils/command/build_ext.pyi | 5 +++-- stubs/setuptools/setuptools/logging.pyi | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/stubs/setuptools/setuptools/_distutils/ccompiler.pyi b/stubs/setuptools/setuptools/_distutils/ccompiler.pyi index 96a756bb2cf8..4182c90441f5 100644 --- a/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +++ b/stubs/setuptools/setuptools/_distutils/ccompiler.pyi @@ -1,5 +1,5 @@ from collections.abc import Callable -from typing import Any +from typing import Any, ClassVar from typing_extensions import TypeAlias _Macro: TypeAlias = tuple[str] | tuple[str, str | None] @@ -15,6 +15,15 @@ def new_compiler( def show_compilers() -> None: ... class CCompiler: + src_extensions: ClassVar[list[str] | None] + obj_extensions: ClassVar[str | None] + static_lib_extension: ClassVar[str | None] + shared_lib_extension: ClassVar[str | None] + static_lib_format: ClassVar[str | None] + shared_lib_format: ClassVar[str | None] + exe_extension: ClassVar[str | None] + language_map: ClassVar[dict[str, str]] + language_order: ClassVar[list[str]] dry_run: bool force: bool verbose: bool diff --git a/stubs/setuptools/setuptools/_distutils/cmd.pyi b/stubs/setuptools/setuptools/_distutils/cmd.pyi index 3c05f26805a2..7a4f6fc7ba9c 100644 --- a/stubs/setuptools/setuptools/_distutils/cmd.pyi +++ b/stubs/setuptools/setuptools/_distutils/cmd.pyi @@ -10,6 +10,7 @@ class Command: distribution: Distribution sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]] def __init__(self, dist: Distribution) -> None: ... + def ensure_finalized(self) -> None: ... @abstractmethod def initialize_options(self) -> None: ... @abstractmethod diff --git a/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi b/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi index dfdfe4427aed..67b31e7bb28f 100644 --- a/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi +++ b/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi @@ -1,6 +1,7 @@ from _typeshed import Incomplete from ..cmd import Command +from ..extension import Extension class build_ext(Command): description: str @@ -42,5 +43,5 @@ class build_ext(Command): def get_ext_fullpath(self, ext_name: str) -> str: ... def get_ext_fullname(self, ext_name: str) -> str: ... def get_ext_filename(self, ext_name: str) -> str: ... - def get_export_symbols(self, ext): ... - def get_libraries(self, ext): ... + def get_export_symbols(self, ext: Extension) -> list[str]: ... + def get_libraries(self, ext: Extension) -> list[str]: ... diff --git a/stubs/setuptools/setuptools/logging.pyi b/stubs/setuptools/setuptools/logging.pyi index 6933bcbd5cba..4f87159e22a8 100644 --- a/stubs/setuptools/setuptools/logging.pyi +++ b/stubs/setuptools/setuptools/logging.pyi @@ -1,2 +1,2 @@ def configure() -> None: ... -def set_threshold(level): ... +def set_threshold(level: int) -> int: ...