Converts a file path to a Python module
(file_path: pathlib.Path)
| 28 | |
| 29 | |
| 30 | def convert_path_to_module(file_path: pathlib.Path) -> ModuleType: |
| 31 | """Converts a file path to a Python module""" |
| 32 | spec = importlib.util.spec_from_file_location(file_path.name, str(file_path)) |
| 33 | module = importlib.util.module_from_spec(spec) # type: ignore[arg-type] |
| 34 | spec.loader.exec_module(module) # type: ignore[union-attr] |
| 35 | return module |
| 36 | |
| 37 | |
| 38 | def all_solution_file_paths() -> list[pathlib.Path]: |
no outgoing calls