def _load_graph(self, root_node, check_updates, update, build_mode, remote_name, profile_build_requires, recorder, processed_profile, apply_build_requires): assert isinstance(build_mode, BuildMode) builder = DepsGraphBuilder(self._proxy, self._output, self._loader, self._resolver, recorder) graph = builder.load_graph(root_node, check_updates, update, remote_name, processed_profile) binaries_analyzer = GraphBinariesAnalyzer(self._cache, self._output, self._remote_manager) self._recurse_build_requires(graph, builder, binaries_analyzer, check_updates, update, build_mode, remote_name, profile_build_requires, recorder, processed_profile, apply_build_requires=apply_build_requires) # Sort of closures, for linking order inverse_levels = {n: i for i, level in enumerate(graph.inverse_levels()) for n in level} for node in graph.nodes: closure = node.public_closure closure.pop(node.name) node_order = list(closure.values()) # List sort is stable, will keep the original order of the closure, but prioritize levels node_order.sort(key=lambda n: inverse_levels[n]) node.public_closure = node_order return graph
def _load_graph(self, root_node, check_updates, update, build_mode, remote_name, profile_build_requires, recorder, workspace, processed_profile): builder = DepsGraphBuilder(self._proxy, self._output, self._loader, self._resolver, workspace, recorder) graph = builder.load_graph(root_node, check_updates, update, remote_name, processed_profile) if build_mode is None: return graph binaries_analyzer = GraphBinariesAnalyzer(self._cache, self._output, self._remote_manager, workspace) binaries_analyzer.evaluate_graph(graph, build_mode, update, remote_name) self._recurse_build_requires(graph, check_updates, update, build_mode, remote_name, profile_build_requires, recorder, workspace, processed_profile) return graph
def _get_app(self): self.remote_manager = MockRemoteManager() cache = self.cache self.resolver = RangeResolver(self.cache, self.remote_manager) proxy = ConanProxy(cache, self.output, self.remote_manager) self.loader = ConanFileLoader(None, self.output, ConanPythonRequire(None, None)) binaries = GraphBinariesAnalyzer(cache, self.output, self.remote_manager) self.manager = GraphManager(self.output, cache, self.remote_manager, self.loader, proxy, self.resolver, binaries) hook_manager = Mock() app_type = namedtuple("ConanApp", "cache out remote_manager hook_manager graph_manager" " binaries_analyzer") app = app_type(self.cache, self.output, self.remote_manager, hook_manager, self.manager, binaries) return app
def load_graph(self, conanfile, check_updates, update, build_mode, remote_name=None, profile_build_requires=None): builder = DepsGraphBuilder(self._proxy, self._output, self._loader, self._resolver, self._workspace) graph = builder.load_graph(conanfile, check_updates, update, remote_name) if build_mode is None: return graph binaries_analyzer = GraphBinariesAnalyzer(self._client_cache, self._output, self._remote_manager, self._registry, self._workspace) binaries_analyzer.evaluate_graph(graph, build_mode, update, remote_name) self._recurse_build_requires(graph, check_updates, update, build_mode, remote_name, profile_build_requires) return graph
def _get_app(self): self.remote_manager = MockRemoteManager() cache = self.cache self.resolver = RangeResolver(self.cache, self.remote_manager) proxy = ConanProxy(cache, self.output, self.remote_manager) pyreq_loader = PyRequireLoader(proxy, self.resolver) pyreq_loader.enable_remotes(remotes=Remotes()) self.loader = ConanFileLoader(None, self.output, ConanPythonRequire(None, None), pyreq_loader=pyreq_loader) binaries = GraphBinariesAnalyzer(cache, self.output, self.remote_manager) self.manager = GraphManager(self.output, cache, self.remote_manager, self.loader, proxy, self.resolver, binaries) generator_manager = GeneratorManager() hook_manager = Mock() app_type = namedtuple("ConanApp", "cache out remote_manager hook_manager graph_manager" " binaries_analyzer generator_manager") app = app_type(self.cache, self.output, self.remote_manager, hook_manager, self.manager, binaries, generator_manager) return app