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

Class BuildManager

mypy/build.py:788–1586  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

786
787
788class BuildManager:
789 """This class holds shared state for building a mypy program.
790
791 It is used to coordinate parsing, import processing, semantic
792 analysis and type checking. The actual build steps are carried
793 out by dispatch().
794
795 Attributes:
796 data_dir: Mypy data directory (contains stubs)
797 search_paths: SearchPaths instance indicating where to look for modules
798 modules: Mapping of module ID to MypyFile (shared by the passes)
799 semantic_analyzer:
800 Semantic analyzer, pass 2
801 all_types: Map {Expression: Type} from all modules (enabled by export_types)
802 options: Build options
803 missing_modules: Modules that could not be imported (or intentionally skipped)
804 stale_modules: Set of modules that needed to be rechecked (only used by tests)
805 fg_deps_meta: Metadata for fine-grained dependencies caches associated with modules
806 fg_deps: A fine-grained dependency map
807 version_id: The current mypy version (based on commit id when possible)
808 plugin: Active mypy plugin(s)
809 plugins_snapshot:
810 Snapshot of currently active user plugins (versions and hashes)
811 old_plugins_snapshot:
812 Plugins snapshot from previous incremental run (or None in
813 non-incremental mode and if cache was not found)
814 errors: Used for reporting all errors
815 flush_errors: A function for processing errors after each SCC
816 cache_enabled: Whether cache is being read. This is set based on options,
817 but is disabled if fine-grained cache loading fails
818 and after an initial fine-grained load. This doesn't
819 determine whether we write cache files or not.
820 quickstart_state:
821 A cache of filename -> mtime/size/hash info used to avoid
822 needing to hash source files when using a cache with mismatching mtimes
823 stats: Dict with various instrumentation numbers, it is used
824 not only for debugging, but also required for correctness,
825 in particular to check consistency of the fine-grained dependency cache.
826 fscache: A file system cacher
827 ast_cache: AST cache to speed up mypy daemon
828 """
829
830 def __init__(
831 self,
832 data_dir: str,
833 search_paths: SearchPaths,
834 ignore_prefix: str,
835 source_set: BuildSourceSet,
836 reports: Reports | None,
837 options: Options,
838 version_id: str,
839 plugin: Plugin,
840 plugins_snapshot: dict[str, str],
841 errors: Errors,
842 flush_errors: Callable[[str | None, list[str], bool], None],
843 fscache: FileSystemCache,
844 stdout: TextIO,
845 stderr: TextIO,

Callers 3

_make_managerMethod · 0.90
setup_worker_managerFunction · 0.90
build_innerFunction · 0.85

Calls

no outgoing calls

Tested by 1

_make_managerMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…