mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
distutils & setuptools: Complete sub_commands ClassVar typing (#11951)
This commit is contained in:
@@ -2,11 +2,12 @@ from _typeshed import Incomplete, Unused
|
||||
from abc import abstractmethod
|
||||
from collections.abc import Callable, Iterable
|
||||
from distutils.dist import Distribution
|
||||
from typing import Any, Literal
|
||||
from typing import Any, ClassVar, Literal
|
||||
|
||||
class Command:
|
||||
distribution: Distribution
|
||||
sub_commands: list[tuple[str, Callable[[Command], bool] | None]]
|
||||
# Any to work around variance issues
|
||||
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
|
||||
def __init__(self, dist: Distribution) -> None: ...
|
||||
@abstractmethod
|
||||
def initialize_options(self) -> None: ...
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any
|
||||
from collections.abc import Callable
|
||||
from typing import Any, ClassVar
|
||||
|
||||
from ..cmd import Command
|
||||
|
||||
@@ -28,4 +29,5 @@ class build(Command):
|
||||
def has_c_libraries(self): ...
|
||||
def has_ext_modules(self): ...
|
||||
def has_scripts(self): ...
|
||||
sub_commands: Any
|
||||
# Any to work around variance issues
|
||||
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any
|
||||
from collections.abc import Callable
|
||||
from typing import Any, ClassVar
|
||||
|
||||
from ..cmd import Command
|
||||
|
||||
@@ -60,4 +61,5 @@ class install(Command):
|
||||
def has_headers(self): ...
|
||||
def has_scripts(self): ...
|
||||
def has_data(self): ...
|
||||
sub_commands: Any
|
||||
# Any to work around variance issues
|
||||
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
from typing import Any
|
||||
from collections.abc import Callable
|
||||
from typing import Any, ClassVar
|
||||
|
||||
from ..config import PyPIRCCommand
|
||||
|
||||
class register(PyPIRCCommand):
|
||||
description: str
|
||||
sub_commands: Any
|
||||
# Any to work around variance issues
|
||||
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
|
||||
list_classifiers: int
|
||||
strict: int
|
||||
def initialize_options(self) -> None: ...
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any
|
||||
from collections.abc import Callable
|
||||
from typing import Any, ClassVar
|
||||
|
||||
from ..cmd import Command
|
||||
|
||||
@@ -11,7 +12,8 @@ class sdist(Command):
|
||||
boolean_options: Any
|
||||
help_options: Any
|
||||
negative_opt: Any
|
||||
sub_commands: Any
|
||||
# Any to work around variance issues
|
||||
sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]]
|
||||
READMES: Any
|
||||
template: Any
|
||||
manifest: Any
|
||||
|
||||
Reference in New Issue
Block a user