import a lazy import module using signature Args: signature (tuple): a tuple of str, (registry_name, registry_group_name, module_name)
(signature)
| 506 | |
| 507 | @staticmethod |
| 508 | def import_module(signature): |
| 509 | """ import a lazy import module using signature |
| 510 | |
| 511 | Args: |
| 512 | signature (tuple): a tuple of str, (registry_name, registry_group_name, module_name) |
| 513 | """ |
| 514 | ast_index = LazyImportModule.get_ast_index() |
| 515 | if signature in ast_index[INDEX_KEY]: |
| 516 | mod_index = ast_index[INDEX_KEY][signature] |
| 517 | module_name = mod_index[MODULE_KEY] |
| 518 | if module_name in ast_index[REQUIREMENT_KEY]: |
| 519 | requirements = ast_index[REQUIREMENT_KEY][module_name] |
| 520 | requires(module_name, requirements) |
| 521 | importlib.import_module(module_name) |
| 522 | else: |
| 523 | logger.warning(f'{signature} not found in ast index file') |
| 524 | |
| 525 | |
| 526 | def has_attr_in_class(cls, attribute_name) -> bool: |
no test coverage detected