add trogon

This commit is contained in:
Waylon Walker 2023-05-21 13:20:00 -05:00
parent 00eed9f0cf
commit fb8c507f4c
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
2 changed files with 6 additions and 16 deletions

View file

@ -1,7 +1,8 @@
from trogon import Trogon
import typer import typer
from typer.main import get_group
from learn_sql_model.cli.api import api_app from learn_sql_model.cli.api import api_app
from learn_sql_model.cli.common import verbose_callback
from learn_sql_model.cli.config import config_app from learn_sql_model.cli.config import config_app
from learn_sql_model.cli.hero import hero_app from learn_sql_model.cli.hero import hero_app
from learn_sql_model.cli.model import model_app from learn_sql_model.cli.model import model_app
@ -37,21 +38,9 @@ def version_callback(value: bool) -> None:
raise typer.Exit() raise typer.Exit()
@app.callback() @app.command()
def main( def tui(ctx: typer.Context) -> None:
version: bool = typer.Option( Trogon(get_group(app), click_context=ctx).run()
None,
"--version",
callback=version_callback,
is_eager=True,
),
verbose: bool = typer.Option(
False,
callback=verbose_callback,
help="show the log messages",
),
) -> None:
return
if __name__ == "__main__": if __name__ == "__main__":

View file

@ -25,6 +25,7 @@ classifiers = [
] ]
dependencies = [ dependencies = [
"anyconfig", "anyconfig",
"trogon",
"fastapi", "fastapi",
"httpx", "httpx",
"passlib[bcrypt]", "passlib[bcrypt]",