Skip to content

Fix mypy scripts #4320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
ignore_missing_imports = True

; FIXME: #4052 fix mypy errors in the exclude directories and remove them below
exclude = (data_structures|dynamic_programming|graphs|maths|matrix|other|project_euler|scripts|searches|strings*)/$
exclude = (data_structures|dynamic_programming|graphs|maths|matrix|other|project_euler|searches|strings*)/$
2 changes: 1 addition & 1 deletion scripts/validate_filenames.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
try:
from .build_directory_md import good_file_paths
except ImportError:
from build_directory_md import good_file_paths
from build_directory_md import good_file_paths # type: ignore

filepaths = list(good_file_paths())
assert filepaths, "good_file_paths() failed!"
Expand Down
4 changes: 2 additions & 2 deletions scripts/validate_solutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def convert_path_to_module(file_path: pathlib.Path) -> ModuleType:
"""Converts a file path to a Python module"""
spec = importlib.util.spec_from_file_location(file_path.name, str(file_path))
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
spec.loader.exec_module(module) # type: ignore
return module


Expand Down Expand Up @@ -89,5 +89,5 @@ def test_project_euler(solution_path: pathlib.Path) -> None:
problem_number: str = solution_path.parent.name[8:].zfill(3)
expected: str = PROBLEM_ANSWERS[problem_number]
solution_module = convert_path_to_module(solution_path)
answer = str(solution_module.solution())
answer = str(solution_module.solution()) # type: ignore
assert answer == expected, f"Expected {expected} but got {answer}"