Coverage for circular_deps/models.py: 100%

1 from __future__ import annotations

2

3 from dataclasses import dataclass

4 from typing import Tuple

5

6

7@dataclass

8 class ImportInfo:

9 """Single import extracted from a source file."""

10

11 raw_module: str

12 resolved_path: str | None

13 import_type: str

14 line: int

15 is_dynamic: bool

16 node_type: str

17

18

19@dataclass

20 class Cycle:

21 """Detected circular dependency."""

22

23 files: list[str]

24 edges: list[Tuple[str, str, int]]

25 depth: int

26 severity: str = "warning"

27

28

29@dataclass

30 class DependencyGraph:

31 edges: dict[str, list[ImportInfo]]

32 local_files: set[str]

33 root_dir: str