Fix CI: lazy FastAPI imports, strip ANSI in test assertions — v0.7.2

- Move fastapi imports inside create_app() so STATIC_DIR is importable
  without fastapi installed (follows project lazy import convention)
- Strip Rich ANSI escape codes in test_ui_command_options assertion
- Bump to v0.7.2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alpamys 2026-03-23 21:05:31 +05:00
parent 66d9fd327c
commit 6a76a1be32
4 changed files with 14 additions and 10 deletions

View File

@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "soup-cli"
version = "0.7.1"
version = "0.7.2"
description = "Fine-tune LLMs in one command. No SSH, no config hell."
readme = "README.md"
license = "MIT"

View File

@ -1,3 +1,3 @@
"""Soup CLI — Fine-tune LLMs in one command."""
__version__ = "0.7.1"
__version__ = "0.7.2"

View File

@ -9,10 +9,6 @@ import threading
from pathlib import Path
from typing import Optional
from fastapi import FastAPI, HTTPException, Query
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from pydantic import BaseModel as PydanticBaseModel
STATIC_DIR = Path(__file__).parent / "static"
@ -43,8 +39,13 @@ _train_config_path: Optional[str] = None
_train_lock = threading.Lock()
def create_app() -> FastAPI:
def create_app():
"""Create the Soup Web UI FastAPI application."""
from fastapi import FastAPI, HTTPException, Query
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
app = FastAPI(title="Soup Web UI", version="1.0.0")
app.add_middleware(

View File

@ -40,9 +40,12 @@ class TestUICommand:
runner = CliRunner()
result = runner.invoke(app, ["ui", "--help"])
assert "--port" in result.output
assert "--host" in result.output
assert "--no-browser" in result.output
# Rich markup wraps dashes with ANSI codes, so check without codes
import re
clean = re.sub(r"\x1b\[[0-9;]*m", "", result.output)
assert "--port" in clean
assert "--host" in clean
assert "--no-browser" in clean
class TestCreateApp: