(name: str, path: str)
| 15 | # Import relative path |
| 16 | # https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly |
| 17 | def import_module(name: str, path: str) -> ModuleType: |
| 18 | spec = _importlib_util.spec_from_file_location(name, path) |
| 19 | if spec is None or spec.loader is None: |
| 20 | msg = f'could not load module spec for "{name}" at {path}' |
| 21 | raise RuntimeError(msg) |
| 22 | mod = _importlib_util.module_from_spec(spec) |
| 23 | sys.modules[name] = mod |
| 24 | spec.loader.exec_module(mod) |
| 25 | return mod |
| 26 | |
| 27 | |
| 28 | def resolve_app(mod: ModuleType, module_name: str, var: str) -> tuple[str, Any]: |
no outgoing calls
no test coverage detected