fix: typer exit codes, JWT 7d expiry, shared test fixtures, AdminTab query, mantine 9.6.3
This commit is contained in:
parent
03af41e837
commit
696db34c90
16 changed files with 210 additions and 251 deletions
|
|
@ -11,7 +11,6 @@ from app (stdlib only), prints no secret values.
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import typer
|
||||
|
|
@ -89,12 +88,12 @@ def check(values: dict[str, str]) -> tuple[list[str], list[str]]:
|
|||
return failures, warnings
|
||||
|
||||
|
||||
def main(env: str = typer.Option(str(REPO_ROOT / ".env"), "--env")) -> int:
|
||||
def main(env: str = typer.Option(str(REPO_ROOT / ".env"), "--env")) -> None:
|
||||
"""Validate a prod .env file (typer CLI; check/parse_env stay importable)."""
|
||||
path = Path(env)
|
||||
if not path.is_file():
|
||||
print(f"no env file at {path}")
|
||||
return 1
|
||||
raise typer.Exit(1)
|
||||
failures, warnings = check(parse_env(path))
|
||||
for message in warnings:
|
||||
print(f"WARN: {message}")
|
||||
|
|
@ -102,10 +101,9 @@ def main(env: str = typer.Option(str(REPO_ROOT / ".env"), "--env")) -> int:
|
|||
print(f"FAIL: {message}")
|
||||
if failures:
|
||||
print(f"{len(failures)} blocking issue(s) — fix before deploying")
|
||||
return 1
|
||||
raise typer.Exit(1)
|
||||
print("prod env OK" + (f" ({len(warnings)} warning(s))" if warnings else ""))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(typer.run(main))
|
||||
typer.run(main)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ Usage:
|
|||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import sys
|
||||
|
||||
import httpx
|
||||
import typer
|
||||
|
|
@ -32,7 +31,7 @@ def main(
|
|||
name: str | None = typer.Option(None, "--name"),
|
||||
author: str = typer.Option("", "--author"),
|
||||
no_deploy: bool = typer.Option(False, "--no-deploy"),
|
||||
) -> int:
|
||||
) -> None:
|
||||
"""Import a flow from Langflow via the running API (post() stays importable)."""
|
||||
result = post(
|
||||
api,
|
||||
|
|
@ -45,8 +44,9 @@ def main(
|
|||
},
|
||||
)
|
||||
print(json.dumps(result, indent=2, ensure_ascii=False))
|
||||
return 0 if result["status"] in (200, 201) else 1
|
||||
if result["status"] not in (200, 201):
|
||||
raise typer.Exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(typer.run(main))
|
||||
typer.run(main)
|
||||
|
|
|
|||
|
|
@ -84,13 +84,13 @@ def main(
|
|||
pull: bool = typer.Option(False, "--pull", help="export all Langflow flows first"),
|
||||
sync: bool = typer.Option(False, "--sync", help="reconcile backend/flows into DB + LFX"),
|
||||
dir: str | None = typer.Option(None, "--dir", help="flows directory"),
|
||||
) -> int:
|
||||
) -> None:
|
||||
"""Reconcile flows (typer CLI; run_sync/run_full_pass stay importable)."""
|
||||
if not pull and not sync:
|
||||
sync = True
|
||||
args = type("Args", (), {"pull": pull, "sync": sync, "dir": dir})()
|
||||
return asyncio.run(main_async(args))
|
||||
raise typer.Exit(asyncio.run(main_async(args)))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(typer.run(main))
|
||||
typer.run(main)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue