fix: update agno to v2 and fix airllm availability tests (#170)
The agno dependency was pinned to <2.0 but the code uses agno.db.sqlite (a 2.x API), breaking all tests in CI. Also fix airllm provider tests to patch importlib.util.find_spec (what the production code uses) instead of builtins.__import__. Co-authored-by: Trip T <trip@local> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
9d78eb31d1
commit
68115fe477
@@ -24,7 +24,7 @@ packages = [
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.11,<4"
|
||||
agno = { version = ">=1.4.0,<2.0", extras = ["sqlite"] }
|
||||
agno = { version = ">=2.0.0,<3.0", extras = ["sqlite"] }
|
||||
ollama = ">=0.3.0,<1.0"
|
||||
openai = ">=1.0.0"
|
||||
fastapi = ">=0.115.0,<1.0"
|
||||
|
||||
@@ -500,8 +500,7 @@ class TestProviderAvailabilityCheck:
|
||||
priority=1,
|
||||
)
|
||||
|
||||
with patch("builtins.__import__") as mock_import:
|
||||
mock_import.return_value = MagicMock()
|
||||
with patch("importlib.util.find_spec", return_value=MagicMock()):
|
||||
assert router._check_provider_available(provider) is True
|
||||
|
||||
def test_check_airllm_not_installed(self):
|
||||
@@ -515,11 +514,5 @@ class TestProviderAvailabilityCheck:
|
||||
priority=1,
|
||||
)
|
||||
|
||||
# Patch __import__ to simulate airllm not being available
|
||||
def raise_import_error(name, *args, **kwargs):
|
||||
if name == "airllm":
|
||||
raise ImportError("No module named 'airllm'")
|
||||
return __builtins__.__import__(name, *args, **kwargs)
|
||||
|
||||
with patch("builtins.__import__", side_effect=raise_import_error):
|
||||
with patch("importlib.util.find_spec", return_value=None):
|
||||
assert router._check_provider_available(provider) is False
|
||||
|
||||
Reference in New Issue
Block a user