class FindModuleCache: (source)
Module finder with integrated cache. Module locations and some intermediate results are cached internally and can be cleared with the clear() method. All file system accesses are performed through a FileSystemCache, which is not ever cleared by this class. If necessary it must be cleared by client code.
Method | __init__ |
Undocumented |
Method | clear |
Undocumented |
Method | find |
Find which elements of a lib_path have the directory a module needs to exist. |
Method | find |
Return the path of the module source file or why it wasn't found. |
Method | find |
Fast path to find modules by looking through the input sources |
Method | find |
Undocumented |
Method | get |
Find which elements of lib_path could contain a particular top-level module. |
Instance Variable | fscache |
Undocumented |
Instance Variable | initial |
Undocumented |
Instance Variable | ns |
Undocumented |
Instance Variable | options |
Undocumented |
Instance Variable | results |
Undocumented |
Instance Variable | search |
Undocumented |
Instance Variable | source |
Undocumented |
Instance Variable | stdlib |
Undocumented |
Method | _can |
Test if a module can be found by checking the parent directories of the current working directory. |
Method | _find |
Undocumented |
Method | _find |
Undocumented |
Method | _is |
Does a stub package support the target Python version? |
Method | _typeshed |
Undocumented |
Method | _update |
Undocumented |
SearchPaths
, fscache: FileSystemCache|None
, options: Options|None
, stdlib_py_versions: StdlibVersions|None
= None, source_set: BuildSourceSet|None
= None):
(source)
¶
Undocumented
Find which elements of a lib_path have the directory a module needs to exist. This is run for the python_path, mypy_path, and typeshed_path search paths.
Return the path of the module source file or why it wasn't found. If fast_path is True, prioritize performance over generating detailed error descriptions.
Fast path to find modules by looking through the input sources This is only used when --fast-module-lookup is passed on the command line.
Find which elements of lib_path could contain a particular top-level module. In practice, almost all modules can be routed to the correct entry in lib_path by looking at just the first component of the module name. We take advantage of this by enumerating the contents of all of the directories on the lib_path and building a map of which entries in the lib_path could contain each potential top-level module that appears.
list[ str]
, pkg_dir: str
) -> OnePackageDir|ModuleNotFoundReason
:
(source)
¶
Undocumented