Repository: CERT-Polska/malduck (language: python)

Issue:
Re-enable type checks for malduck.crypto.camellia
Type checks are temporarily disabled for `malduck.crypto.camellia` due to typo in typeshed.

Related typo: https://github.com/python/typeshed/pull/4847 (waiting to be included in mypy)
Check disabled by: https://github.com/CERT-Polska/malduck/pull/51


Discussion / hints:

Fix patch:
diff --git a/malduck/extractor/loaders.py b/malduck/extractor/loaders.py
index fcd216a..4e43b63 100644
--- a/malduck/extractor/loaders.py
+++ b/malduck/extractor/loaders.py
@@ -3,15 +3,14 @@
 import pkgutil
 import sys
 
-from importlib.abc import FileLoader
-from importlib.machinery import FileFinder
+from importlib.abc import FileLoader, PathEntryFinder
 
 from typing import Callable, Optional, Any, Dict, cast
 
 log = logging.getLogger(__name__)
 
 
-def import_module_by_finder(finder: FileFinder, module_name: str) -> Any:
+def import_module_by_finder(finder: PathEntryFinder, module_name: str) -> Any:
     """
     Imports module from arbitrary path using importer returned by pkgutil.iter_modules
     """
@@ -57,7 +56,9 @@ def load_modules(
         if module_name in modules:
             log.warning("Module collision - %s overridden", module_name)
         try:
-            modules[module_name] = import_module_by_finder(finder, module_name)
+            modules[module_name] = import_module_by_finder(
+                cast(PathEntryFinder, finder), module_name
+            )
         except Exception as exc:
             if onerror:
                 onerror(exc, module_name)
diff --git a/setup.cfg b/setup.cfg
index 7f06036..819d557 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -23,6 +23,3 @@ ignore_missing_imports = True
 
 [mypy-ida_bytes.*]
 ignore_missing_imports = True
-
-[mypy-malduck.crypto.camellia]
-ignore_errors = True


Test patch:
diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml
index 7a1d05e..a46e1da 100644
--- a/.github/workflows/lint-test.yml
+++ b/.github/workflows/lint-test.yml
@@ -21,7 +21,7 @@ jobs:
     - name: Install dependencies
       run: |
         python -m pip install --upgrade pip
-        pip install flake8==3.8.3 pytest==5.4.1 black==19.10b0 mypy==0.782 mypy-extensions==0.4.3
+        pip install flake8==3.8.3 pytest==5.4.1 black==19.10b0 mypy==0.800 mypy-extensions==0.4.3
         if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
     - name: Lint with flake8
       run: |