mypy: add 3 scripts to the "make check_mypy" config

This commit is contained in:
Campbell Barton 2024-11-02 23:18:59 +11:00
parent 8570dd22e7
commit 7b3e2fd7dd
2 changed files with 6 additions and 4 deletions

View file

@ -148,7 +148,7 @@ def keymap_item_property_clean(value: Any) -> Any:
# Convert to `dict` to de-duplicate.
dict([(k, keymap_item_property_clean(v)) for k, v in value]).items(),
# Ignore type checking, these are strings which we know can be sorted.
key=lambda item: item[0], # type: ignore
key=lambda item: item[0],
)
return value
@ -271,8 +271,7 @@ def main() -> None:
relaxed = "--relaxed" in argv
# NOTE(@ideasman42): Disable add-on items as they may cause differences in the key-map.
import addon_utils
addon_utils.disable_all()
__import__("addon_utils").disable_all()
has_error = False

View file

@ -7,6 +7,8 @@ from typing import (
Any,
)
# Notes:
# - Most tests in `tests/python` use `bpy` enough that it's simpler to list the scripts that *are* type checked.
PATHS: tuple[tuple[str, tuple[Any, ...], dict[str, str]], ...] = (
("build_files/cmake/", (), {'MYPYPATH': "modules"}),
("build_files/utils/", (), {'MYPYPATH': "modules"}),
@ -16,6 +18,8 @@ PATHS: tuple[tuple[str, tuple[Any, ...], dict[str, str]], ...] = (
("scripts/modules/_bpy_internal/extensions/wheel_manager.py", (), {}),
("scripts/modules/_bpy_internal/freedesktop.py", (), {}),
("source/blender/nodes/intern/discover_nodes.py", (), {}),
("tests/python/bl_keymap_validate.py", (), {}),
("tests/utils/blender_headless.py", (), {}),
("tools/check_blender_release/", (), {}),
("tools/check_docs/", (), {}),
("tools/check_source/", (), {'MYPYPATH': "modules"}),
@ -61,7 +65,6 @@ PATHS_EXCLUDE = set(
"tools/utils/gdb_struct_repr_c99.py",
"tools/utils/git_log_review_commits.py",
"tools/utils/git_log_review_commits_advanced.py",
"tools/utils/gitea_inactive_developers.py",
"tools/utils/make_cursor_gui.py",
"tools/utils/make_gl_stipple_from_xpm.py",
"tools/utils/make_shape_2d_from_blend.py",