Parse library file and extract all imported module names.
(content: str)
| 125 | |
| 126 | |
| 127 | def parse_lib_imports(content: str) -> frozenset[str]: |
| 128 | """Parse library file and extract all imported module names.""" |
| 129 | if not (tree := safe_parse_ast(content)): |
| 130 | return set() |
| 131 | |
| 132 | visitor = ImportVisitor() |
| 133 | visitor.visit(tree) |
| 134 | return visitor.lib_imports |
| 135 | |
| 136 | |
| 137 | # === TODO marker utilities === |