MCPcopy Index your code
hub / github.com/python/mypy / SearchPaths

Class SearchPaths

mypy/modulefinder.py:31–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30# Paths to be searched in find_module().
31class 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

Callers 9

process_optionsFunction · 0.90
_make_managerMethod · 0.90
setUpMethod · 0.90
setUpMethod · 0.90
parse_moduleMethod · 0.90
compute_search_pathsFunction · 0.85

Calls

no outgoing calls

Tested by 5

_make_managerMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72
parse_moduleMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…