| 29 | |
| 30 | # Paths to be searched in find_module(). |
| 31 | class SearchPaths: |
| 32 | def __init__( |
| 33 | self, |
| 34 | python_path: tuple[str, ...], |
| 35 | mypy_path: tuple[str, ...], |
| 36 | package_path: tuple[str, ...], |
| 37 | typeshed_path: tuple[str, ...], |
| 38 | ) -> None: |
| 39 | # where user code is found |
| 40 | self.python_path = tuple(map(os.path.abspath, python_path)) |
| 41 | # from $MYPYPATH or config variable |
| 42 | self.mypy_path = tuple(map(os.path.abspath, mypy_path)) |
| 43 | # from get_site_packages_dirs() |
| 44 | self.package_path = tuple(map(os.path.abspath, package_path)) |
| 45 | # paths in typeshed |
| 46 | self.typeshed_path = tuple(map(os.path.abspath, typeshed_path)) |
| 47 | |
| 48 | def asdict(self) -> dict[str, tuple[str, ...]]: |
| 49 | return { |
| 50 | "python_path": self.python_path, |
| 51 | "mypy_path": self.mypy_path, |
| 52 | "package_path": self.package_path, |
| 53 | "typeshed_path": self.typeshed_path, |
| 54 | } |
| 55 | |
| 56 | |
| 57 | # Package dirs are a two-tuple of path to search and whether to verify the module |
no outgoing calls
searching dependent graphs…