From 88bfd60b03f6b1eae4527465bb16b53ca9bc46b7 Mon Sep 17 00:00:00 2001 From: ccurme Date: Wed, 30 Oct 2024 12:24:48 -0400 Subject: [PATCH] infra: specify python max version of 3.12 for some integration packages (#27740) --- .github/scripts/check_diff.py | 19 ++++++++++++++++--- .../tests/unit_tests/test_chat_models.py | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/scripts/check_diff.py b/.github/scripts/check_diff.py index 56bb18d060755..17f08fe0bbf56 100644 --- a/.github/scripts/check_diff.py +++ b/.github/scripts/check_diff.py @@ -32,6 +32,21 @@ "huggingface", ] +# Cap python version at 3.12 for some packages with dependencies that are not yet +# compatible with python 3.13 (mostly hf tokenizers). +PY_312_MAX_PACKAGES = [ + f"libs/partners/{integration}" + for integration in [ + "anthropic", + "chroma", + "couchbase", + "huggingface", + "mistralai", + "nomic", + "qdrant", + ] +] + def all_package_dirs() -> Set[str]: return { @@ -117,9 +132,7 @@ def _get_configs_for_single_dir(job: str, dir_: str) -> List[Dict[str, str]]: # declare deps in funny way py_versions = ["3.9", "3.11"] - elif dir_ == "libs/partners/huggingface": - # huggingface tokenizers doesn't support 3.13 yet - # because of pep517 builds + elif dir_ in PY_312_MAX_PACKAGES: py_versions = ["3.9", "3.12"] elif dir_ in ["libs/community", "libs/langchain"] and job == "extended-tests": diff --git a/libs/partners/mistralai/tests/unit_tests/test_chat_models.py b/libs/partners/mistralai/tests/unit_tests/test_chat_models.py index a5046db47e43b..2c5c230536807 100644 --- a/libs/partners/mistralai/tests/unit_tests/test_chat_models.py +++ b/libs/partners/mistralai/tests/unit_tests/test_chat_models.py @@ -212,7 +212,7 @@ def test__convert_dict_to_message_tool_call() -> None: InvalidToolCall( name="GenerateUsername", args="oops", - error="Function GenerateUsername arguments:\n\noops\n\nare not valid JSON. Received JSONDecodeError Expecting value: line 1 column 1 (char 0)", # noqa: E501 + error="Function GenerateUsername arguments:\n\noops\n\nare not valid JSON. Received JSONDecodeError Expecting value: line 1 column 1 (char 0)\nFor troubleshooting, visit: https://python.langchain.com/docs/troubleshooting/errors/OUTPUT_PARSING_FAILURE", # noqa: E501 id="ssAbar4Dr", type="invalid_tool_call", ),