DSPy: The framework for programming—not prompting—language models
Python
Maintenance: Update dependency LiteLLM for CVE (#7981)
Mike Weltevrede3a9a8215851e
diff --git a/poetry.lock b/poetry.lockindex b28338af5..b5bd6efe2 100644--- a/poetry.lock+++ b/poetry.lock@@ -8590,4 +8590,4 @@ weaviate = ["weaviate-client"][metadata]lock-version = "2.1"python-versions = ">=3.9,<3.14"-content-hash = "79432f6acaddeaa577f8cb44ef59aaace4d723375e346636a2ff0cd093546cf9"+content-hash = "5526e0f6c1ba98dd8106e835ba24bb4da11dcebde6fc423bf8ece7bac205eddb"diff --git a/pyproject.toml b/pyproject.tomlindex 51d1be667..55b3a4d30 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -39,7 +39,7 @@ dependencies = ["optuna","pydantic~=2.0","magicattr~=0.1.6",- "litellm>=1.59.8,<2.0.0",+ "litellm>=1.60.3,<2.0.0","diskcache","json-repair","tenacity>=8.2.3",@@ -163,8 +163,8 @@ ipykernel = "^6.29.4"semver = "^3.0.2"pillow = "^10.1.0"litellm = [- { version = ">=1.59.8,<2.0.0", markers = "sys_platform == 'win32'" },- { version = ">=1.59.8,<2.0.0", extras = ["proxy"], markers = "sys_platform != 'win32'" }+ { version = ">=1.60.3,<2.0.0", markers = "sys_platform == 'win32'" },+ { version = ">=1.60.3,<2.0.0", extras = ["proxy"], markers = "sys_platform != 'win32'" }]datamodel-code-generator = "^0.26.3"diff --git a/tests/primitives/test_python_interpreter.py b/tests/primitives/test_python_interpreter.pyindex 593cf63fa..60e94bb2c 100644--- a/tests/primitives/test_python_interpreter.py+++ b/tests/primitives/test_python_interpreter.py@@ -1,16 +1,20 @@import shutil+import pytest-from dspy.primitives.python_interpreter import PythonInterpreter, InterpreterError++from dspy.primitives.python_interpreter import InterpreterError, PythonInterpreter# This test suite requires deno to be installed. Please install deno following https://docs.deno.com/runtime/getting_started/installation/if shutil.which("deno") is None:- pytest.skip(reason="Deno is not installed or not in PATH")+ pytest.skip(reason="Deno is not installed or not in PATH", allow_module_level=True)+def test_execute_simple_code():interpreter = PythonInterpreter()code = "print('Hello, World!')"result = interpreter.execute(code)- assert result == 'Hello, World!\n', "Simple print statement should return 'Hello World!\n'"+ assert result == "Hello, World!\n", "Simple print statement should return 'Hello World!\n'"+def test_import():interpreter = PythonInterpreter()@@ -18,18 +22,21 @@ def test_import():result = interpreter.execute(code)assert result == 2, "Should be able to import and use math.sqrt"+def test_user_variable_definitions():interpreter = PythonInterpreter()code = "result = number + 1\nresult"- result = interpreter.execute(code, variables={'number': 4})+ result = interpreter.execute(code, variables={"number": 4})assert result == 5, "User variable assignment should work"+def test_failure_syntax_error():interpreter = PythonInterpreter()code = "+++"with pytest.raises(SyntaxError, match="Invalid Python syntax"):interpreter.execute(code)+def test_failure_zero_division():interpreter = PythonInterpreter()code = "1+0/0"