Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

test: Integration test - minimal dependency check (#2405)

Boer-Zhang43d3fe07299b
diff --git a/.github/workflows/test_minimal_dependency.yml b/.github/workflows/test_minimal_dependency.yml
new file mode 100644
index 000000000..6a4d0ea7e
--- /dev/null
+++ b/.github/workflows/test_minimal_dependency.yml
@@ -0,0 +1,38 @@
+name: Test Minimal Dependency
+
+on:
+ pull_request:
+ paths:
+ - "pyproject.toml"
+ - "camel/**"
+ - "examples/**"
+ - "test/integration_test/**"
+ - ".github/workflows/test-minimal-install.yml"
+
+jobs:
+ minimal-dependency:
+ name: Minimal dependency check
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.10"
+
+ - name: Create and activate virtual environment
+ run: |
+ python -m venv .venv
+ source .venv/bin/activate
+ pip install --upgrade pip
+ pip install -e .
+
+ - name: Run integration test on minimal examples
+ env:
+ OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
+ run: |
+ source .venv/bin/activate
+ pip install pytest dotenv
+ pytest test/integration_test/test_minimal_dependency.py
\ No newline at end of file
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e0a165796..5c972b047 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -35,4 +35,4 @@ repos:
- id: codespell
exclude: ^(examples/usecases/) # Ignore files under examples/usecases
additional_dependencies:
- - tomli # for python_version < '3.11'
+ - tomli # for python_version < '3.11'
\ No newline at end of file
diff --git a/camel/configs/cohere_config.py b/camel/configs/cohere_config.py
index 8b6ee2611..149d7dd09 100644
--- a/camel/configs/cohere_config.py
+++ b/camel/configs/cohere_config.py
@@ -74,4 +74,4 @@ class CohereConfig(BaseConfig):
p: Optional[float] = None
-COHERE_API_PARAMS = {param for param in CohereConfig().model_fields.keys()}
+COHERE_API_PARAMS = {param for param in CohereConfig.model_fields.keys()}
diff --git a/camel/configs/mistral_config.py b/camel/configs/mistral_config.py
index f71f168ee..16c77417b 100644
--- a/camel/configs/mistral_config.py
+++ b/camel/configs/mistral_config.py
@@ -76,4 +76,4 @@ class MistralConfig(BaseConfig):
return response_format
-MISTRAL_API_PARAMS = {param for param in MistralConfig().model_fields.keys()}
+MISTRAL_API_PARAMS = {param for param in MistralConfig.model_fields.keys()}
diff --git a/camel/configs/reka_config.py b/camel/configs/reka_config.py
index 186f6b348..e5c6f0628 100644
--- a/camel/configs/reka_config.py
+++ b/camel/configs/reka_config.py
@@ -66,4 +66,4 @@ class RekaConfig(BaseConfig):
use_search_engine: Optional[bool] = None
-REKA_API_PARAMS = {param for param in RekaConfig().model_fields.keys()}
+REKA_API_PARAMS = {param for param in RekaConfig.model_fields.keys()}
diff --git a/camel/configs/samba_config.py b/camel/configs/samba_config.py
index 8c44c957b..bd4cd2114 100644
--- a/camel/configs/samba_config.py
+++ b/camel/configs/samba_config.py
@@ -65,7 +65,7 @@ class SambaVerseAPIConfig(BaseConfig):
SAMBA_VERSE_API_PARAMS = {
- param for param in SambaVerseAPIConfig().model_fields.keys()
+ param for param in SambaVerseAPIConfig.model_fields.keys()
}
@@ -160,5 +160,5 @@ class SambaCloudAPIConfig(BaseConfig):
SAMBA_CLOUD_API_PARAMS = {
- param for param in SambaCloudAPIConfig().model_fields.keys()
+ param for param in SambaCloudAPIConfig.model_fields.keys()
}
diff --git a/camel/embeddings/jina_embedding.py b/camel/embeddings/jina_embedding.py
index db13d7c5c..87b817334 100644
--- a/camel/embeddings/jina_embedding.py
+++ b/camel/embeddings/jina_embedding.py
@@ -12,6 +12,9 @@
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
+
import base64
import io
import os
@@ -104,6 +107,7 @@ class JinaEmbedding(BaseEmbedding[Union[str, Image.Image]]):
ValueError: If the input type is not supported.
RuntimeError: If the API request fails.
"""
+
input_data = []
for obj in objs:
if isinstance(obj, str):
@@ -111,7 +115,10 @@ class JinaEmbedding(BaseEmbedding[Union[str, Image.Image]]):
input_data.append({"text": obj})
else:
input_data.append(obj) # type: ignore[arg-type]
- elif isinstance(obj, Image.Image):
+ elif (
+ obj.__class__.__module__ == "PIL.Image"
+ and obj.__class__.__name__ == "Image"
+ ):
if self.model_type != EmbeddingModelType.JINA_CLIP_V2:
raise ValueError(
f"Model {self.model_type} does not support "
diff --git a/camel/embeddings/sentence_transformers_embeddings.py b/camel/embeddings/sentence_transformers_embeddings.py
index b097c677f..2d7d04452 100644
--- a/camel/embeddings/sentence_transformers_embeddings.py
+++ b/camel/embeddings/sentence_transformers_embeddings.py
@@ -15,8 +15,6 @@ from __future__ import annotations
from typing import Any
-from numpy import ndarray
-
from camel.embeddings.base import BaseEmbedding
@@ -61,6 +59,8 @@ class SentenceTransformerEncoder(BaseEmbedding[str]):
list[list[float]]: A list that represents the generated embedding
as a list of floating-point numbers.
"""
+ from numpy import ndarray
+
if not objs:
raise ValueError("Input text list is empty")
embeddings = self.model.encode(
diff --git a/camel/embeddings/vlm_embedding.py b/camel/embeddings/vlm_embedding.py
index 005d3802a..348e1f10d 100644
--- a/camel/embeddings/vlm_embedding.py
+++ b/camel/embeddings/vlm_embedding.py
@@ -11,6 +11,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
+
from typing import Any, List, Optional, Union
from PIL import Image
@@ -70,7 +74,7 @@ class VisionLanguageEmbedding(BaseEmbedding[Union[str, Image.Image]]):
def embed_list(
self, objs: List[Union[Image.Image, str]], **kwargs: Any
) -> List[List[float]]:
- """Generates embeddings for the given images or texts.
+ r"""Generates embeddings for the given images or texts.
Args:
objs (List[Image.Image|str]): The list of images or texts for
@@ -98,7 +102,10 @@ class VisionLanguageEmbedding(BaseEmbedding[Union[str, Image.Image]]):
result_list = []
for obj in objs:
- if isinstance(obj, Image.Image):
+ if (
+ obj.__class__.__module__ == "PIL.Image"
+ and obj.__class__.__name__ == "Image"
+ ):
image_input = self.processor(
images=obj,
return_tensors="pt",
diff --git a/camel/memories/records.py b/camel/memories/records.py
index bac344d4a..861fcfa1e 100644
--- a/camel/memories/records.py
+++ b/camel/memories/records.py
@@ -12,6 +12,9 @@
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
+
from dataclasses import asdict
from datetime import datetime, timezone
from typing import Any, ClassVar, Dict
diff --git a/camel/messages/base.py b/camel/messages/base.py
index f46c07603..e47904bec 100644
--- a/camel/messages/base.py
+++ b/camel/messages/base.py
@@ -11,13 +11,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
+
import base64
import io
import re
from dataclasses import dataclass
-from typing import Any, Dict, List, Literal, Optional, Tuple, Union
+from typing import (
+ Any,
+ Dict,
+ List,
+ Literal,
+ Optional,
+ Tuple,
+ Union,
+)
-import numpy as np
from PIL import Image
from pydantic import BaseModel
@@ -48,7 +59,7 @@ class BaseMessage:
role_name (str): The name of the user or assistant role.
role_type (RoleType): The type of role, either :obj:`RoleType.
ASSISTANT` or :obj:`RoleType.USER`.
- meta_dict (Optional[Dict[str, str]]): Additional metadata dictionary
+ meta_dict (Optional[Dict[str, Any]]): Additional metadata dictionary
for the message.
content (str): The content of the message.
video_bytes (Optional[bytes]): Optional bytes of a video associated
@@ -457,6 +468,7 @@ class BaseMessage:
if self.video_bytes:
import imageio.v3 as iio
+ import numpy as np
base64Frames: List[str] = []
frame_count = 0
diff --git a/camel/models/model_factory.py b/camel/models/model_factory.py
index 8fae031b9..0739078e3 100644
--- a/camel/models/model_factory.py
+++ b/camel/models/model_factory.py
@@ -14,8 +14,6 @@
import json
from typing import ClassVar, Dict, Optional, Type, Union
-import yaml
-
from camel.models.aiml_model import AIMLModel
from camel.models.anthropic_model import AnthropicModel
from camel.models.aws_bedrock_model import AWSBedrockModel
@@ -221,6 +219,8 @@ class ModelFactory:
@classmethod
def __load_yaml(cls, filepath: str) -> Dict:
+ import yaml
+
r"""Loads and parses a YAML file into a dictionary.
Args:
diff --git a/camel/retrievers/bm25_retriever.py b/camel/retrievers/bm25_retriever.py
index d51652f48..c425f122b 100644
--- a/camel/retrievers/bm25_retriever.py
+++ b/camel/retrievers/bm25_retriever.py
@@ -13,8 +13,6 @@
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
from typing import Any, Dict, List
-import numpy as np
-
from camel.loaders import UnstructuredIO
from camel.retrievers import BaseRetriever
from camel.utils import dependencies_required
@@ -106,6 +104,7 @@ class BM25Retriever(BaseRetriever):
model has not been initialized by calling `process`
first.
"""
+ import numpy as np
if top_k <= 0:
raise ValueError("top_k must be a positive integer.")
diff --git a/camel/retrievers/hybrid_retrival.py b/camel/retrievers/hybrid_retrival.py
index 7787f33e6..2bc15175a 100644
--- a/camel/retrievers/hybrid_retrival.py
+++ b/camel/retrievers/hybrid_retrival.py
@@ -13,8 +13,6 @@
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
from typing import Any, Collection, Dict, List, Optional, Sequence, Union
-import numpy as np
-
from camel.embeddings import BaseEmbedding
from camel.retrievers import BaseRetriever, BM25Retriever, VectorRetriever
from camel.storages import BaseVectorStorage
@@ -96,6 +94,8 @@ class HybridRetriever(BaseRetriever):
https://medium.com/@devalshah1619/mathematical-intuition-behind-reciprocal-rank-fusion-rrf-explained-in-2-mins-002df0cc5e2a
https://colab.research.google.com/drive/1iwVJrN96fiyycxN1pBqWlEr_4EPiGdGy#scrollTo=0qh83qGV2dY8
"""
+ import numpy as np
+
text_to_id = {}
id_to_info = {}
current_id = 1
diff --git a/camel/storages/vectordb_storages/oceanbase.py b/camel/storages/vectordb_storages/oceanbase.py
index 421e62af9..7e3710477 100644
--- a/camel/storages/vectordb_storages/oceanbase.py
+++ b/camel/storages/vectordb_storages/oceanbase.py
@@ -16,8 +16,6 @@ import json
import logging
from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional
-from sqlalchemy import JSON, Column, Integer
-
if TYPE_CHECKING:
from pyobvector.client import ObVecClient
@@ -80,6 +78,7 @@ class OceanBaseStorage(BaseVectorStorage):
IndexParams,
)
from pyobvector.schema import VECTOR
+ from sqlalchemy import JSON, Column, Integer
self.vector_dim: int = vector_dim
self.table_name: str = table_name
diff --git a/camel/toolkits/async_browser_toolkit.py b/camel/toolkits/async_browser_toolkit.py
index fc6cf19af..09e46706b 100644
--- a/camel/toolkits/async_browser_toolkit.py
+++ b/camel/toolkits/async_browser_toolkit.py
@@ -11,6 +11,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
+
import asyncio
import datetime
import io
@@ -1336,7 +1340,7 @@ class AsyncBrowserToolkit(BaseToolkit):
def _initialize_agent(self) -> Tuple["ChatAgent", "ChatAgent"]:
r"""Initialize the agent."""
- from camel.agents import ChatAgent
+ from camel.agents.chat_agent import ChatAgent
if self.web_agent_model is None:
web_agent_model = ModelFactory.create(
diff --git a/camel/toolkits/browser_toolkit.py b/camel/toolkits/browser_toolkit.py
index a216d5a70..86ae82013 100644
--- a/camel/toolkits/browser_toolkit.py
+++ b/camel/toolkits/browser_toolkit.py
@@ -12,6 +12,9 @@
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
+
import datetime
import io
import json
@@ -38,8 +41,6 @@ from typing import (
from PIL import Image, ImageDraw, ImageFont
-if TYPE_CHECKING:
- from camel.agents import ChatAgent
from camel.logger import get_logger
from camel.messages import BaseMessage
from camel.models import BaseModelBackend, ModelFactory
@@ -53,6 +54,9 @@ from camel.utils import (
sanitize_filename,
)
+if TYPE_CHECKING:
+ from camel.agents import ChatAgent
+
logger = get_logger(__name__)
TOP_NO_LABEL_ZONE = 20
@@ -577,7 +581,6 @@ class BaseBrowser:
image and the path to the image file if saved, otherwise
:obj:`None`.
"""
-
image_data = self.page.screenshot(timeout=60000)
image = Image.open(io.BytesIO(image_data))
diff --git a/camel/toolkits/dalle_toolkit.py b/camel/toolkits/dalle_toolkit.py
index 312258943..b8352fbf0 100644
--- a/camel/toolkits/dalle_toolkit.py
+++ b/camel/toolkits/dalle_toolkit.py
@@ -11,6 +11,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
+
import base64
import os
import uuid
diff --git a/camel/toolkits/excel_toolkit.py b/camel/toolkits/excel_toolkit.py
index 1df9ff7ba..e9fb885f3 100644
--- a/camel/toolkits/excel_toolkit.py
+++ b/camel/toolkits/excel_toolkit.py
@@ -12,15 +12,20 @@
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
-from typing import List, Optional
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
-import pandas as pd
+from typing import TYPE_CHECKING, List, Optional
from camel.logger import get_logger
from camel.toolkits.base import BaseToolkit
from camel.toolkits.function_tool import FunctionTool
from camel.utils import MCPServer
+# Import only for type hints (not executed at runtime)
+if TYPE_CHECKING:
+ import pandas as pd
+
logger = get_logger(__name__)
@@ -71,6 +76,7 @@ class ExcelToolkit(BaseToolkit):
Returns:
str: Extracted excel information, including details of each sheet.
"""
+ import pandas as pd
from openpyxl import load_workbook
from xls2xlsx import XLS2XLSX
diff --git a/camel/toolkits/image_analysis_toolkit.py b/camel/toolkits/image_analysis_toolkit.py
index 58bc80aae..ab1120806 100644
--- a/camel/toolkits/image_analysis_toolkit.py
+++ b/camel/toolkits/image_analysis_toolkit.py
@@ -12,6 +12,9 @@
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
+
from io import BytesIO
from typing import List, Optional
from urllib.parse import urlparse
diff --git a/camel/toolkits/twitter_toolkit.py b/camel/toolkits/twitter_toolkit.py
index a16d35326..f36e30a4a 100644
--- a/camel/toolkits/twitter_toolkit.py
+++ b/camel/toolkits/twitter_toolkit.py
@@ -18,7 +18,6 @@ from http.client import responses
from typing import Any, Dict, List, Optional, Union
import requests
-from requests_oauthlib import OAuth1
from camel.logger import get_logger
from camel.toolkits import FunctionTool
@@ -76,6 +75,8 @@ def create_tweet(
Reference:
https://developer.x.com/en/docs/x-api/tweets/manage-tweets/api-reference/post-tweets
"""
+ from requests_oauthlib import OAuth1
+
auth = OAuth1(
os.getenv("TWITTER_CONSUMER_KEY"),
os.getenv("TWITTER_CONSUMER_SECRET"),
@@ -160,6 +161,8 @@ def delete_tweet(tweet_id: str) -> str:
Reference:
https://developer.x.com/en/docs/x-api/tweets/manage-tweets/api-reference/delete-tweets-id
"""
+ from requests_oauthlib import OAuth1
+
auth = OAuth1(
os.getenv("TWITTER_CONSUMER_KEY"),
os.getenv("TWITTER_CONSUMER_SECRET"),
@@ -263,6 +266,8 @@ def _get_user_info(username: Optional[str] = None) -> str:
Returns:
str: A formatted report of the user's Twitter profile information.
"""
+ from requests_oauthlib import OAuth1
+
oauth = OAuth1(
os.getenv("TWITTER_CONSUMER_KEY"),
os.getenv("TWITTER_CONSUMER_SECRET"),
diff --git a/camel/toolkits/video_analysis_toolkit.py b/camel/toolkits/video_analysis_toolkit.py
index 1a9bb401d..3fc03f60e 100644
--- a/camel/toolkits/video_analysis_toolkit.py
+++ b/camel/toolkits/video_analysis_toolkit.py
@@ -12,6 +12,9 @@
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
+
import io
import os
import tempfile
diff --git a/camel/toolkits/video_download_toolkit.py b/camel/toolkits/video_download_toolkit.py
index e2d8d1e61..64a0f1ed5 100644
--- a/camel/toolkits/video_download_toolkit.py
+++ b/camel/toolkits/video_download_toolkit.py
@@ -12,6 +12,9 @@
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+# Enables postponed evaluation of annotations (for string-based type hints)
+from __future__ import annotations
+
import io
import tempfile
from pathlib import Path
diff --git a/pyproject.toml b/pyproject.toml
index 33a35b89f..92a938a3c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -30,6 +30,7 @@ dependencies = [
"pydantic>=2.10.6",
"httpx>=0.28.0,<1.0.0dev",
"psutil>=5.9.8,<6",
+ "pillow>=10.1.0,<11.0.0",
]
@@ -124,7 +125,6 @@ document_tools = [
]
media_tools = [
"imageio[pyav]>=2.34.2,<3",
- "pillow>=10.1.0,<11.0.0",
"pydub>=0.25.1,<0.26",
"yt-dlp>=2024.11.4,<2025",
"ffmpeg-python>=0.2.0,<0.3",
@@ -216,7 +216,6 @@ owl = [
"soundfile>=0.13,<0.14",
"pydub>=0.25.1,<0.26",
"ffmpeg-python>=0.2.0,<0.3",
- "pillow>=10.1.0,<11.0.0",
"opencv-python>=4,<5",
"imageio[pyav]>=2.34.2,<3",
"yt-dlp>=2024.11.4,<2025",
@@ -288,7 +287,6 @@ all = [
"arxiv>=2.1.3,<3",
"arxiv2text>=0.1.14,<0.2",
"imageio[pyav]>=2.34.2,<3",
- "pillow>=10.1.0,<11.0.0",
"slack-sdk>=3.27.2,<4",
"slack-bolt>=1.20.1,<2",
"pydub>=0.25.1,<0.26",
diff --git a/test/integration_test/test_minimal_dependency.py b/test/integration_test/test_minimal_dependency.py
new file mode 100644
index 000000000..b918e6d18
--- /dev/null
+++ b/test/integration_test/test_minimal_dependency.py
@@ -0,0 +1,79 @@
+# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+
+import importlib
+import subprocess
+from pathlib import Path
+
+import pytest
+
+MODULES_TO_IMPORT = [
+ "camel.agents",
+ "camel.messages",
+ "camel.prompts",
+ "camel.utils",
+ "camel.types",
+ "camel.societies",
+ "camel.societies.workforce",
+]
+
+
[email protected]("module_path", MODULES_TO_IMPORT)
+def test_minimum_deps_module_importable(module_path):
+ r"""Test whether a module can be imported under minimal dependencies.
+
+ This ensures that the module does not require optional or heavyweight
+ dependencies to be imported, which is important for lightweight usage
+ or constrained environments.
+
+ Args:
+ module_path (str): The dotted import path of the module to test.
+ """
+ try:
+ importlib.import_module(module_path)
+ except ImportError as e:
+ pytest.fail(
+ f"Failed to import {module_path} with"
+ f" minimal dependencies:\n{e!s}"
+ )
+
+
+EXAMPLES = [
+ "examples/tasks/task_generation.py",
+ "examples/agents/single_agent.py",
+ "examples/ai_society/generate_meta_data.py",
+ "examples/conversion.py",
+]
+
+
[email protected]("example_path", EXAMPLES)
+def test_example_runs_or_skips(example_path):
+ r"""Test if an example script runs successfully or fails clearly.
+
+ This validates that user-facing example scripts execute without errors
+ when the appropriate model backend is available.
+
+ Args:
+ example_path (str): Relative file path to the example script.
+ """
+ path = Path(example_path)
+ assert path.exists(), f"{example_path} does not exist"
+
+ try:
+ subprocess.run(
+ ["python", str(path)], check=True, capture_output=True, text=True
+ )
+ except subprocess.CalledProcessError as e:
+ pytest.fail(f"{example_path} failed:\n{e.stderr.strip()}")
diff --git a/uv.lock b/uv.lock
index 266b62da0..1b6606d5e 100644
--- a/uv.lock
+++ b/uv.lock
@@ -564,6 +564,7 @@ dependencies = [
{ name = "jsonschema" },
{ name = "mcp" },
{ name = "openai" },
+ { name = "pillow" },
{ name = "psutil" },
{ name = "pydantic" },
{ name = "tiktoken" },
@@ -635,7 +636,6 @@ all = [
{ name = "outlines" },
{ name = "pandas" },
{ name = "pandasai" },
- { name = "pillow" },
{ name = "playwright" },
{ name = "prance" },
{ name = "praw" },
@@ -778,7 +778,6 @@ huggingface = [
media-tools = [
{ name = "ffmpeg-python" },
{ name = "imageio", extra = ["pyav"] },
- { name = "pillow" },
{ name = "pydub" },
{ name = "scenedetect" },
{ name = "yt-dlp" },
@@ -817,7 +816,6 @@ owl = [
{ name = "outlines" },
{ name = "pandas" },
{ name = "pandasai" },
- { name = "pillow" },
{ name = "playwright" },
{ name = "prance" },
{ name = "pyautogui" },
@@ -1075,9 +1073,7 @@ requires-dist = [
{ name = "pandasai", marker = "extra == 'document-tools'", specifier = ">=2.3.0,<3" },
{ name = "pandasai", marker = "extra == 'owl'", specifier = ">=2.3.0,<3" },
{ name = "pandasai", marker = "extra == 'rag'", specifier = ">=2.3.0,<3" },
- { name = "pillow", marker = "extra == 'all'", specifier = ">=10.1.0,<11.0.0" },
- { name = "pillow", marker = "extra == 'media-tools'", specifier = ">=10.1.0,<11.0.0" },
- { name = "pillow", marker = "extra == 'owl'", specifier = ">=10.1.0,<11.0.0" },
+ { name = "pillow", specifier = ">=10.1.0,<11.0.0" },
{ name = "playwright", marker = "extra == 'all'", specifier = ">=1.50.0" },
{ name = "playwright", marker = "extra == 'owl'", specifier = ">=1.50.0" },
{ name = "playwright", marker = "extra == 'web-tools'", specifier = ">=1.50.0" },