You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
praisonai test collection requires optional modules in default setup
Problem Statement
praisonai tests fail during collection in a base editable install because test/import paths assume optional integrations are installed (praisonaiui, google.generativeai).
Why This Matters
A default dev install should run baseline tests. Optional integrations should not break core test collection.
Environment
OS: Windows 10 (build 19045)
Python: 3.13.2
Repo: MervinPraison/PraisonAI
Install mode: editable install without all optional extras
ImportError: praisonaiui is required for PraisonAISessionDataStore.
Install with: pip install 'praisonai[ui]'
ModuleNotFoundError: No module named 'google'
Triggered from code path checking:
importlib.util.find_spec("google.generativeai")
Expected Behavior
Core test collection should pass in default setup.
Optional integration tests should be isolated and skipped unless corresponding extras are installed.
Technical Flow (Current)
flowchart LR
A[pytest collection] --> B[import test modules]
B --> C[praisonai.ui._aiui_datastore]
C --> D[praisonaiui missing]
B --> E[praisonai.inc.models]
E --> F[google.generativeai lookup path]
F --> G[google package missing]
D --> H[collection failure]
G --> H
Loading
Suggested Fix Options
Move optional imports behind runtime guards (try/except ImportError) where feasible.
Add pytest markers (e.g., requires_ui, requires_google) and skip when deps are missing.
Add contributor docs:
baseline test command
full integration test command with extras.
Acceptance Criteria
pytest src/praisonai/tests -q collects on base install.
Optional-integration tests are clearly reported as skipped when extras are absent.
praisonaitest collection requires optional modules in default setupProblem Statement
praisonaitests fail during collection in a base editable install because test/import paths assume optional integrations are installed (praisonaiui,google.generativeai).Why This Matters
A default dev install should run baseline tests. Optional integrations should not break core test collection.
Environment
MervinPraison/PraisonAIReproduction (Exact)
.venv\Scripts\python -m pip install -e .\src\praisonai.venv\Scripts\python -m pytest .\src\praisonai\tests -q🔴 Errors (Observed)
Triggered from code path checking:
importlib.util.find_spec("google.generativeai")Expected Behavior
Technical Flow (Current)
Suggested Fix Options
try/except ImportError) where feasible.requires_ui,requires_google) and skip when deps are missing.Acceptance Criteria
pytest src/praisonai/tests -qcollects on base install.