File tree Expand file tree Collapse file tree 8 files changed +27
-17
lines changed
stubs/setuptools/setuptools Expand file tree Collapse file tree 8 files changed +27
-17
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,12 @@ from _typeshed import Incomplete, Unused
22from abc import abstractmethod
33from collections .abc import Callable , Iterable
44from distutils .dist import Distribution
5- from typing import Any , Literal
5+ from typing import Any , ClassVar , Literal
66
77class Command :
88 distribution : Distribution
9- sub_commands : list [tuple [str , Callable [[Command ], bool ] | None ]]
9+ # Any to work around variance issues
10+ sub_commands : ClassVar [list [tuple [str , Callable [[Any ], bool ] | None ]]]
1011 def __init__ (self , dist : Distribution ) -> None : ...
1112 @abstractmethod
1213 def initialize_options (self ) -> None : ...
Original file line number Diff line number Diff line change 1- from typing import Any
1+ from collections .abc import Callable
2+ from typing import Any , ClassVar
23
34from ..cmd import Command
45
@@ -28,4 +29,5 @@ class build(Command):
2829 def has_c_libraries (self ): ...
2930 def has_ext_modules (self ): ...
3031 def has_scripts (self ): ...
31- sub_commands : Any
32+ # Any to work around variance issues
33+ sub_commands : ClassVar [list [tuple [str , Callable [[Any ], bool ] | None ]]]
Original file line number Diff line number Diff line change 1- from typing import Any
1+ from collections .abc import Callable
2+ from typing import Any , ClassVar
23
34from ..cmd import Command
45
@@ -60,4 +61,5 @@ class install(Command):
6061 def has_headers (self ): ...
6162 def has_scripts (self ): ...
6263 def has_data (self ): ...
63- sub_commands : Any
64+ # Any to work around variance issues
65+ sub_commands : ClassVar [list [tuple [str , Callable [[Any ], bool ] | None ]]]
Original file line number Diff line number Diff line change 1- from typing import Any
1+ from collections .abc import Callable
2+ from typing import Any , ClassVar
23
34from ..config import PyPIRCCommand
45
56class register (PyPIRCCommand ):
67 description : str
7- sub_commands : Any
8+ # Any to work around variance issues
9+ sub_commands : ClassVar [list [tuple [str , Callable [[Any ], bool ] | None ]]]
810 list_classifiers : int
911 strict : int
1012 def initialize_options (self ) -> None : ...
Original file line number Diff line number Diff line change 1- from typing import Any
1+ from collections .abc import Callable
2+ from typing import Any , ClassVar
23
34from ..cmd import Command
45
@@ -11,7 +12,8 @@ class sdist(Command):
1112 boolean_options : Any
1213 help_options : Any
1314 negative_opt : Any
14- sub_commands : Any
15+ # Any to work around variance issues
16+ sub_commands : ClassVar [list [tuple [str , Callable [[Any ], bool ] | None ]]]
1517 READMES : Any
1618 template : Any
1719 manifest : Any
Original file line number Diff line number Diff line change 11from _typeshed import Incomplete , Unused
22from abc import abstractmethod
33from collections .abc import Callable , Iterable
4- from typing import ClassVar , Literal
5- from typing_extensions import Self
4+ from typing import Any , ClassVar , Literal
65
76from .dist import Distribution
87
98class Command :
109 distribution : Distribution
11- sub_commands : ClassVar [list [tuple [str , Callable [[Self ], bool ] | None ]]]
10+ # Any to work around variance issues
11+ sub_commands : ClassVar [list [tuple [str , Callable [[Any ], bool ] | None ]]]
1212 def __init__ (self , dist : Distribution ) -> None : ...
1313 def ensure_finalized (self ) -> None : ...
1414 @abstractmethod
Original file line number Diff line number Diff line change 1+ from collections .abc import Callable
12from typing import Any
23
34from .._distutils .command import install as orig
45
56class install (orig .install ):
67 user_options : Any
78 boolean_options : Any
8- new_commands : Any
9+ # Any to work around variance issues
10+ new_commands : list [tuple [str , Callable [[Any ], bool ]] | None ]
911 old_and_unmanageable : Any
1012 single_version_externally_managed : Any
1113 def initialize_options (self ) -> None : ...
Original file line number Diff line number Diff line change 11from collections .abc import Callable
22from typing import Any , ClassVar
3- from typing_extensions import Self
43
54from .upload import upload
65
@@ -10,8 +9,8 @@ class upload_docs(upload):
109 user_options : ClassVar [list [tuple [str , str | None , str ]]]
1110 boolean_options : ClassVar [list [str ]]
1211 def has_sphinx (self ): ...
13- # The callable parameter is self: Self, but using Self still trips up mypy
14- sub_commands : ClassVar [list [tuple [str , Callable [[Self ], bool ] | None ]]] # type: ignore[assignment ]
12+ # Any to work around variance issues
13+ sub_commands : ClassVar [list [tuple [str , Callable [[Any ], bool ] | None ]]]
1514 upload_dir : Any
1615 target_dir : Any
1716 def initialize_options (self ) -> None : ...
You can’t perform that action at this time.
0 commit comments