Skip to content

Commit ad6c681

Browse files
committed
Fix type-checking regardless of click version.
1 parent 5422488 commit ad6c681

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/_pytask/click.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
if importlib.metadata.version("click") < "8.2":
4040
from click.parser import split_opt
4141

42-
class EnumChoice(Choice):
42+
class EnumChoice(Choice): # type: ignore[type-arg]
4343
"""An enum-based choice type.
4444
4545
The implementation is copied from https://github.com/pallets/click/pull/2210 and
@@ -71,17 +71,17 @@ def convert(
7171
return self.enum_type(value)
7272

7373
else:
74-
from click.parser import ( # type: ignore[attr-defined, no-redef]
74+
from click.parser import ( # type: ignore[attr-defined, no-redef, unused-ignore]
7575
_split_opt as split_opt,
7676
)
7777

7878
ParamTypeValue = TypeVar("ParamTypeValue")
7979

80-
class EnumChoice(Choice): # type: ignore[no-redef]
80+
class EnumChoice(Choice): # type: ignore[no-redef, type-arg]
8181
def __init__(
8282
self, choices: Iterable[ParamTypeValue], case_sensitive: bool = False
8383
) -> None:
84-
super().__init__(choices=choices, case_sensitive=case_sensitive) # type: ignore[arg-type]
84+
super().__init__(choices=choices, case_sensitive=case_sensitive) # type: ignore[arg-type, unused-ignore]
8585

8686

8787
class _OptionHighlighter(RegexHighlighter):
@@ -340,7 +340,7 @@ def _format_help_text( # noqa: C901, PLR0912, PLR0915
340340
elif param.is_bool_flag and param.secondary_opts: # type: ignore[attr-defined]
341341
# For boolean flags that have distinct True/False opts,
342342
# use the opt without prefix instead of the value.
343-
default_string = split_opt(
343+
default_string = split_opt( # type: ignore[operator]
344344
(param.opts if param.default else param.secondary_opts)[0]
345345
)[1]
346346
elif (

0 commit comments

Comments
 (0)