def _create_step(self, node_entry): """Creates a Step and Promise with the currently available dependencies of the given Node. If the dependencies of a Node are not available, returns None. TODO: Content addressing node and its dependencies should only happen if node is cacheable or in a multi-process environment. """ Node.validate_node(node_entry.node) # See whether all of the dependencies for the node are available. deps = dict() for dep_entry in node_entry.dependencies: if not dep_entry.is_complete: return None deps[dep_entry.node] = dep_entry.state # Additionally, include Noops for any dependencies that were cyclic. for dep in node_entry.cyclic_dependencies: deps[dep] = Noop.cycle(node_entry.node, dep) # Ready. self._step_id += 1 step_request = StepRequest(self._step_id, node_entry.node, deps, self._inline_nodes, self._project_tree) return (step_request, Promise())
def _create_step(self, node): """Creates a Step and Promise with the currently available dependencies of the given Node. If the dependencies of a Node are not available, returns None. TODO: Content addressing node and its dependencies should only happen if node is cacheable or in a multi-process environment. """ Node.validate_node(node) # See whether all of the dependencies for the node are available. deps = dict() for dep in self._product_graph.dependencies_of(node): state = self._product_graph.state(dep) if state is None: return None deps[dep] = state # Additionally, include Noops for any dependencies that were cyclic. for dep in self._product_graph.cyclic_dependencies_of(node): noop_state = Noop('Dep from {} to {} would cause a cycle.'.format(node, dep)) deps[dep] = noop_state # Ready. self._step_id += 1 return (StepRequest(self._step_id, node, deps, self._project_tree), Promise())