From 763e834e7131532993dc14761e205e592bb4ceef Mon Sep 17 00:00:00 2001 From: Jake Jepson <55201008+Jepson2k@users.noreply.github.com> Date: Thu, 2 Jan 2025 22:01:14 -0500 Subject: [PATCH 1/3] Configure mypy skip following imports for some dependencies Workaround for issues such as https://github.com/python/mypy/issues/13499 in the version of mypy version we're currently using which are causing spurious type checking failures. These workarounds should be removed when we bump the mypy version to one without these bugs. --- disassemblers/ofrak_angr/mypy.ini | 15 +++++++++++++++ ofrak_core/mypy.ini | 14 +++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/disassemblers/ofrak_angr/mypy.ini b/disassemblers/ofrak_angr/mypy.ini index 51469f31d..d1e416de4 100644 --- a/disassemblers/ofrak_angr/mypy.ini +++ b/disassemblers/ofrak_angr/mypy.ini @@ -3,3 +3,18 @@ files = ofrak_angr [mypy-angr.*] ignore_missing_imports = True + +[mypy-tempfile312.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +follow_imports = skip +follow_imports_for_stubs = true +ignore_missing_imports = True + +[mypy-lief.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +follow_imports = skip +follow_imports_for_stubs = true +ignore_missing_imports = True + +[mypy-numpy.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +follow_imports = skip +follow_imports_for_stubs = true +ignore_missing_imports = True \ No newline at end of file diff --git a/ofrak_core/mypy.ini b/ofrak_core/mypy.ini index 74985bb64..55fad72f1 100644 --- a/ofrak_core/mypy.ini +++ b/ofrak_core/mypy.ini @@ -16,7 +16,19 @@ ignore_missing_imports = True [mypy-xattr.*] ignore_missing_imports = True -[mypy-lief.*] +[mypy-lief.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +follow_imports = skip +follow_imports_for_stubs = true +ignore_missing_imports = True + +[mypy-tempfile312.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +follow_imports = skip +follow_imports_for_stubs = true +ignore_missing_imports = True + +[mypy-numpy.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +follow_imports = skip +follow_imports_for_stubs = true ignore_missing_imports = True [mypy-binwalk.*] From 5d41eca78cee57d35436caf918ef85871fba1095 Mon Sep 17 00:00:00 2001 From: Albert Zhang Date: Tue, 7 Jan 2025 21:23:41 +0000 Subject: [PATCH 2/3] Fix missing newline at end of mypy.ini --- disassemblers/ofrak_angr/mypy.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disassemblers/ofrak_angr/mypy.ini b/disassemblers/ofrak_angr/mypy.ini index d1e416de4..4bfbf4fee 100644 --- a/disassemblers/ofrak_angr/mypy.ini +++ b/disassemblers/ofrak_angr/mypy.ini @@ -17,4 +17,4 @@ ignore_missing_imports = True [mypy-numpy.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. follow_imports = skip follow_imports_for_stubs = true -ignore_missing_imports = True \ No newline at end of file +ignore_missing_imports = True From c90d96063c3d9c22c7a2316319f9c2ce5b0eed14 Mon Sep 17 00:00:00 2001 From: Albert Zhang Date: Thu, 9 Jan 2025 18:19:07 +0000 Subject: [PATCH 3/3] Minimize changes to mypy.ini files --- disassemblers/ofrak_angr/mypy.ini | 15 ++++++--------- ofrak_core/mypy.ini | 15 ++++++--------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/disassemblers/ofrak_angr/mypy.ini b/disassemblers/ofrak_angr/mypy.ini index 4bfbf4fee..1ef016cf7 100644 --- a/disassemblers/ofrak_angr/mypy.ini +++ b/disassemblers/ofrak_angr/mypy.ini @@ -4,17 +4,14 @@ files = ofrak_angr [mypy-angr.*] ignore_missing_imports = True -[mypy-tempfile312.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +[mypy-tempfile312.*] follow_imports = skip -follow_imports_for_stubs = true -ignore_missing_imports = True +follow_imports_for_stubs = True -[mypy-lief.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +[mypy-lief.*] follow_imports = skip -follow_imports_for_stubs = true -ignore_missing_imports = True +follow_imports_for_stubs = True -[mypy-numpy.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +[mypy-numpy.*] follow_imports = skip -follow_imports_for_stubs = true -ignore_missing_imports = True +follow_imports_for_stubs = True diff --git a/ofrak_core/mypy.ini b/ofrak_core/mypy.ini index 55fad72f1..6e7641131 100644 --- a/ofrak_core/mypy.ini +++ b/ofrak_core/mypy.ini @@ -16,20 +16,17 @@ ignore_missing_imports = True [mypy-xattr.*] ignore_missing_imports = True -[mypy-lief.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +[mypy-tempfile312.*] follow_imports = skip -follow_imports_for_stubs = true -ignore_missing_imports = True +follow_imports_for_stubs = True -[mypy-tempfile312.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +[mypy-lief.*] follow_imports = skip -follow_imports_for_stubs = true -ignore_missing_imports = True +follow_imports_for_stubs = True -[mypy-numpy.*] # TODO remove the next two lines when upgrading mypy. Current version has bug. +[mypy-numpy.*] follow_imports = skip -follow_imports_for_stubs = true -ignore_missing_imports = True +follow_imports_for_stubs = True [mypy-binwalk.*] ignore_missing_imports = True