diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2dc222f..468d1c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,6 +41,6 @@ repos: rev: v1.10.0 hooks: - id: mypy - additional_dependencies: [types-setuptools, types-requests, settngs>=0.10.0] + additional_dependencies: [types-setuptools, types-requests, settngs>=0.10.3] ci: skip: [mypy] diff --git a/comictaggerlib/ctsettings/commandline.py b/comictaggerlib/ctsettings/commandline.py index 96a7e52..8280714 100644 --- a/comictaggerlib/ctsettings/commandline.py +++ b/comictaggerlib/ctsettings/commandline.py @@ -300,7 +300,7 @@ def validate_commandline_settings(config: settngs.Config[ct_ns], parser: settngs ) config[0].Runtime_Options__no_gui = any( - (config[0].Commands__command, config[0].Runtime_Options__no_gui, config[0].Commands__copy) + (config[0].Commands__command != Action.gui, config[0].Runtime_Options__no_gui, config[0].Commands__copy) ) if platform.system() == "Windows" and config[0].Runtime_Options__glob: diff --git a/comictaggerlib/ctsettings/plugin.py b/comictaggerlib/ctsettings/plugin.py index 2f24b5a..66432cc 100644 --- a/comictaggerlib/ctsettings/plugin.py +++ b/comictaggerlib/ctsettings/plugin.py @@ -2,7 +2,7 @@ from __future__ import annotations import logging import os -from typing import cast +from typing import Any, cast import settngs @@ -84,7 +84,7 @@ def validate_archive_settings(config: settngs.Config[ct_ns]) -> settngs.Config[c def validate_talker_settings(config: settngs.Config[ct_ns], talkers: dict[str, ComicTalker]) -> settngs.Config[ct_ns]: # Apply talker settings from config file - cfg = settngs.normalize_config(config, True, True) + cfg = cast(settngs.Config[dict[str, Any]], settngs.normalize_config(config, True, True)) for talker in list(talkers.values()): try: cfg[0][group_for_plugin(talker)] = talker.parse_settings(cfg[0][group_for_plugin(talker)]) diff --git a/comictaggerlib/filerenamer.py b/comictaggerlib/filerenamer.py index af92255..939d86a 100644 --- a/comictaggerlib/filerenamer.py +++ b/comictaggerlib/filerenamer.py @@ -57,7 +57,7 @@ class MetadataFormatter(string.Formatter): return "" return cast(str, super().format_field(value, format_spec)) - def convert_field(self, value: Any, conversion: str) -> str: + def convert_field(self, value: Any, conversion: str | None) -> str: if conversion == "u": return str(value).upper() if conversion == "l": @@ -146,7 +146,7 @@ class MetadataFormatter(string.Formatter): obj = self.none_replacement(obj, replacement, r) # do any conversion on the resulting object - obj = self.convert_field(obj, conversion) # type: ignore + obj = self.convert_field(obj, conversion) # expand the format spec, if needed format_spec, _ = self._vformat( diff --git a/comictaggerlib/ui/talkeruigenerator.py b/comictaggerlib/ui/talkeruigenerator.py index b3ec163..7d3a88f 100644 --- a/comictaggerlib/ui/talkeruigenerator.py +++ b/comictaggerlib/ui/talkeruigenerator.py @@ -313,7 +313,7 @@ def get_config_from_tab(tab: TalkerTab, definitions: settngs.Group) -> dict[str, value = typ(value) # Warn if the resulting type isn't the guessed type - guessed_type = setting._guess_type() + guessed_type, _ = setting._guess_type() if ( value is not None and guessed_type not in (None, "Any") @@ -385,7 +385,7 @@ def generate_source_option_tabs( dest_created = set() for option in config.definitions[group_for_plugin(talker)].v.values(): - guessed_type = option._guess_type() + guessed_type, _ = option._guess_type() # Skip destinations that have already been created if option.dest in dest_created: diff --git a/setup.cfg b/setup.cfg index b3bcd01..35d2ca7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -48,7 +48,7 @@ install_requires = pyyaml rapidfuzz>=2.12.0 requests==2.* - settngs==0.10.2 + settngs==0.10.3 text2digits typing-extensions>=4.3.0 wordninja