diff --git a/src/ahriman/application/handlers/setup.py b/src/ahriman/application/handlers/setup.py index d2790053..ee631c47 100644 --- a/src/ahriman/application/handlers/setup.py +++ b/src/ahriman/application/handlers/setup.py @@ -160,7 +160,7 @@ class Setup(Handler): configuration = Configuration(allow_no_value=True) # preserve case # stupid mypy thinks that it is impossible - configuration.optionxform = lambda key: key # type: ignore[method-assign] + configuration.optionxform = lambda optionstr: optionstr # type: ignore[method-assign] # load default configuration first # we cannot use Include here because it will be copied to new chroot, thus no includes there diff --git a/src/ahriman/core/alpm/pacman.py b/src/ahriman/core/alpm/pacman.py index 0a891862..eb56c3c4 100644 --- a/src/ahriman/core/alpm/pacman.py +++ b/src/ahriman/core/alpm/pacman.py @@ -22,7 +22,7 @@ import shutil from collections.abc import Callable, Generator from functools import cached_property from pathlib import Path -from pyalpm import DB, Handle, Package, SIG_PACKAGE, error as PyalpmError # type: ignore[import] +from pyalpm import DB, Handle, Package, SIG_PACKAGE, error as PyalpmError # type: ignore[import-not-found] from string import Template from ahriman.core.configuration import Configuration diff --git a/src/ahriman/core/auth/helpers.py b/src/ahriman/core/auth/helpers.py index 14c38b2b..36135386 100644 --- a/src/ahriman/core/auth/helpers.py +++ b/src/ahriman/core/auth/helpers.py @@ -20,7 +20,7 @@ from typing import Any try: - import aiohttp_security # type: ignore[import] + import aiohttp_security # type: ignore[import-untyped] _has_aiohttp_security = True except ImportError: _has_aiohttp_security = False diff --git a/src/ahriman/core/configuration/validator.py b/src/ahriman/core/configuration/validator.py index 2ba5d25b..e5aed2b7 100644 --- a/src/ahriman/core/configuration/validator.py +++ b/src/ahriman/core/configuration/validator.py @@ -19,7 +19,7 @@ # import ipaddress -from cerberus import TypeDefinition, Validator as RootValidator # type: ignore[import] +from cerberus import TypeDefinition, Validator as RootValidator # type: ignore[import-untyped] from pathlib import Path from typing import Any from urllib.parse import urlparse diff --git a/src/ahriman/core/log/journal_handler.py b/src/ahriman/core/log/journal_handler.py index 64acf042..f6f6891d 100644 --- a/src/ahriman/core/log/journal_handler.py +++ b/src/ahriman/core/log/journal_handler.py @@ -42,6 +42,6 @@ class _JournalHandler(NullHandler): try: - from systemd.journal import JournalHandler # type: ignore[import] + from systemd.journal import JournalHandler # type: ignore[import-untyped] except ImportError: JournalHandler = _JournalHandler diff --git a/src/ahriman/core/log/log_loader.py b/src/ahriman/core/log/log_loader.py index 57189d44..4e2424eb 100644 --- a/src/ahriman/core/log/log_loader.py +++ b/src/ahriman/core/log/log_loader.py @@ -59,7 +59,7 @@ class LogLoader: return selected try: - from systemd.journal import JournalHandler # type: ignore[import] + from systemd.journal import JournalHandler # type: ignore[import-untyped] del JournalHandler return LogHandler.Journald # journald import was found except ImportError: diff --git a/src/ahriman/core/status/web_client.py b/src/ahriman/core/status/web_client.py index d63b79e0..b256226c 100644 --- a/src/ahriman/core/status/web_client.py +++ b/src/ahriman/core/status/web_client.py @@ -98,7 +98,7 @@ class WebClient(Client, SyncHttpClient): requests.Session: generated session object """ if use_unix_socket: - import requests_unixsocket # type: ignore[import] + import requests_unixsocket # type: ignore[import-untyped] session: requests.Session = requests_unixsocket.Session() session.headers["User-Agent"] = f"ahriman/{__version__}" return session diff --git a/src/ahriman/core/upload/s3.py b/src/ahriman/core/upload/s3.py index c7931344..9ef115e2 100644 --- a/src/ahriman/core/upload/s3.py +++ b/src/ahriman/core/upload/s3.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import boto3 # type: ignore[import] +import boto3 # type: ignore[import-untyped] import hashlib import mimetypes diff --git a/src/ahriman/models/aur_package.py b/src/ahriman/models/aur_package.py index 789d93ad..ea66c0ce 100644 --- a/src/ahriman/models/aur_package.py +++ b/src/ahriman/models/aur_package.py @@ -22,7 +22,7 @@ import inflection from collections.abc import Callable from dataclasses import dataclass, field, fields -from pyalpm import Package # type: ignore[import] +from pyalpm import Package # type: ignore[import-not-found] from typing import Any, Self from ahriman.core.util import filter_json, full_version diff --git a/src/ahriman/models/package.py b/src/ahriman/models/package.py index 628f5330..3b42c0c3 100644 --- a/src/ahriman/models/package.py +++ b/src/ahriman/models/package.py @@ -25,8 +25,8 @@ import copy from collections.abc import Callable, Generator, Iterable from dataclasses import dataclass from pathlib import Path -from pyalpm import vercmp # type: ignore[import] -from srcinfo.parse import parse_srcinfo # type: ignore[import] +from pyalpm import vercmp # type: ignore[import-not-found] +from srcinfo.parse import parse_srcinfo # type: ignore[import-untyped] from typing import Any, Self from urllib.parse import urlparse diff --git a/src/ahriman/models/package_description.py b/src/ahriman/models/package_description.py index bbb08c31..91e514dc 100644 --- a/src/ahriman/models/package_description.py +++ b/src/ahriman/models/package_description.py @@ -19,7 +19,7 @@ # from dataclasses import dataclass, field, fields from pathlib import Path -from pyalpm import Package # type: ignore[import] +from pyalpm import Package # type: ignore[import-not-found] from typing import Any, Self from ahriman.core.util import dataclass_view, filter_json, trim_package diff --git a/src/ahriman/models/repository_paths.py b/src/ahriman/models/repository_paths.py index 866712cd..35d38168 100644 --- a/src/ahriman/models/repository_paths.py +++ b/src/ahriman/models/repository_paths.py @@ -144,10 +144,9 @@ class RepositoryPaths(LazyLogging): """ return self.owner(self.root) - # TODO see https://github.com/python/mypy/issues/12534, remove type: ignore after release # pylint: disable=protected-access @classmethod - def known_architectures(cls, root: Path, name: str = "") -> set[str]: # type: ignore[return] + def known_architectures(cls, root: Path, name: str = "") -> set[str]: """ get known architecture names diff --git a/src/ahriman/web/apispec.py b/src/ahriman/web/apispec.py index a7ccc918..02436084 100644 --- a/src/ahriman/web/apispec.py +++ b/src/ahriman/web/apispec.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import Application from typing import Any diff --git a/src/ahriman/web/cors.py b/src/ahriman/web/cors.py index 2d9f19cc..54908bfb 100644 --- a/src/ahriman/web/cors.py +++ b/src/ahriman/web/cors.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_cors # type: ignore[import] +import aiohttp_cors # type: ignore[import-untyped] from aiohttp.web import Application diff --git a/src/ahriman/web/middlewares/auth_handler.py b/src/ahriman/web/middlewares/auth_handler.py index ab741945..a3f32d62 100644 --- a/src/ahriman/web/middlewares/auth_handler.py +++ b/src/ahriman/web/middlewares/auth_handler.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_security # type: ignore[import] +import aiohttp_security # type: ignore[import-untyped] import socket import types diff --git a/src/ahriman/web/views/base.py b/src/ahriman/web/views/base.py index dca09e5a..dd15724a 100644 --- a/src/ahriman/web/views/base.py +++ b/src/ahriman/web/views/base.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -from aiohttp_cors import CorsViewMixin # type: ignore[import] +from aiohttp_cors import CorsViewMixin # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, Request, StreamResponse, View from collections.abc import Awaitable, Callable from typing import Any, TypeVar diff --git a/src/ahriman/web/views/v1/service/add.py b/src/ahriman/web/views/v1/service/add.py index 6a13f362..6477befe 100644 --- a/src/ahriman/web/views/v1/service/add.py +++ b/src/ahriman/web/views/v1/service/add.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, Response, json_response diff --git a/src/ahriman/web/views/v1/service/pgp.py b/src/ahriman/web/views/v1/service/pgp.py index 2ccf4465..77db9870 100644 --- a/src/ahriman/web/views/v1/service/pgp.py +++ b/src/ahriman/web/views/v1/service/pgp.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, HTTPNotFound, Response, json_response diff --git a/src/ahriman/web/views/v1/service/process.py b/src/ahriman/web/views/v1/service/process.py index 849088fa..0ed53d81 100644 --- a/src/ahriman/web/views/v1/service/process.py +++ b/src/ahriman/web/views/v1/service/process.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPNotFound, Response, json_response diff --git a/src/ahriman/web/views/v1/service/rebuild.py b/src/ahriman/web/views/v1/service/rebuild.py index 728c4484..d9878ecb 100644 --- a/src/ahriman/web/views/v1/service/rebuild.py +++ b/src/ahriman/web/views/v1/service/rebuild.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, Response, json_response diff --git a/src/ahriman/web/views/v1/service/remove.py b/src/ahriman/web/views/v1/service/remove.py index 2f0fc73e..953f89c8 100644 --- a/src/ahriman/web/views/v1/service/remove.py +++ b/src/ahriman/web/views/v1/service/remove.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, Response, json_response diff --git a/src/ahriman/web/views/v1/service/request.py b/src/ahriman/web/views/v1/service/request.py index e1220a8a..385e1c56 100644 --- a/src/ahriman/web/views/v1/service/request.py +++ b/src/ahriman/web/views/v1/service/request.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, Response, json_response diff --git a/src/ahriman/web/views/v1/service/search.py b/src/ahriman/web/views/v1/service/search.py index 0718cdcf..ffa00c7f 100644 --- a/src/ahriman/web/views/v1/service/search.py +++ b/src/ahriman/web/views/v1/service/search.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, HTTPNotFound, Response, json_response from collections.abc import Callable diff --git a/src/ahriman/web/views/v1/service/update.py b/src/ahriman/web/views/v1/service/update.py index 67108374..5e661833 100644 --- a/src/ahriman/web/views/v1/service/update.py +++ b/src/ahriman/web/views/v1/service/update.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, Response, json_response diff --git a/src/ahriman/web/views/v1/service/upload.py b/src/ahriman/web/views/v1/service/upload.py index 96a9dbd5..9744b74b 100644 --- a/src/ahriman/web/views/v1/service/upload.py +++ b/src/ahriman/web/views/v1/service/upload.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] import shutil from aiohttp import BodyPartReader diff --git a/src/ahriman/web/views/v1/status/logs.py b/src/ahriman/web/views/v1/status/logs.py index 4d9a0b99..9b092945 100644 --- a/src/ahriman/web/views/v1/status/logs.py +++ b/src/ahriman/web/views/v1/status/logs.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, HTTPNoContent, HTTPNotFound, Response, json_response diff --git a/src/ahriman/web/views/v1/status/package.py b/src/ahriman/web/views/v1/status/package.py index cf9556fa..37d2471d 100644 --- a/src/ahriman/web/views/v1/status/package.py +++ b/src/ahriman/web/views/v1/status/package.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, HTTPNoContent, HTTPNotFound, Response, json_response diff --git a/src/ahriman/web/views/v1/status/packages.py b/src/ahriman/web/views/v1/status/packages.py index cb01c688..77a522dc 100644 --- a/src/ahriman/web/views/v1/status/packages.py +++ b/src/ahriman/web/views/v1/status/packages.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] import itertools from collections.abc import Callable diff --git a/src/ahriman/web/views/v1/status/status.py b/src/ahriman/web/views/v1/status/status.py index bb625a36..b5252d84 100644 --- a/src/ahriman/web/views/v1/status/status.py +++ b/src/ahriman/web/views/v1/status/status.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPBadRequest, HTTPNoContent, Response, json_response diff --git a/src/ahriman/web/views/v1/user/login.py b/src/ahriman/web/views/v1/user/login.py index 28a05c56..719cee00 100644 --- a/src/ahriman/web/views/v1/user/login.py +++ b/src/ahriman/web/views/v1/user/login.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPFound, HTTPMethodNotAllowed, HTTPUnauthorized diff --git a/src/ahriman/web/views/v1/user/logout.py b/src/ahriman/web/views/v1/user/logout.py index be9fe0bc..00e8cd7a 100644 --- a/src/ahriman/web/views/v1/user/logout.py +++ b/src/ahriman/web/views/v1/user/logout.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPFound, HTTPUnauthorized diff --git a/src/ahriman/web/views/v2/status/logs.py b/src/ahriman/web/views/v2/status/logs.py index a9e2fbbb..963dc6b0 100644 --- a/src/ahriman/web/views/v2/status/logs.py +++ b/src/ahriman/web/views/v2/status/logs.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -import aiohttp_apispec # type: ignore[import] +import aiohttp_apispec # type: ignore[import-untyped] from aiohttp.web import HTTPNotFound, Response, json_response diff --git a/src/ahriman/web/web.py b/src/ahriman/web/web.py index c7047ab6..2049df7e 100644 --- a/src/ahriman/web/web.py +++ b/src/ahriman/web/web.py @@ -167,7 +167,7 @@ def setup_service(repository_id: RepositoryId, configuration: Configuration, spa # application.logger.info("setup debug panel") # debug_enabled = configuration.getboolean("web", "debug", fallback=False) # if debug_enabled: - # import aiohttp_debugtoolbar # type: ignore[import] + # import aiohttp_debugtoolbar # type: ignore[import-untyped] # aiohttp_debugtoolbar.setup(application, # hosts=configuration.getlist("web", "debug_allowed_hosts", fallback=[]), # check_host=configuration.getboolean("web", "debug_check_host", fallback=False))