예제 #1
0
def _open_graph():
  scheduler, storage, spec_roots, symbol_table_cls = setup()

  # Populate the graph for the given request, and print the resulting Addresses.
  engine = LocalSerialEngine(scheduler, storage)
  engine.start()
  try:
    graph = ExpGraph(scheduler, engine, symbol_table_cls)
    addresses = tuple(graph.inject_specs_closure(spec_roots))
    yield graph, addresses
  finally:
    print('Cache stats: {}'.format(engine._cache.get_stats()), file=sys.stderr)
    engine.close()
예제 #2
0
파일: commands.py 프로젝트: jayantak/pants
def open_exp_graph(*args, **kwargs):
  with _open_scheduler(*args, **kwargs) as (scheduler, engine, symbol_table_cls, spec_roots):
    graph = ExpGraph(scheduler, engine, symbol_table_cls)
    addresses = tuple(graph.inject_specs_closure(spec_roots))
    yield graph, addresses, scheduler
예제 #3
0
def open_exp_graph(*args, **kwargs):
  with _open_scheduler(*args, **kwargs) as (scheduler, engine, symbol_table_cls, spec_roots):
    graph = ExpGraph(scheduler, engine, symbol_table_cls)
    addresses = tuple(graph.inject_specs_closure(spec_roots))
    yield graph, addresses, scheduler