From 50570516cd2c235eb18a0da6351334dff93e8e3a Mon Sep 17 00:00:00 2001 From: sudipnext Date: Sat, 21 Feb 2026 13:43:03 +0545 Subject: [PATCH] feat: enhance fastapi server.spec to conditionally include fastembed_cache and update pyproject.toml for package discovery --- electron/servers/fastapi/server.spec | 7 +++++-- servers/fastapi/pyproject.toml | 4 ++++ .../outline/components/GenerateButton.tsx | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/electron/servers/fastapi/server.spec b/electron/servers/fastapi/server.spec index 102f5f6d..940ac1e4 100644 --- a/electron/servers/fastapi/server.spec +++ b/electron/servers/fastapi/server.spec @@ -1,4 +1,5 @@ # -*- mode: python ; coding: utf-8 -*- +import os from PyInstaller.utils.hooks import collect_all # Collect fastembed dependencies @@ -28,6 +29,9 @@ datas_docling_ibm, binaries_docling_ibm, hiddenimports_docling_ibm = collect_all # collect_all returns empty lists if package not installed, so safe to call conditionally datas_docx, binaries_docx, hiddenimports_docx = collect_all('docx') +# fastembed_cache is created at runtime when models are first used; include only if present (e.g. local dev) +datas_fastembed_cache = [('fastembed_cache', 'fastembed_cache')] if os.path.isdir('fastembed_cache') else [] + excludes = [] a = Analysis( @@ -36,9 +40,8 @@ a = Analysis( binaries=binaries_fastembed + binaries_fastembed_vs + binaries_onnx + binaries_pptx + binaries_docx2everything + binaries_greenlet + binaries_docling + binaries_docling_core + binaries_docling_parse + binaries_docling_ibm + binaries_docx, datas=[ ('assets', 'assets'), - ('fastembed_cache', 'fastembed_cache'), ('static', 'static'), - ] + datas_fastembed + datas_fastembed_vs + datas_onnx + datas_pptx + datas_docx2everything + datas_greenlet + datas_docling + datas_docling_core + datas_docling_parse + datas_docling_ibm + datas_docx, + ] + datas_fastembed_cache + datas_fastembed + datas_fastembed_vs + datas_onnx + datas_pptx + datas_docx2everything + datas_greenlet + datas_docling + datas_docling_core + datas_docling_parse + datas_docling_ibm + datas_docx, hiddenimports=[ 'aiosqlite', 'sqlite3', diff --git a/servers/fastapi/pyproject.toml b/servers/fastapi/pyproject.toml index a80b371e..c76aecaf 100644 --- a/servers/fastapi/pyproject.toml +++ b/servers/fastapi/pyproject.toml @@ -27,3 +27,7 @@ dependencies = [ [[tool.uv.index]] url = "https://download.pytorch.org/whl/cpu" + +[tool.setuptools.packages.find] +where = ["."] +include = ["api*", "enums*", "models*", "services*", "constants*", "utils*"] diff --git a/servers/nextjs/app/(presentation-generator)/outline/components/GenerateButton.tsx b/servers/nextjs/app/(presentation-generator)/outline/components/GenerateButton.tsx index 1cd950b9..8fb71cec 100644 --- a/servers/nextjs/app/(presentation-generator)/outline/components/GenerateButton.tsx +++ b/servers/nextjs/app/(presentation-generator)/outline/components/GenerateButton.tsx @@ -3,7 +3,7 @@ import { usePathname } from "next/navigation"; import { trackEvent, MixpanelEvent } from "@/utils/mixpanel"; import { Button } from "@/components/ui/button"; import { LoadingState, Template } from "../types/index"; -import { TemplateLayoutsWithSettings } from "@/app/presentation-templates"; +import { TemplateLayoutsWithSettings } from "@/app/presentation-templates/utils"; interface GenerateButtonProps { loadingState: LoadingState;