module documentation
(source)

Facilities to analyze entire programs, including imported modules.

Parse and analyze the source files of a program in the correct order (based on file dependencies), and collect the results.

This module only directs a build, which is performed in multiple passes per file. The individual passes are implemented in separate modules.

The function build() is the main interface to this module.

Class ​Build​Manager This class holds shared state for building a mypy program.
Class ​Build​Result The result of a successful build.
Class ​Build​Source​Set Efficiently test a file's membership in the set of build sources.
Class ​Module​Not​Found Control flow exception to signal that a module was not found.
Class ​Node​Info Some info about a node in the graph of SCCs.
Class ​State The state for a module.
Function add​_catch​_all​_gitignore Add catch-all .gitignore to an existing directory.
Function build Analyze a program.
Function cache​_meta​_from​_dict Build a CacheMeta object from a json metadata dictionary
Function compute​_hash Undocumented
Function create​_metastore Create the appropriate metadata store.
Function default​_data​_dir Returns directory containing typeshed directory.
Function delete​_cache Delete cache files for a module.
Function deps​_filtered Filter dependencies for id with pri < pri_max.
Function deps​_to​_json Undocumented
Function dispatch Undocumented
Function dump​_graph Dump the graph as a JSON string to stdout.
Function exclude​_from​_backups Exclude the directory from various archives and backups supporting CACHEDIR.TAG.
Function exist​_added​_packages Find if there are any newly added packages that were previously suppressed.
Function find​_cache​_meta Find cache data for a module.
Function find​_config​_file​_line​_number Return the approximate location of setting_name within mypy config file.
Function find​_module​_and​_diagnose Find a module by name, respecting follow_imports and producing diagnostics.
Function find​_module​_simple Find a filesystem path for module id or None if not found.
Function find​_module​_with​_reason Find a filesystem path for module id or the reason it can't be found.
Function generate​_deps​_for​_cache Generate fine-grained dependencies into a form suitable for serializing.
Function get​_cache​_names Return the file names for the cache files.
Function import​_priority Compute import priority from an import node.
Function in​_partial​_package Check if a missing module can potentially be a part of a package.
Function invert​_deps Splits fine-grained dependencies based on the module of the trigger.
Function json​_dumps Undocumented
Function load​_graph Given some source files, load the full dependency graph.
Function load​_plugins Load all configured plugins.
Function load​_plugins​_from​_config Load all configured plugins.
Function log​_configuration Output useful configuration information to LOG and TRACE
Function missing​_stubs​_file Undocumented
Function module​_not​_found Undocumented
Function normpath Convert path to absolute; but to relative in bazel mode.
Function order​_ascc Come up with the ideal processing order within an SCC.
Function process​_fresh​_modules Process the modules in one group of modules from their cached data.
Function process​_graph Process everything in dependency order.
Function process​_stale​_scc Process the modules in one SCC from source code.
Function read​_deps​_cache Read and validate the fine-grained dependencies cache.
Function read​_plugins​_snapshot Read cached snapshot of versions and hashes of plugins from previous run.
Function read​_quickstart​_file Undocumented
Function record​_missing​_stub​_packages Write a file containing missing stub packages.
Function skipping​_ancestor Produce an error for an ancestor ignored due to --follow_imports=error
Function skipping​_module Produce an error for an import ignored due to --follow_imports=error
Function sorted​_components Return the graph's SCCs, topologically sorted by dependencies.
Function strongly​_connected​_components Compute Strongly Connected Components of a directed graph.
Function take​_module​_snapshot Take plugin module snapshot by recording its version and hash.
Function topsort Topological sort.
Function validate​_meta Checks whether the cached AST of this module can be used.
Function write​_cache Write cache files for a module.
Function write​_deps​_cache Write cache files for fine-grained dependencies.
Function write​_plugins​_snapshot Write snapshot of versions and hashes of currently active plugins.
Constant CORE​_BUILTIN​_MODULES Undocumented
Constant DEBUG​_FINE​_GRAINED Undocumented
Constant DEPS​_META​_FILE Undocumented
Constant DEPS​_ROOT​_FILE Undocumented
Constant FAKE​_ROOT​_MODULE Undocumented
Constant PLUGIN​_SNAPSHOT​_FILE Undocumented
Constant PRI​_ALL Undocumented
Constant PRI​_HIGH Undocumented
Constant PRI​_INDIRECT Undocumented
Constant PRI​_LOW Undocumented
Constant PRI​_MED Undocumented
Constant PRI​_MYPY Undocumented
Constant T Undocumented
Variable ​Cache​Meta Undocumented
Variable ​Fg​Dep​Meta Undocumented
Variable ​Graph Undocumented
Function _build Undocumented
Function _cache​_dir​_prefix Get current cache directory (or file if id is given).
Function _load​_json​_file A simple helper to read a JSON file with logging.
def add_catch_all_gitignore(target_dir): (source)

Add catch-all .gitignore to an existing directory.

No-op if the .gitignore already exists.

Parameters
target​_dir:strUndocumented
def build(sources, options, alt_lib_path=None, flush_errors=None, fscache=None, stdout=None, stderr=None, extra_plugins=None): (source)

Analyze a program.

A single call to build performs parsing, semantic analysis and optionally type checking for the program and all imported modules, recursively.

Return BuildResult if successful or only non-blocking errors were found; otherwise raise CompileError.

If a flush_errors callback is provided, all error messages will be passed to it and the errors and messages fields of BuildResult and CompileError (respectively) will be empty. Otherwise those fields will report any error messages.

Args:

sources: list of sources to build options: build options alt_lib_path: an additional directory for looking up library modules

(takes precedence over other directories)

flush_errors: optional function to flush errors after a file is processed fscache: optionally a file-system cacher

Parameters
sources:List[BuildSource]Undocumented
options:OptionsUndocumented
alt​_lib​_path:Optional[str]Undocumented
flush​_errors:Optional[Callable[[List[str], bool], None]]Undocumented
fscache:Optional[FileSystemCache]Undocumented
stdout:Optional[TextIO]Undocumented
stderr:Optional[TextIO]Undocumented
extra​_plugins:Optional[Sequence[Plugin]]Undocumented
Returns
BuildResultUndocumented
def cache_meta_from_dict(meta, data_json): (source)

Build a CacheMeta object from a json metadata dictionary

Args:
meta: JSON metadata read from the metadata cache file data_json: Path to the .data.json file containing the AST trees
Parameters
meta:Dict[str, Any]Undocumented
data​_json:strUndocumented
Returns
CacheMetaUndocumented
def compute_hash(text): (source)

Undocumented

Parameters
text:strUndocumented
Returns
strUndocumented
def create_metastore(options): (source)
Create the appropriate metadata store.
Parameters
options:OptionsUndocumented
Returns
MetadataStoreUndocumented
def default_data_dir(): (source)
Returns directory containing typeshed directory.
Returns
strUndocumented
def delete_cache(id, path, manager): (source)

Delete cache files for a module.

The cache files for a module are deleted when mypy finds errors there. This avoids inconsistent states with cache files from different mypy runs, see #4043 for an example.

Parameters
id:strUndocumented
path:strUndocumented
manager:BuildManagerUndocumented
def deps_filtered(graph, vertices, id, pri_max): (source)
Filter dependencies for id with pri < pri_max.
Parameters
graph:GraphUndocumented
vertices:AbstractSet[str]Undocumented
id:strUndocumented
pri​_max:intUndocumented
Returns
List[str]Undocumented
def deps_to_json(x): (source)

Undocumented

Parameters
x:Dict[str, Set[str]]Undocumented
Returns
strUndocumented
def dispatch(sources, manager, stdout): (source)

Undocumented

Parameters
sources:List[BuildSource]Undocumented
manager:BuildManagerUndocumented
stdout:TextIOUndocumented
Returns
GraphUndocumented
def dump_graph(graph, stdout=None): (source)

Dump the graph as a JSON string to stdout.

This copies some of the work by process_graph() (sorted_components() and order_ascc()).

Parameters
graph:GraphUndocumented
stdout:Optional[TextIO]Undocumented
def exclude_from_backups(target_dir): (source)

Exclude the directory from various archives and backups supporting CACHEDIR.TAG.

If the CACHEDIR.TAG file exists the function is a no-op.

Parameters
target​_dir:strUndocumented
def exist_added_packages(suppressed, manager, options): (source)

Find if there are any newly added packages that were previously suppressed.

Exclude everything not in build for follow-imports=skip.

Parameters
suppressed:List[str]Undocumented
manager:BuildManagerUndocumented
options:OptionsUndocumented
Returns
boolUndocumented
def find_cache_meta(id, path, manager): (source)

Find cache data for a module.

Args:
id: module ID path: module path manager: the build manager (for pyversion, log/trace, and build options)
Returns:
A CacheMeta instance if the cache data was found and appears valid; otherwise None.
Parameters
id:strUndocumented
path:strUndocumented
manager:BuildManagerUndocumented
Returns
Optional[CacheMeta]Undocumented
def find_config_file_line_number(path, section, setting_name): (source)

Return the approximate location of setting_name within mypy config file.

Return -1 if can't determine the line unambiguously.

Parameters
path:strUndocumented
section:strUndocumented
setting​_name:strUndocumented
Returns
intUndocumented
def find_module_and_diagnose(manager, id, options, caller_state=None, caller_line=0, ancestor_for=None, root_source=False, skip_diagnose=False): (source)

Find a module by name, respecting follow_imports and producing diagnostics.

If the module is not found, then the ModuleNotFound exception is raised.

Args:

id: module to find options: the options for the module being loaded caller_state: the state of the importing module, if applicable caller_line: the line number of the import ancestor_for: the child module this is an ancestor of, if applicable root_source: whether this source was specified on the command line skip_diagnose: skip any error diagnosis and reporting (but ModuleNotFound is

still raised if the module is missing)

The specified value of follow_imports for a module can be overridden if the module is specified on the command line or if it is a stub, so we compute and return the "effective" follow_imports of the module.

Returns a tuple containing (file path, target's effective follow_imports setting)

Parameters
manager:BuildManagerUndocumented
id:strUndocumented
options:OptionsUndocumented
caller​_state:Optional[State]Undocumented
caller​_line:intUndocumented
ancestor​_for:Optional[State]Undocumented
root​_source:boolUndocumented
skip​_diagnose:boolUndocumented
Returns
Tuple[str, str]Undocumented
def find_module_simple(id, manager): (source)
Find a filesystem path for module id or None if not found.
Parameters
id:strUndocumented
manager:BuildManagerUndocumented
Returns
Optional[str]Undocumented
def find_module_with_reason(id, manager): (source)
Find a filesystem path for module id or the reason it can't be found.
Parameters
id:strUndocumented
manager:BuildManagerUndocumented
Returns
ModuleSearchResultUndocumented
def generate_deps_for_cache(manager, graph): (source)

Generate fine-grained dependencies into a form suitable for serializing.

This does a couple things: 1. Splits fine-grained deps based on the module of the trigger 2. For each module we generated fine-grained deps for, load any previous

deps and merge them in.

Returns a dictionary from module ids to all dependencies on that module. Dependencies not associated with a module in the build will be associated with the nearest parent module that is in the build, or the fake module FAKE_ROOT_MODULE if none are.

Parameters
manager:BuildManagerUndocumented
graph:GraphUndocumented
Returns
Dict[str, Dict[str, Set[str]]]Undocumented
def get_cache_names(id, path, options): (source)

Return the file names for the cache files.

Args:
id: module ID path: module path cache_dir: cache directory pyversion: Python version (major, minor)
Returns:
A tuple with the file names to be used for the meta JSON, the data JSON, and the fine-grained deps JSON, respectively.
Parameters
id:strUndocumented
path:strUndocumented
options:OptionsUndocumented
Returns
Tuple[str, str, Optional[str]]Undocumented
def import_priority(imp, toplevel_priority): (source)
Compute import priority from an import node.
Parameters
imp:ImportBaseUndocumented
toplevel​_priority:intUndocumented
Returns
intUndocumented
def in_partial_package(id, manager): (source)

Check if a missing module can potentially be a part of a package.

This checks if there is any existing parent __init__.pyi stub that defines a module-level __getattr__ (a.k.a. partial stub package).

Parameters
id:strUndocumented
manager:BuildManagerUndocumented
Returns
boolUndocumented
def invert_deps(deps, graph): (source)

Splits fine-grained dependencies based on the module of the trigger.

Returns a dictionary from module ids to all dependencies on that module. Dependencies not associated with a module in the build will be associated with the nearest parent module that is in the build, or the fake module FAKE_ROOT_MODULE if none are.

Parameters
deps:Dict[str, Set[str]]Undocumented
graph:GraphUndocumented
Returns
Dict[str, Dict[str, Set[str]]]Undocumented
def json_dumps(obj, debug_cache): (source)

Undocumented

Parameters
obj:AnyUndocumented
debug​_cache:boolUndocumented
Returns
strUndocumented
def load_graph(sources, manager, old_graph=None, new_modules=None): (source)

Given some source files, load the full dependency graph.

If an old_graph is passed in, it is used as the starting point and modified during graph loading.

If a new_modules is passed in, any modules that are loaded are added to the list. This is an argument and not a return value so that the caller can access it even if load_graph fails.

As this may need to parse files, this can raise CompileError in case there are syntax errors.

Parameters
sources:List[BuildSource]Undocumented
manager:BuildManagerUndocumented
old​_graph:Optional[Graph]Undocumented
new​_modules:Optional[List[State]]Undocumented
Returns
GraphUndocumented
def load_plugins(options, errors, stdout, extra_plugins): (source)

Load all configured plugins.

Return a plugin that encapsulates all plugins chained together. Always at least include the default plugin (it's last in the chain). The second return value is a snapshot of versions/hashes of loaded user plugins (for cache validation).

Parameters
options:OptionsUndocumented
errors:ErrorsUndocumented
stdout:TextIOUndocumented
extra​_plugins:Sequence[Plugin]Undocumented
Returns
Tuple[Plugin, Dict[str, str]]Undocumented
def load_plugins_from_config(options, errors, stdout): (source)

Load all configured plugins.

Return a list of all the loaded plugins from the config file. The second return value is a snapshot of versions/hashes of loaded user plugins (for cache validation).

Parameters
options:OptionsUndocumented
errors:ErrorsUndocumented
stdout:TextIOUndocumented
Returns
Tuple[List[Plugin], Dict[str, str]]Undocumented
def log_configuration(manager, sources): (source)
Output useful configuration information to LOG and TRACE
Parameters
manager:BuildManagerUndocumented
sources:List[BuildSource]Undocumented
def missing_stubs_file(cache_dir): (source)

Undocumented

Parameters
cache​_dir:strUndocumented
Returns
strUndocumented
def module_not_found(manager, line, caller_state, target, reason): (source)

Undocumented

Parameters
manager:BuildManagerUndocumented
line:intUndocumented
caller​_state:StateUndocumented
target:strUndocumented
reason:ModuleNotFoundReasonUndocumented
def normpath(path, options): (source)

Convert path to absolute; but to relative in bazel mode.

(Bazel's distributed cache doesn't like filesystem metadata to end up in output files.)

Parameters
path:strUndocumented
options:OptionsUndocumented
Returns
strUndocumented
def order_ascc(graph, ascc, pri_max=PRI_ALL): (source)

Come up with the ideal processing order within an SCC.

Using the priorities assigned by all_imported_modules_in_file(), try to reduce the cycle to a DAG, by omitting arcs representing dependencies of lower priority.

In the simplest case, if we have A <--> B where A has a top-level "import B" (medium priority) but B only has the reverse "import A" inside a function (low priority), we turn the cycle into a DAG by dropping the B --> A arc, which leaves only A --> B.

If all arcs have the same priority, we fall back to sorting by reverse global order (the order in which modules were first encountered).

The algorithm is recursive, as follows: when as arcs of different priorities are present, drop all arcs of the lowest priority, identify SCCs in the resulting graph, and apply the algorithm to each SCC thus found. The recursion is bounded because at each recursion the spread in priorities is (at least) one less.

In practice there are only a few priority levels (less than a dozen) and in the worst case we just carry out the same algorithm for finding SCCs N times. Thus the complexity is no worse than the complexity of the original SCC-finding algorithm -- see strongly_connected_components() below for a reference.

Parameters
graph:GraphUndocumented
ascc:AbstractSet[str]Undocumented
pri​_max:intUndocumented
Returns
List[str]Undocumented
def process_fresh_modules(graph, modules, manager): (source)

Process the modules in one group of modules from their cached data.

This can be used to process an SCC of modules This involves loading the tree from JSON and then doing various cleanups.

Parameters
graph:GraphUndocumented
modules:List[str]Undocumented
manager:BuildManagerUndocumented
def process_graph(graph, manager): (source)
Process everything in dependency order.
Parameters
graph:GraphUndocumented
manager:BuildManagerUndocumented
def process_stale_scc(graph, scc, manager): (source)

Process the modules in one SCC from source code.

Exception: If quick_and_dirty is set, use the cache for fresh modules.

Parameters
graph:GraphUndocumented
scc:List[str]Undocumented
manager:BuildManagerUndocumented
def read_deps_cache(manager, graph): (source)

Read and validate the fine-grained dependencies cache.

See the write_deps_cache documentation for more information on the details of the cache.

Returns None if the cache was invalid in some way.

Parameters
manager:BuildManagerUndocumented
graph:GraphUndocumented
Returns
Optional[Dict[str, FgDepMeta]]Undocumented
def read_plugins_snapshot(manager): (source)
Read cached snapshot of versions and hashes of plugins from previous run.
Parameters
manager:BuildManagerUndocumented
Returns
Optional[Dict[str, str]]Undocumented
def read_quickstart_file(options, stdout): (source)

Undocumented

Parameters
options:OptionsUndocumented
stdout:TextIOUndocumented
Returns
Optional[Dict[str, Tuple[float, int, str]]]Undocumented
def record_missing_stub_packages(cache_dir, missing_stub_packages): (source)

Write a file containing missing stub packages.

This allows a subsequent "mypy --install-types" run (without other arguments) to install missing stub packages.

Parameters
cache​_dir:strUndocumented
missing​_stub​_packages:Set[str]Undocumented
def skipping_ancestor(manager, id, path, ancestor_for): (source)
Produce an error for an ancestor ignored due to --follow_imports=error
Parameters
manager:BuildManagerUndocumented
id:strUndocumented
path:strUndocumented
ancestor​_for:StateUndocumented
def skipping_module(manager, line, caller_state, id, path): (source)
Produce an error for an import ignored due to --follow_imports=error
Parameters
manager:BuildManagerUndocumented
line:intUndocumented
caller​_state:Optional[State]Undocumented
id:strUndocumented
path:strUndocumented
def sorted_components(graph, vertices=None, pri_max=PRI_ALL): (source)

Return the graph's SCCs, topologically sorted by dependencies.

The sort order is from leaves (nodes without dependencies) to roots (nodes on which no other nodes depend).

This works for a subset of the full dependency graph too; dependencies that aren't present in graph.keys() are ignored.

Parameters
graph:GraphUndocumented
vertices:Optional[AbstractSet[str]]Undocumented
pri​_max:intUndocumented
Returns
List[AbstractSet[str]]Undocumented
def strongly_connected_components(vertices, edges): (source)

Compute Strongly Connected Components of a directed graph.

Args:
vertices: the labels for the vertices edges: for each vertex, gives the target vertices of its outgoing edges
Returns:
An iterator yielding strongly connected components, each represented as a set of vertices. Each input vertex will occur exactly once; vertices not part of a SCC are returned as singleton sets.

From http://code.activestate.com/recipes/578507/.

Parameters
vertices:AbstractSet[str]Undocumented
edges:Dict[str, List[str]]Undocumented
Returns
Iterator[Set[str]]Undocumented
def take_module_snapshot(module): (source)

Take plugin module snapshot by recording its version and hash.

We record _both_ hash and the version to detect more possible changes (e.g. if there is a change in modules imported by a plugin).

Parameters
module:types.ModuleTypeUndocumented
Returns
strUndocumented
def topsort(data): (source)

Topological sort.

Args:
data: A map from vertices to all vertices that it has an edge
connecting it to. NOTE: This data structure is modified in place -- for normalization purposes, self-dependencies are removed and entries representing orphans are added.
Returns:
An iterator yielding sets of vertices that have an equivalent ordering.
Example:

Suppose the input has the following structure:

{A: {B, C}, B: {D}, C: {D}}

This is normalized to:

{A: {B, C}, B: {D}, C: {D}, D: {}}

The algorithm will yield the following values:

{D} {B, C} {A}

From http://code.activestate.com/recipes/577413/.

Parameters
data:Dict[T, Set[T]]Undocumented
Returns
Iterable[Set[T]]Undocumented
def validate_meta(meta, id, path, ignore_all, manager): (source)

Checks whether the cached AST of this module can be used.

Returns:
None, if the cached AST is unusable. Original meta, if mtime/size matched. Meta with mtime updated to match source file, if hash/size matched but mtime/path didn't.
Parameters
meta:Optional[CacheMeta]Undocumented
id:strUndocumented
path:Optional[str]Undocumented
ignore​_all:boolUndocumented
manager:BuildManagerUndocumented
Returns
Optional[CacheMeta]Undocumented
def write_cache(id, path, tree, dependencies, suppressed, dep_prios, dep_lines, old_interface_hash, source_hash, ignore_all, manager): (source)

Write cache files for a module.

Note that this mypy's behavior is still correct when any given write_cache() call is replaced with a no-op, so error handling code that bails without writing anything is okay.

Args:
id: module ID path: module path tree: the fully checked module data dependencies: module IDs on which this module depends suppressed: module IDs which were suppressed as dependencies dep_prios: priorities (parallel array to dependencies) dep_lines: import line locations (parallel array to dependencies) old_interface_hash: the hash from the previous version of the data cache file source_hash: the hash of the source code ignore_all: the ignore_all flag for this module manager: the build manager (for pyversion, log/trace)
Returns:
A tuple containing the interface hash and CacheMeta corresponding to the metadata that was written (the latter may be None if the cache could not be written).
Parameters
id:strUndocumented
path:strUndocumented
tree:MypyFileUndocumented
dependencies:List[str]Undocumented
suppressed:List[str]Undocumented
dep​_prios:List[int]Undocumented
dep​_lines:List[int]Undocumented
old​_interface​_hash:strUndocumented
source​_hash:strUndocumented
ignore​_all:boolUndocumented
manager:BuildManagerUndocumented
Returns
Tuple[str, Optional[CacheMeta]]Undocumented
def write_deps_cache(rdeps, manager, graph): (source)

Write cache files for fine-grained dependencies.

Serialize fine-grained dependencies map for fine grained mode.

Dependencies on some module 'm' is stored in the dependency cache file m.deps.json. This entails some spooky action at a distance: if module 'n' depends on 'm', that produces entries in m.deps.json. When there is a dependency on a module that does not exist in the build, it is stored with its first existing parent module. If no such module exists, it is stored with the fake module FAKE_ROOT_MODULE.

This means that the validity of the fine-grained dependency caches are a global property, so we store validity checking information for fine-grained dependencies in a global cache file:

  • We take a snapshot of current sources to later check consistency between the fine-grained dependency cache and module cache metadata
  • We store the mtime of all of the dependency files to verify they haven't changed
Parameters
rdeps:Dict[str, Dict[str, Set[str]]]Undocumented
manager:BuildManagerUndocumented
graph:GraphUndocumented
def write_plugins_snapshot(manager): (source)
Write snapshot of versions and hashes of currently active plugins.
Parameters
manager:BuildManagerUndocumented
CORE_BUILTIN_MODULES: set[str] = (source)

Undocumented

Value
set(['builtins',
     'typing',
     'types',
     'typing_extensions',
     'mypy_extensions',
     '_importlib_modulespec',
     'sys',
...
DEBUG_FINE_GRAINED: bool = (source)

Undocumented

Value
False
DEPS_META_FILE: str = (source)

Undocumented

Value
'@deps.meta.json'
DEPS_ROOT_FILE: str = (source)

Undocumented

Value
'@root.deps.json'
FAKE_ROOT_MODULE: str = (source)

Undocumented

Value
'@root'
PLUGIN_SNAPSHOT_FILE: str = (source)

Undocumented

Value
'@plugins_snapshot.json'
PRI_ALL: int = (source)

Undocumented

Value
99
PRI_HIGH: int = (source)

Undocumented

Value
5
PRI_INDIRECT: int = (source)

Undocumented

Value
30
PRI_LOW: int = (source)

Undocumented

Value
20
PRI_MED: int = (source)

Undocumented

Value
10
PRI_MYPY: int = (source)

Undocumented

Value
25

Undocumented

Value
TypeVar('T')
CacheMeta = (source)

Undocumented

FgDepMeta = (source)

Undocumented

Graph: _TypeAlias = (source)

Undocumented

def _build(sources, options, alt_lib_path, flush_errors, fscache, stdout, stderr, extra_plugins): (source)

Undocumented

Parameters
sources:List[BuildSource]Undocumented
options:OptionsUndocumented
alt​_lib​_path:Optional[str]Undocumented
flush​_errors:Callable[[List[str], bool], None]Undocumented
fscache:Optional[FileSystemCache]Undocumented
stdout:TextIOUndocumented
stderr:TextIOUndocumented
extra​_plugins:Sequence[Plugin]Undocumented
Returns
BuildResultUndocumented
def _cache_dir_prefix(options): (source)
Get current cache directory (or file if id is given).
Parameters
options:OptionsUndocumented
Returns
strUndocumented
def _load_json_file(file, manager, log_success, log_error): (source)
A simple helper to read a JSON file with logging.
Parameters
file:strUndocumented
manager:BuildManagerUndocumented
log​_success:strUndocumented
log​_error:strUndocumented
Returns
Optional[Dict[str, Any]]Undocumented