From 19a6f5c25c6307d4f692dd861202ec4171fa2ba3 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 16 Aug 2023 12:15:49 -0400 Subject: [PATCH] Drop `marketstore` mod import from CLIs loader Means commenting out the `data.cli.ingest()` as it will be deleted in the up coming #486 anyway. --- piker/cli/__init__.py | 2 - piker/data/cli.py | 86 +++++++++++++++++++++---------------------- 2 files changed, 43 insertions(+), 45 deletions(-) diff --git a/piker/cli/__init__.py b/piker/cli/__init__.py index 70610135..c0bd130c 100644 --- a/piker/cli/__init__.py +++ b/piker/cli/__init__.py @@ -226,8 +226,6 @@ def services(config, tl, ports): def _load_clis() -> None: - from ..service import marketstore # noqa - from ..service import elastic from ..data import cli # noqa from ..brokers import cli # noqa from ..ui import cli # noqa diff --git a/piker/data/cli.py b/piker/data/cli.py index 59db1037..9126891c 100644 --- a/piker/data/cli.py +++ b/piker/data/cli.py @@ -22,14 +22,14 @@ import trio import tractor import click -from ..service.marketstore import ( - # get_client, - # stream_quotes, - ingest_quote_stream, - # _url, - # _tick_tbk_ids, - # mk_tbk, -) +# from ..service.marketstore import ( +# # get_client, +# # stream_quotes, +# ingest_quote_stream, +# # _url, +# # _tick_tbk_ids, +# # mk_tbk, +# ) from ..cli import cli from .. import watchlists as wl from ._util import ( @@ -212,44 +212,44 @@ def storage( trio.run(main) -@cli.command() -@click.option('--test-file', '-t', help='Test quote stream file') -@click.option('--tl', is_flag=True, help='Enable tractor logging') -@click.argument('name', nargs=1, required=True) -@click.pass_obj -def ingest(config, name, test_file, tl): - ''' - Ingest real-time broker quotes and ticks to a marketstore instance. +# @cli.command() +# @click.option('--test-file', '-t', help='Test quote stream file') +# @click.option('--tl', is_flag=True, help='Enable tractor logging') +# @click.argument('name', nargs=1, required=True) +# @click.pass_obj +# def ingest(config, name, test_file, tl): +# ''' +# Ingest real-time broker quotes and ticks to a marketstore instance. - ''' - # global opts - loglevel = config['loglevel'] - tractorloglevel = config['tractorloglevel'] - # log = config['log'] +# ''' +# # global opts +# loglevel = config['loglevel'] +# tractorloglevel = config['tractorloglevel'] +# # log = config['log'] - watchlist_from_file = wl.ensure_watchlists(config['wl_path']) - watchlists = wl.merge_watchlist(watchlist_from_file, wl._builtins) - symbols = watchlists[name] +# watchlist_from_file = wl.ensure_watchlists(config['wl_path']) +# watchlists = wl.merge_watchlist(watchlist_from_file, wl._builtins) +# symbols = watchlists[name] - grouped_syms = {} - for sym in symbols: - symbol, _, provider = sym.rpartition('.') - if provider not in grouped_syms: - grouped_syms[provider] = [] +# grouped_syms = {} +# for sym in symbols: +# symbol, _, provider = sym.rpartition('.') +# if provider not in grouped_syms: +# grouped_syms[provider] = [] - grouped_syms[provider].append(symbol) +# grouped_syms[provider].append(symbol) - async def entry_point(): - async with tractor.open_nursery() as n: - for provider, symbols in grouped_syms.items(): - await n.run_in_actor( - ingest_quote_stream, - name='ingest_marketstore', - symbols=symbols, - brokername=provider, - tries=1, - actorloglevel=loglevel, - loglevel=tractorloglevel - ) +# async def entry_point(): +# async with tractor.open_nursery() as n: +# for provider, symbols in grouped_syms.items(): +# await n.run_in_actor( +# ingest_quote_stream, +# name='ingest_marketstore', +# symbols=symbols, +# brokername=provider, +# tries=1, +# actorloglevel=loglevel, +# loglevel=tractorloglevel +# ) - tractor.run(entry_point) +# tractor.run(entry_point)