|
1 | | -from _typeshed import BytesPath, Incomplete, StrOrBytesPath, StrPath, Unused |
| 1 | +from _typeshed import BytesPath, StrOrBytesPath, StrPath, Unused |
2 | 2 | from abc import abstractmethod |
3 | 3 | from collections.abc import Callable, Iterable |
4 | 4 | from typing import Any, ClassVar, TypeVar, overload |
| 5 | +from typing_extensions import TypeVarTuple, Unpack |
5 | 6 |
|
6 | 7 | from .dist import Distribution |
7 | 8 |
|
8 | 9 | _StrPathT = TypeVar("_StrPathT", bound=StrPath) |
9 | 10 | _BytesPathT = TypeVar("_BytesPathT", bound=BytesPath) |
| 11 | +_Ts = TypeVarTuple("_Ts") |
10 | 12 |
|
11 | 13 | class Command: |
12 | 14 | distribution: Distribution |
@@ -34,7 +36,7 @@ class Command: |
34 | 36 | def get_sub_commands(self) -> list[str]: ... |
35 | 37 | def warn(self, msg: str) -> None: ... |
36 | 38 | def execute( |
37 | | - self, func: Callable[..., object], args: Iterable[Incomplete], msg: str | None = ..., level: int = ... |
| 39 | + self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = ..., level: int = ... |
38 | 40 | ) -> None: ... |
39 | 41 | def mkpath(self, name: str, mode: int = ...) -> None: ... |
40 | 42 | @overload |
@@ -95,8 +97,8 @@ class Command: |
95 | 97 | self, |
96 | 98 | infiles: str | list[str] | tuple[str, ...], |
97 | 99 | outfile: StrOrBytesPath, |
98 | | - func: Callable[..., object], |
99 | | - args: list[Incomplete], |
| 100 | + func: Callable[[Unpack[_Ts]], Unused], |
| 101 | + args: tuple[Unpack[_Ts]], |
100 | 102 | exec_msg: str | None = None, |
101 | 103 | skip_msg: str | None = None, |
102 | 104 | level: Unused = 1, |
|
0 commit comments