mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 21:42:25 +08:00
distutils & setuptools: Complete sub_commands ClassVar typing (#11951)
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
from _typeshed import Incomplete, Unused
|
||||
from abc import abstractmethod
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import ClassVar, Literal
|
||||
from typing_extensions import Self
|
||||
from typing import Any, ClassVar, Literal
|
||||
|
||||
from .dist import Distribution
|
||||
|
||||
class Command:
|
||||
distribution: Distribution
|
||||
sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]]
|
||||
# Any to work around variance issues
|
||||
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
|
||||
def __init__(self, dist: Distribution) -> None: ...
|
||||
def ensure_finalized(self) -> None: ...
|
||||
@abstractmethod
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
from .._distutils.command import install as orig
|
||||
@@ -5,7 +6,8 @@ from .._distutils.command import install as orig
|
||||
class install(orig.install):
|
||||
user_options: Any
|
||||
boolean_options: Any
|
||||
new_commands: Any
|
||||
# Any to work around variance issues
|
||||
new_commands: list[tuple[str, Callable[[Any], bool]] | None]
|
||||
old_and_unmanageable: Any
|
||||
single_version_externally_managed: Any
|
||||
def initialize_options(self) -> None: ...
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from collections.abc import Callable
|
||||
from typing import Any, ClassVar
|
||||
from typing_extensions import Self
|
||||
|
||||
from .upload import upload
|
||||
|
||||
@@ -10,8 +9,8 @@ class upload_docs(upload):
|
||||
user_options: ClassVar[list[tuple[str, str | None, str]]]
|
||||
boolean_options: ClassVar[list[str]]
|
||||
def has_sphinx(self): ...
|
||||
# The callable parameter is self: Self, but using Self still trips up mypy
|
||||
sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]] # type: ignore[assignment]
|
||||
# Any to work around variance issues
|
||||
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
|
||||
upload_dir: Any
|
||||
target_dir: Any
|
||||
def initialize_options(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user