Skip to content

Commit 47e5d8d

Browse files
fix(monty): update default description and tests for pydantic-monty 1.3.0 (match, bisect support) (#4155)
1 parent 6d0ae05 commit 47e5d8d

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

‎integrations/monty/pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ classifiers = [
2222
"Programming Language :: Python :: 3.15",
2323
"Programming Language :: Python :: Implementation :: CPython",
2424
]
25-
dependencies = ["haystack-ai>=3.0.0", "pydantic-monty>=1.0.0"]
25+
dependencies = ["haystack-ai>=3.0.0", "pydantic-monty>=1.3.0"]
2626

2727
[project.urls]
2828
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/monty#readme"

‎integrations/monty/src/haystack_integrations/tools/monty/python_tool.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
"snippet must be self-contained.\n"
2727
"- The sandbox has no file system, network, environment variables, or subprocesses, and no third-party packages. "
2828
"Only these standard library modules can be imported, some of them partially: asyncio, base64, binascii, "
29-
"collections, copy, dataclasses, datetime, functools, itertools, json, math, random, re, sys, time, typing, "
30-
"unicodedata.\n"
29+
"bisect, collections, copy, dataclasses, datetime, functools, itertools, json, math, random, re, sys, time, "
30+
"typing, unicodedata.\n"
3131
"- The interpreter supports a subset of Python: functions, lambdas, closures, comprehensions, simple classes, "
32-
"dataclasses, try/except, f-strings, and async/await. Class inheritance (including custom exception classes), "
33-
"generators (`yield`), `match`, `del`, and method decorators such as `@property` or `@staticmethod` are not "
32+
"dataclasses, try/except, f-strings, `match`, and async/await. Class inheritance (including custom exception "
33+
"classes), generators (`yield`), `del`, and method decorators such as `@property` or `@staticmethod` are not "
3434
"supported.\n"
3535
"- Use `print()` for intermediate output. Errors come back as a traceback, so you can fix the code and retry."
3636
)

‎integrations/monty/tests/test_python_tool.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ class TestDefaultDescriptionMatchesMonty:
205205
pytest.param("class A:\n pass\nclass B(A):\n pass", id="class inheritance"),
206206
pytest.param("class MyError(Exception):\n pass", id="custom exception class"),
207207
pytest.param("def gen():\n yield 1", id="generators"),
208-
pytest.param("match 1:\n case 1:\n pass", id="match"),
209208
pytest.param("x = 1\ndel x", id="del"),
210209
pytest.param("class A:\n @property\n def x(self):\n return 1", id="property"),
211210
pytest.param("class A:\n @staticmethod\n def x():\n return 1", id="staticmethod"),
@@ -221,7 +220,7 @@ def test_listed_modules_are_importable(self, tool):
221220
assert tool.invoke(code=f"import {module}") == "The code ran successfully and produced no output."
222221

223222
# Commonly used standard library modules that Monty doesn't implement yet
224-
@pytest.mark.parametrize("module", ["bisect", "decimal", "enum", "heapq", "operator", "statistics", "string"])
223+
@pytest.mark.parametrize("module", ["decimal", "enum", "heapq", "operator", "statistics", "string"])
225224
def test_unlisted_modules_are_not_importable(self, tool, module):
226225
assert f"ModuleNotFoundError: No module named '{module}'" in tool.invoke(code=f"import {module}")
227226

0 commit comments

Comments
 (0)