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

View file

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