Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Nov 24, 2024
1 parent fd2eaed commit b2a9c3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/subliminal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def decorator(f: Callable) -> Callable:
PROVIDERS_OPTIONS_CLI_TEMPLATE.format(ext=group_name, plugin=plugin_name, key=name),
PROVIDERS_OPTIONS_TEMPLATE.format(ext=group_name, plugin=plugin_name, key=name),
)
# Setting the default value also decides on the type
attrs = {
'default': opt['default'],
'help': opt['desc'],
Expand All @@ -237,7 +238,7 @@ def decorator(f: Callable) -> Callable:
key=name.upper(),
),
}
click_option(*param_decls, **attrs)(f)
f = click_option(*param_decls, **attrs)(f) # type: ignore[operator]
return f

return decorator
Expand Down Expand Up @@ -295,6 +296,7 @@ def decorator(f: Callable) -> Callable:
@click.pass_context
def subliminal(
ctx: click.Context,
/,
cache_dir: str,
debug: bool,
**kwargs: Any,
Expand Down Expand Up @@ -328,8 +330,8 @@ def subliminal(
ctx.obj['debug'] = debug

# create provider and refiner configs
provider_configs = {}
refiner_configs = {}
provider_configs: dict[str, dict[str, Any]] = {}
refiner_configs: dict[str, dict[str, Any]] = {}

for k, v in kwargs.items():
try_split = k.split('__')
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
if TYPE_CHECKING:
from pathlib import Path

from babelfish import Language
from babelfish import Language # type: ignore[import-untyped]

# Core test
pytestmark = pytest.mark.core
Expand Down Expand Up @@ -280,7 +280,7 @@ def obj():

else:

class obj:
class obj: # type: ignore[no-redef]
pass

obj.__doc__ = docstring
Expand Down

0 comments on commit b2a9c3c

Please sign in to comment.