diff --git a/requirements-check.txt b/requirements-check.txt index aaacaf9..4508233 100644 --- a/requirements-check.txt +++ b/requirements-check.txt @@ -1,7 +1,7 @@ ruff==0.9.1 black==24.10.0 isort==5.13.2 -mypy==1.13.0 +mypy==1.14.1 types-tzlocal types-requests types-pytz diff --git a/src/autosuspend/checks/linux.py b/src/autosuspend/checks/linux.py index 7e168bb..bf99a46 100644 --- a/src/autosuspend/checks/linux.py +++ b/src/autosuspend/checks/linux.py @@ -284,9 +284,9 @@ def create(cls, name: str, config: configparser.SectionProxy) -> "Users": with warnings.catch_warnings(): warnings.simplefilter("ignore", FutureWarning) try: - user_regex = re.compile(config.get("name", fallback=r".*")) - terminal_regex = re.compile(config.get("terminal", fallback=r".*")) - host_regex = re.compile(config.get("host", fallback=r".*")) + user_regex = re.compile(config.get("name", fallback=r".*")) # type: ignore + terminal_regex = re.compile(config.get("terminal", fallback=r".*")) # type: ignore + host_regex = re.compile(config.get("host", fallback=r".*")) # type: ignore return cls(name, user_regex, terminal_regex, host_regex) except re.error as error: raise ConfigurationError( diff --git a/src/autosuspend/checks/mpd.py b/src/autosuspend/checks/mpd.py index 7fa14d0..f59d21f 100644 --- a/src/autosuspend/checks/mpd.py +++ b/src/autosuspend/checks/mpd.py @@ -13,7 +13,7 @@ def create(cls, name: str, config: configparser.SectionProxy) -> "Mpd": host = config.get("host", fallback="localhost") port = config.getint("port", fallback=6600) timeout = config.getint("timeout", fallback=5) - return cls(name, host, port, timeout) + return cls(name, host, port, timeout) # type: ignore except ValueError as error: raise ConfigurationError( f"Host port or timeout configuration wrong: {error}" diff --git a/src/autosuspend/checks/systemd.py b/src/autosuspend/checks/systemd.py index b52094c..3b95bbd 100644 --- a/src/autosuspend/checks/systemd.py +++ b/src/autosuspend/checks/systemd.py @@ -91,11 +91,11 @@ def create( name: str, config: configparser.SectionProxy, ) -> "LogindSessionsIdle": - types = config.get("types", fallback="tty,x11,wayland").split(",") + types = config.get("types", fallback="tty,x11,wayland").split(",") # type: ignore types = [t.strip() for t in types] - states = config.get("states", fallback="active,online").split(",") + states = config.get("states", fallback="active,online").split(",") # type: ignore states = [t.strip() for t in states] - classes = config.get("classes", fallback="user").split(",") + classes = config.get("classes", fallback="user").split(",") # type: ignore classes = [t.strip() for t in classes] return cls(name, types, states, classes) diff --git a/src/autosuspend/checks/xorg.py b/src/autosuspend/checks/xorg.py index 65bc7c1..7ca87ea 100644 --- a/src/autosuspend/checks/xorg.py +++ b/src/autosuspend/checks/xorg.py @@ -113,7 +113,7 @@ def create(cls, name: str, config: configparser.SectionProxy) -> "XIdleTime": return cls( name, config.getint("timeout", fallback=600), - config.get("method", fallback="sockets"), + config.get("method", fallback="sockets"), # type: ignore re.compile(config.get("ignore_if_process", fallback=r"a^")), re.compile(config.get("ignore_users", fallback=r"a^")), )