|
1 | | -from typing import List, Iterator, Optional, Literal, TypeVar, Generic, Type, Union |
| 1 | +from typing import List, Iterator, Optional, Literal, TypeVar, Generic, Type, Union, cast |
2 | 2 | from enum import Enum |
3 | 3 | from dataclasses import dataclass |
4 | 4 | import pytest |
|
11 | 11 | from radicli import Radicli, StaticRadicli, Arg, get_arg, ArgparseArg, Command |
12 | 12 | from radicli.util import CommandNotFoundError, CliParserError |
13 | 13 | from radicli.util import ExistingPath, ExistingFilePath, ExistingDirPath |
14 | | -from radicli.util import ExistingFilePathOrDash, DEFAULT_CONVERTERS |
| 14 | +from radicli.util import ExistingFilePathOrDash, DEFAULT_CONVERTERS, ConvertersType |
15 | 15 | from radicli.util import stringify_type, get_list_converter, format_type |
16 | 16 |
|
17 | 17 |
|
@@ -312,7 +312,7 @@ class CustomGeneric(Generic[_KindT]): |
312 | 312 |
|
313 | 313 | def test_cli_converters_generics(): |
314 | 314 | converters = {CustomGeneric: lambda value: f"generic: {value}"} |
315 | | - cli = Radicli(converters=converters) |
| 315 | + cli = Radicli(converters=cast(ConvertersType, converters)) |
316 | 316 | ran = False |
317 | 317 |
|
318 | 318 | @cli.command("test", a=Arg("--a")) |
@@ -960,7 +960,7 @@ def convert_generic(value: str) -> str: |
960 | 960 | CustomGeneric[str]: str, |
961 | 961 | } |
962 | 962 |
|
963 | | - def test(test: arg_type): |
| 963 | + def test(test: arg_type): # type: ignore |
964 | 964 | ... |
965 | 965 |
|
966 | 966 | cmd = Command.from_function( |
|
0 commit comments