class documentation

class FineGrainedBuildManager: (source)

View In Hierarchy

Undocumented

Method __init__ Initialize fine-grained build based on a batch build.
Method flush​_cache Flush AST cache.
Method trigger Trigger a specific target explicitly.
Method update Update previous build result by processing changed modules.
Method update​_module Update a single modified module.
Method update​_one Process a module from the list of changed modules.
Instance Variable blocking​_error Undocumented
Instance Variable changed​_modules Undocumented
Instance Variable deps Undocumented
Instance Variable graph Undocumented
Instance Variable manager Undocumented
Instance Variable previous​_messages Undocumented
Instance Variable previous​_modules Undocumented
Instance Variable previous​_targets​_with​_errors Undocumented
Instance Variable processed​_targets Undocumented
Instance Variable stale Undocumented
Instance Variable triggered Undocumented
Instance Variable updated​_modules Undocumented
def __init__(self, result): (source)

Initialize fine-grained build based on a batch build.

Args:
result: Result from the initialized build.
The manager and graph will be taken over by this class.

manager: State of the build (mutated by this class) graph: Additional state of the build (mutated by this class)

Parameters
result:BuildResultUndocumented
def flush_cache(self): (source)

Flush AST cache.

This needs to be called after each increment, or file changes won't be detected reliably.

def trigger(self, target): (source)

Trigger a specific target explicitly.

This is intended for use by the suggestions engine.

Parameters
target:strUndocumented
Returns
List[str]Undocumented
def update(self, changed_modules, removed_modules): (source)

Update previous build result by processing changed modules.

Also propagate changes to other modules as needed, but only process those parts of other modules that are affected by the changes. Retain the existing ASTs and symbol tables of unaffected modules.

Reuses original BuildManager and Graph.

Args:
changed_modules: Modules changed since the previous update/build; each is
a (module id, path) tuple. Includes modified and added modules. Assume this is correct; it's not validated here.
removed_modules: Modules that have been deleted since the previous update
or removed from the build.
Returns:
A list of errors.
Parameters
changed​_modules:List[Tuple[str, str]]Undocumented
removed​_modules:List[Tuple[str, str]]Undocumented
Returns
List[str]Undocumented
def update_module(self, module, path, force_removed): (source)

Update a single modified module.

If the module contains imports of previously unseen modules, only process one of the new modules and return the remaining work to be done.

Args:

module: Id of the module path: File system path of the module force_removed: If True, consider module removed from the build even if path

exists (used for removing an existing file from the build)
Returns:

Tuple with these items:

  • Remaining modules to process as (module id, path) tuples
  • Module which was actually processed as (id, path) tuple
  • If there was a blocking error, the error messages from it
Parameters
module:strUndocumented
path:strUndocumented
force​_removed:boolUndocumented
Returns
Tuple[List[Tuple[str, str]], Tuple[str, str], Optional[List[str]]]Undocumented
def update_one(self, changed_modules, initial_set, removed_set, blocking_error): (source)

Process a module from the list of changed modules.

Returns:

Tuple with these items:

  • Updated list of pending changed modules as (module id, path) tuples
  • Module which was actually processed as (id, path) tuple
  • If there was a blocking error, the error messages from it
Parameters
changed​_modules:List[Tuple[str, str]]Undocumented
initial​_set:Set[str]Undocumented
removed​_set:Set[str]Undocumented
blocking​_error:Optional[str]Undocumented
Returns
Tuple[List[Tuple[str, str]], Tuple[str, str], Optional[List[str]]]Undocumented
blocking_error = (source)

Undocumented

changed_modules = (source)

Undocumented

deps = (source)

Undocumented

graph = (source)

Undocumented

manager = (source)

Undocumented

previous_messages = (source)

Undocumented

previous_modules = (source)

Undocumented

previous_targets_with_errors = (source)

Undocumented

processed_targets: List[str] = (source)

Undocumented

stale = (source)

Undocumented

triggered: list = (source)

Undocumented

updated_modules: list = (source)

Undocumented