From: Joerg Behrmann Date: Mon, 4 Oct 2021 15:17:06 +0000 (+0200) Subject: typing: appease pyright and disable mypy unusued import warning X-Git-Tag: v11~38^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F822%2Fhead;p=thirdparty%2Fmkosi.git typing: appease pyright and disable mypy unusued import warning Since pyright reuses the same comments to ignore types, one can get into unsatisfiable situations, where one type checker accepts something but the other doesn't. At this point we only have three instances of type ignore hints anyway, sol et's relax our mypy settings somewhat, so that we can shut up pyright, when necessary. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 665f5f4cf..45642c7fe 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -3913,7 +3913,7 @@ def install_unified_kernel( # Apparently openmandriva hasn't yet completed its usrmerge so we use lib here instead of usr/lib. with os.scandir(root / "lib/modules") as d: for kver in d: - if not (kver.is_dir() and os.path.isfile(os.path.join(kver, "modules.dep"))): + if not (kver.is_dir() and os.path.isfile(os.path.join(kver, "modules.dep"))): # type: ignore continue prefix = "/boot" if args.xbootldr_partno is not None else "/efi" diff --git a/setup.cfg b/setup.cfg index 5f51b744d..7f6c97506 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,7 @@ disallow_incomplete_defs = True check_untyped_defs = True no_implicit_optional = True warn_redundant_casts = True -warn_unused_ignores = True +warn_unused_ignores = False warn_return_any = True no_implicit_reexport = True # extra options not in --strict