feat: added colorful logging using rich, improved startup times by lazy-loading spacy, some other fixes

This commit is contained in:
Deniz Şafak
2026-08-20 20:52:08 +03:00
parent 9da15aefa4
commit f340b976db
13 changed files with 359 additions and 148 deletions
+9
View File
@@ -4,6 +4,10 @@ from pathlib import Path
from types import SimpleNamespace
_real_routes = sys.modules.get("abogen.webui.routes")
# Import routes.utils.form without executing routes/__init__.py (which imports
# every blueprint). Use a temporary namespace package, then restore the real
# module so later tests can still `from abogen.webui.routes import ...`.
routes_package = types.ModuleType("abogen.webui.routes")
routes_package.__path__ = [
str(Path(__file__).parents[1] / "abogen" / "webui" / "routes")
@@ -15,6 +19,11 @@ from abogen.webui.routes.utils.form import ( # noqa: E402
load_settings,
)
if _real_routes is not None:
sys.modules["abogen.webui.routes"] = _real_routes
else:
del sys.modules["abogen.webui.routes"]
def test_user_metadata_overrides_extraction_fallback(tmp_path: Path) -> None:
extraction = SimpleNamespace(