Produce an error for an ancestor ignored due to --follow_imports=error
(manager: BuildManager, id: str, path: str, ancestor_for: State)
| 3997 | |
| 3998 | |
| 3999 | def skipping_ancestor(manager: BuildManager, id: str, path: str, ancestor_for: State) -> None: |
| 4000 | """Produce an error for an ancestor ignored due to --follow_imports=error""" |
| 4001 | # TODO: Read the path (the __init__.py file) and return |
| 4002 | # immediately if it's empty or only contains comments. |
| 4003 | # But beware, some package may be the ancestor of many modules, |
| 4004 | # so we'd need to cache the decision. |
| 4005 | save_import_context = manager.errors.import_context() |
| 4006 | manager.errors.set_import_context([]) |
| 4007 | manager.errors.set_file(ancestor_for.xpath, ancestor_for.id, manager.options) |
| 4008 | manager.error(None, f'Ancestor package "{id}" ignored', only_once=True) |
| 4009 | manager.note( |
| 4010 | None, "(Using --follow-imports=error, submodule passed on command line)", only_once=True |
| 4011 | ) |
| 4012 | manager.errors.set_import_context(save_import_context) |
| 4013 | |
| 4014 | |
| 4015 | def log_configuration(manager: BuildManager, sources: list[BuildSource]) -> None: |
no test coverage detected
searching dependent graphs…