DSPy: The framework for programming—not prompting—language models
Python
Use importorskip for PIL in ReAct test (#8870)
TomuHiratab71a1182e993
diff --git a/pyproject.toml b/pyproject.tomlindex 3928635dc..78005f0a2 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -40,6 +40,7 @@ dependencies = ["cachetools>=5.5.0","cloudpickle>=3.0.0","rich>=13.7.1",+ "pillow>=10.1.0","numpy>=1.26.0","xxhash>=3.5.0","gepa[dspy]==0.0.17",diff --git a/tests/predict/test_react.py b/tests/predict/test_react.pyindex 55ff59607..6c12859c0 100644--- a/tests/predict/test_react.py+++ b/tests/predict/test_react.py@@ -2,14 +2,17 @@ import reimport litellmimport pytest-from PIL import Imagefrom pydantic import BaseModelimport dspyfrom dspy.utils.dummies import DummyLMdef test_tool_observation_preserves_custom_type():+ pytest.importorskip("PIL.Image")+ from PIL import Image+captured_calls = []class SpyChatAdapter(dspy.ChatAdapter):diff --git a/uv.lock b/uv.lockindex 2e1bff8ff..0e9afdf5c 100644--- a/uv.lock+++ b/uv.lock@@ -683,6 +683,7 @@ dependencies = [{ name = "openai" },{ name = "optuna" },{ name = "orjson" },+ { name = "pillow" },{ name = "pydantic" },{ name = "regex" },{ name = "requests" },