From f44331d9ed829f6b40048b9e7dd6aa2829db5dc1 Mon Sep 17 00:00:00 2001 From: Eric Hare Date: Tue, 23 Jun 2026 13:07:33 -0700 Subject: [PATCH] test: skip litellm/toolguard component imports when absent (Python 3.14) The direct-import sweep (test_all_lfx_component_modules_directly_importable) flags any import error not in its expected-missing allow-list as a hard failure. litellm and toolguard are gated to python_version<'3.14' in pyproject, so on a clean 3.14 install they are absent and 6 modules fail: the 3 crewai components (`from crewai import Agent` -> litellm) and the 3 models_and_agents/policies components (import toolguard directly). Add litellm and toolguard to the allow-list alongside the existing altk/langchain_ibm/ibm_watsonx_ai gated entries so these import failures are classified as skipped rather than failed on 3.14. Co-Authored-By: Claude Opus 4.8 --- .../tests/unit/components/test_all_modules_importable.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/tests/unit/components/test_all_modules_importable.py b/src/backend/tests/unit/components/test_all_modules_importable.py index 951ac8f312..e8b041b10c 100644 --- a/src/backend/tests/unit/components/test_all_modules_importable.py +++ b/src/backend/tests/unit/components/test_all_modules_importable.py @@ -410,6 +410,12 @@ class TestDirectModuleImports: "altk", "langchain_ibm", "ibm_watsonx_ai", + # litellm has no 3.14-compatible release, so it is gated to + # python_version<'3.14'. Its absence surfaces transitively + # via crewai (``from crewai import Agent`` -> litellm) and + # via toolguard (the policies components import it directly). + "litellm", + "toolguard", ] ): return ("skipped", modname, "missing optional dependency")