class BuildManager: (source)
This class holds shared state for building a mypy program. It is used to coordinate parsing, import processing, semantic analysis and type checking. The actual build steps are carried out by dispatch(). Attributes: data_dir: Mypy data directory (contains stubs) search_paths: SearchPaths instance indicating where to look for modules modules: Mapping of module ID to MypyFile (shared by the passes) semantic_analyzer: Semantic analyzer, pass 2 all_types: Map {Expression: Type} from all modules (enabled by export_types) options: Build options missing_modules: Set of modules that could not be imported encountered so far stale_modules: Set of modules that needed to be rechecked (only used by tests) fg_deps_meta: Metadata for fine-grained dependencies caches associated with modules fg_deps: A fine-grained dependency map version_id: The current mypy version (based on commit id when possible) plugin: Active mypy plugin(s) plugins_snapshot: Snapshot of currently active user plugins (versions and hashes) old_plugins_snapshot: Plugins snapshot from previous incremental run (or None in non-incremental mode and if cache was not found) errors: Used for reporting all errors flush_errors: A function for processing errors after each SCC cache_enabled: Whether cache is being read. This is set based on options, but is disabled if fine-grained cache loading fails and after an initial fine-grained load. This doesn't determine whether we write cache files or not. quickstart_state: A cache of filename -> mtime/size/hash info used to avoid needing to hash source files when using a cache with mismatching mtimes stats: Dict with various instrumentation numbers, it is used not only for debugging, but also required for correctness, in particular to check consistency of the fine-grained dependency cache. fscache: A file system cacher ast_cache: AST cache to speed up mypy daemon
Method | __init__ |
Undocumented |
Method | add |
Undocumented |
Method | all |
Find all reachable import statements in a file. |
Method | dump |
Undocumented |
Method | get |
Undocumented |
Method | getmtime |
Return a file's mtime; but 0 in bazel mode. |
Method | is |
Is there a file in the file system corresponding to module id? |
Method | load |
Undocumented |
Method | log |
Undocumented |
Method | log |
Undocumented |
Method | maybe |
Undocumented |
Method | parse |
Parse the source of a file with the given name. |
Method | report |
Undocumented |
Method | stats |
Undocumented |
Method | trace |
Undocumented |
Method | use |
Undocumented |
Method | verbosity |
Undocumented |
Instance Variable | all |
Undocumented |
Instance Variable | ast |
Undocumented |
Instance Variable | cache |
Undocumented |
Instance Variable | data |
Undocumented |
Instance Variable | errors |
Undocumented |
Instance Variable | fg |
Undocumented |
Instance Variable | fg |
Undocumented |
Instance Variable | find |
Undocumented |
Instance Variable | flush |
Undocumented |
Instance Variable | fscache |
Undocumented |
Instance Variable | incomplete |
Undocumented |
Instance Variable | indirection |
Undocumented |
Instance Variable | metastore |
Undocumented |
Instance Variable | missing |
Undocumented |
Instance Variable | missing |
Undocumented |
Instance Variable | modules |
Undocumented |
Instance Variable | old |
Undocumented |
Instance Variable | options |
Undocumented |
Instance Variable | plugin |
Undocumented |
Instance Variable | plugins |
Undocumented |
Instance Variable | processed |
Undocumented |
Instance Variable | quickstart |
Undocumented |
Instance Variable | rechecked |
Undocumented |
Instance Variable | reports |
Undocumented |
Instance Variable | search |
Undocumented |
Instance Variable | semantic |
Undocumented |
Instance Variable | shadow |
Undocumented |
Instance Variable | shadow |
Undocumented |
Instance Variable | source |
Undocumented |
Instance Variable | stale |
Undocumented |
Instance Variable | start |
Undocumented |
Instance Variable | stats |
Undocumented |
Instance Variable | stderr |
Undocumented |
Instance Variable | stdout |
Undocumented |
Instance Variable | version |
Undocumented |
str
, search_paths: SearchPaths
, ignore_prefix: str
, source_set: BuildSourceSet
, reports: Reports|None
, options: Options
, version_id: str
, plugin: Plugin
, plugins_snapshot: dict[ str, str]
, errors: Errors
, flush_errors: Callable[ [ list[ str], bool], None]
, fscache: FileSystemCache
, stdout: TextIO
, stderr: TextIO
):
(source)
¶
Undocumented
Find all reachable import statements in a file. Return list of tuples (priority, module id, import line number) for all modules imported in file; lower numbers == higher priority. Can generate blocking errors on bogus relative imports.
Return a file's mtime; but 0 in bazel mode. (Bazel's distributed cache doesn't like filesystem metadata to end up in output files.)
str
, path: str
, source: str
, ignore_errors: bool
, options: Options
) -> MypyFile
:
(source)
¶
Parse the source of a file with the given name. Raise CompileError if there is a parse error.