Esempio n. 1
0
File: update.py Progetto: rkday/mypy
    def __init__(self, manager: BuildManager, graph: Graph) -> None:
        """Initialize fine-grained build based on a batch build.

        Args:
            manager: State of the build (mutated by this class)
            graph: Additional state of the build (only read to initialize state)
        """
        self.manager = manager
        self.options = manager.options
        self.previous_modules = get_module_to_path_map(manager)
        self.deps = get_all_dependencies(manager, graph, self.options)
        self.previous_targets_with_errors = manager.errors.targets()
        self.graph = graph
        # Module, if any, that had blocking errors in the last run as (id, path) tuple.
        # TODO: Handle blocking errors in the initial build
        self.blocking_error = None  # type: Optional[Tuple[str, str]]
        # Module that we haven't processed yet but that are known to be stale.
        self.stale = []  # type: List[Tuple[str, str]]
        # Disable the cache so that load_graph doesn't try going back to disk
        # for the cache. This is kind of a hack and it might be better to have
        # this directly reflected in load_graph's interface.
        self.options.cache_dir = os.devnull
        manager.saved_cache = {}
        # Active triggers during the last update
        self.triggered = []  # type: List[str]
Esempio n. 2
0
    def __init__(self, manager: BuildManager, graph: Graph) -> None:
        """Initialize fine-grained build based on a batch build.

        Args:
            manager: State of the build (mutated by this class)
            graph: Additional state of the build (only read to initialize state)
        """
        self.manager = manager
        self.options = manager.options
        self.previous_modules = get_module_to_path_map(manager)
        self.deps = get_all_dependencies(manager, graph, self.options)
        self.previous_targets_with_errors = manager.errors.targets()
        self.graph = graph
        # Module, if any, that had blocking errors in the last run as (id, path) tuple.
        # TODO: Handle blocking errors in the initial build
        self.blocking_error = None  # type: Optional[Tuple[str, str]]
        # Module that we haven't processed yet but that are known to be stale.
        self.stale = []  # type: List[Tuple[str, str]]
        # Disable the cache so that load_graph doesn't try going back to disk
        # for the cache.
        self.manager.cache_enabled = False
        manager.saved_cache = {}

        # Some hints to the test suite about what is going on:
        # Active triggers during the last update
        self.triggered = []  # type: List[str]
        # Modules passed to update during the last update
        self.changed_modules = []  # type: List[Tuple[str, str]]
        # Modules processed during the last update
        self.updated_modules = []  # type: List[str]
Esempio n. 3
0
    def __init__(self, manager: BuildManager, graph: Dict[str, State]) -> None:
        """Initialize fine-grained build based on a batch build.

        Args:
            manager: State of the build (mutated by this class)
            graph: Additional state of the build
        """
        self.manager = manager
        self.options = manager.options
        self.graph = graph
        self.deps = get_all_dependencies(manager, graph, self.options)
        self.previous_targets_with_errors = manager.errors.targets()
        # Modules that had blocking errors in the previous run.
        # TODO: Handle blocking errors in the initial build
        self.blocking_errors = []  # type: List[str]
        manager.saved_cache = preserve_full_cache(graph, manager)
Esempio n. 4
0
    def __init__(self, manager: BuildManager, graph: Graph) -> None:
        """Initialize fine-grained build based on a batch build.

        Args:
            manager: State of the build (mutated by this class)
            graph: Additional state of the build (only read to initialize state)
        """
        self.manager = manager
        self.options = manager.options
        self.previous_modules = get_module_to_path_map(manager)
        self.deps = get_all_dependencies(manager, graph, self.options)
        self.previous_targets_with_errors = manager.errors.targets()
        # Module, if any, that had blocking errors in the last run as (id, path) tuple.
        # TODO: Handle blocking errors in the initial build
        self.blocking_error = None  # type: Optional[Tuple[str, str]]
        # Module that we haven't processed yet but that are known to be stale.
        self.stale = []  # type: List[Tuple[str, str]]
        mark_all_meta_as_memory_only(graph, manager)
        manager.saved_cache = preserve_full_cache(graph, manager)
        self.type_maps = extract_type_maps(graph)