From dd5581a72aeb918343b53a32ea785124ed99b871 Mon Sep 17 00:00:00 2001 From: Andy Li <55300002+cliandy@users.noreply.github.com> Date: Fri, 13 Jun 2025 12:33:53 -0700 Subject: [PATCH] chore: workflow consolidatation and fern caching for tests on pr (#2787) --- poetry.lock | 148 +++++++---------------------------------------- pyproject.toml | 5 +- tests/pytest.ini | 2 + tests/utils.py | 21 ------- 4 files changed, 25 insertions(+), 151 deletions(-) diff --git a/poetry.lock b/poetry.lock index 95634737..6124a6e2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2540,36 +2540,6 @@ files = [ {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, ] -[[package]] -name = "h2" -version = "4.2.0" -description = "Pure-Python HTTP/2 protocol implementation" -optional = true -python-versions = ">=3.9" -groups = ["main"] -markers = "extra == \"qdrant\"" -files = [ - {file = "h2-4.2.0-py3-none-any.whl", hash = "sha256:479a53ad425bb29af087f3458a61d30780bc818e4ebcf01f0b536ba916462ed0"}, - {file = "h2-4.2.0.tar.gz", hash = "sha256:c8a52129695e88b1a0578d8d2cc6842bbd79128ac685463b887ee278126ad01f"}, -] - -[package.dependencies] -hpack = ">=4.1,<5" -hyperframe = ">=6.1,<7" - -[[package]] -name = "hpack" -version = "4.1.0" -description = "Pure-Python HPACK header encoding" -optional = true -python-versions = ">=3.9" -groups = ["main"] -markers = "extra == \"qdrant\"" -files = [ - {file = "hpack-4.1.0-py3-none-any.whl", hash = "sha256:157ac792668d995c657d93111f46b4535ed114f0c9c8d672271bbec7eae1b496"}, - {file = "hpack-4.1.0.tar.gz", hash = "sha256:ec5eca154f7056aa06f196a557655c5b009b382873ac8d1e66e79e87535f1dca"}, -] - [[package]] name = "html2text" version = "2020.1.16" @@ -2619,7 +2589,6 @@ files = [ [package.dependencies] anyio = "*" certifi = "*" -h2 = {version = ">=3,<5", optional = true, markers = "extra == \"http2\""} httpcore = "==1.*" idna = "*" @@ -2642,19 +2611,6 @@ files = [ {file = "httpx_sse-0.4.0-py3-none-any.whl", hash = "sha256:f329af6eae57eaa2bdfd962b42524764af68075ea87370a2de920af5341e318f"}, ] -[[package]] -name = "hyperframe" -version = "6.1.0" -description = "Pure-Python HTTP/2 framing" -optional = true -python-versions = ">=3.9" -groups = ["main"] -markers = "extra == \"qdrant\"" -files = [ - {file = "hyperframe-6.1.0-py3-none-any.whl", hash = "sha256:b03380493a519fce58ea5af42e4a42317bf9bd425596f7a0835ffce80f1a42e5"}, - {file = "hyperframe-6.1.0.tar.gz", hash = "sha256:f630908a00854a7adeabd6382b43923a4c4cd4b821fcb527e6ab9e15382a3b08"}, -] - [[package]] name = "identify" version = "2.6.9" @@ -3375,14 +3331,14 @@ pytest = ["pytest (>=7.0.0)", "rich (>=13.9.4,<14.0.0)"] [[package]] name = "letta-client" -version = "0.1.153" +version = "0.1.155" description = "" optional = false python-versions = "<4.0,>=3.8" groups = ["main"] files = [ - {file = "letta_client-0.1.153-py3-none-any.whl", hash = "sha256:90e3adc9a884cbcacdd31c3411081c4a1849bb988c37094d9338ce2ba285ea7c"}, - {file = "letta_client-0.1.153.tar.gz", hash = "sha256:8c06ad3a0d187436ae523e2c2e493e674adb7563ddaba2070833210f4b1cd126"}, + {file = "letta_client-0.1.155-py3-none-any.whl", hash = "sha256:a1531c58c9d036eb248714827c356841b2537794d07c368ced6f741eaebeb85a"}, + {file = "letta_client-0.1.155.tar.gz", hash = "sha256:687d07d0ee8b515885ab0e6d9b15b2dca2db031b4295370c41bdd8dc728d6498"}, ] [package.dependencies] @@ -4546,7 +4502,7 @@ description = "Fast, correct Python JSON library supporting dataclasses, datetim optional = true python-versions = ">=3.9" groups = ["main"] -markers = "platform_python_implementation != \"PyPy\" and (extra == \"external-tools\" or extra == \"desktop\" or extra == \"all\")" +markers = "(extra == \"external-tools\" or extra == \"desktop\" or extra == \"all\") and platform_python_implementation != \"PyPy\"" files = [ {file = "orjson-3.10.16-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:4cb473b8e79154fa778fb56d2d73763d977be3dcc140587e07dbc545bbfc38f8"}, {file = "orjson-3.10.16-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:622a8e85eeec1948690409a19ca1c7d9fd8ff116f4861d261e6ae2094fe59a00"}, @@ -4956,27 +4912,6 @@ markers = {main = "extra == \"dev\" or extra == \"all\""} dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] -[[package]] -name = "portalocker" -version = "2.10.1" -description = "Wraps the portalocker recipe for easy usage" -optional = true -python-versions = ">=3.8" -groups = ["main"] -markers = "extra == \"qdrant\"" -files = [ - {file = "portalocker-2.10.1-py3-none-any.whl", hash = "sha256:53a5984ebc86a025552264b459b46a2086e269b21823cb572f8f28ee759e45bf"}, - {file = "portalocker-2.10.1.tar.gz", hash = "sha256:ef1bf844e878ab08aee7e40184156e1151f228f103aa5c6bd0724cc330960f8f"}, -] - -[package.dependencies] -pywin32 = {version = ">=226", markers = "platform_system == \"Windows\""} - -[package.extras] -docs = ["sphinx (>=1.7.1)"] -redis = ["redis"] -tests = ["pytest (>=5.4.1)", "pytest-cov (>=2.8.1)", "pytest-mypy (>=0.8.0)", "pytest-timeout (>=2.1.0)", "redis", "sphinx (>=6.0.0)", "types-redis"] - [[package]] name = "pre-commit" version = "3.8.0" @@ -5857,7 +5792,7 @@ files = [ {file = "pywin32-310-cp39-cp39-win32.whl", hash = "sha256:851c8d927af0d879221e616ae1f66145253537bbdd321a77e8ef701b443a9a1a"}, {file = "pywin32-310-cp39-cp39-win_amd64.whl", hash = "sha256:96867217335559ac619f00ad70e513c0fcf84b8a3af9fc2bba3b59b97da70475"}, ] -markers = {main = "(platform_system == \"Windows\" or extra == \"external-tools\" or extra == \"desktop\" or extra == \"all\" or extra == \"dev\") and (sys_platform == \"win32\" or platform_system == \"Windows\") and (sys_platform == \"win32\" or extra == \"qdrant\") and (extra == \"qdrant\" or extra == \"external-tools\" or extra == \"desktop\" or extra == \"all\" or extra == \"dev\")", dev = "platform_python_implementation != \"PyPy\" and sys_platform == \"win32\""} +markers = {main = "(extra == \"external-tools\" or extra == \"desktop\" or extra == \"all\" or extra == \"dev\") and sys_platform == \"win32\"", dev = "sys_platform == \"win32\" and platform_python_implementation != \"PyPy\""} [[package]] name = "pyyaml" @@ -6029,61 +5964,6 @@ markers = {main = "extra == \"dev\" or extra == \"desktop\" or extra == \"all\"" [package.dependencies] cffi = {version = "*", markers = "implementation_name == \"pypy\""} -[[package]] -name = "qdrant-client" -version = "1.12.1" -description = "Client library for the Qdrant vector search engine" -optional = true -python-versions = ">=3.8" -groups = ["main"] -markers = "python_version == \"3.13\" and extra == \"qdrant\"" -files = [ - {file = "qdrant_client-1.12.1-py3-none-any.whl", hash = "sha256:b2d17ce18e9e767471368380dd3bbc4a0e3a0e2061fedc9af3542084b48451e0"}, - {file = "qdrant_client-1.12.1.tar.gz", hash = "sha256:35e8e646f75b7b883b3d2d0ee4c69c5301000bba41c82aa546e985db0f1aeb72"}, -] - -[package.dependencies] -grpcio = ">=1.41.0" -grpcio-tools = ">=1.41.0" -httpx = {version = ">=0.20.0", extras = ["http2"]} -numpy = {version = ">=1.26", markers = "python_version >= \"3.12\""} -portalocker = ">=2.7.0,<3.0.0" -pydantic = ">=1.10.8" -urllib3 = ">=1.26.14,<3" - -[package.extras] -fastembed = ["fastembed (==0.3.6) ; python_version < \"3.13\""] -fastembed-gpu = ["fastembed-gpu (==0.3.6) ; python_version < \"3.13\""] - -[[package]] -name = "qdrant-client" -version = "1.13.3" -description = "Client library for the Qdrant vector search engine" -optional = true -python-versions = ">=3.9" -groups = ["main"] -markers = "extra == \"qdrant\" and python_version < \"3.13\"" -files = [ - {file = "qdrant_client-1.13.3-py3-none-any.whl", hash = "sha256:f52cacbb936e547d3fceb1aaed3e3c56be0ebfd48e8ea495ea3dbc89c671d1d2"}, - {file = "qdrant_client-1.13.3.tar.gz", hash = "sha256:61ca09e07c6d7ac0dfbdeb13dca4fe5f3e08fa430cb0d74d66ef5d023a70adfc"}, -] - -[package.dependencies] -grpcio = ">=1.41.0" -grpcio-tools = ">=1.41.0" -httpx = {version = ">=0.20.0", extras = ["http2"]} -numpy = [ - {version = ">=1.26", markers = "python_version == \"3.12\""}, - {version = ">=1.21", markers = "python_version >= \"3.10\" and python_version < \"3.12\""}, -] -portalocker = ">=2.7.0,<3.0.0" -pydantic = ">=1.10.8" -urllib3 = ">=1.26.14,<3" - -[package.extras] -fastembed = ["fastembed (==0.5.1)"] -fastembed-gpu = ["fastembed-gpu (==0.5.1)"] - [[package]] name = "questionary" version = "2.1.0" @@ -6836,6 +6716,21 @@ files = [ {file = "striprtf-0.0.26.tar.gz", hash = "sha256:fdb2bba7ac440072d1c41eab50d8d74ae88f60a8b6575c6e2c7805dc462093aa"}, ] +[[package]] +name = "structlog" +version = "25.4.0" +description = "Structured Logging for Python" +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "structlog-25.4.0-py3-none-any.whl", hash = "sha256:fe809ff5c27e557d14e613f45ca441aabda051d119ee5a0102aaba6ce40eed2c"}, + {file = "structlog-25.4.0.tar.gz", hash = "sha256:186cd1b0a8ae762e29417095664adf1d6a31702160a46dacb7796ea82f7409e4"}, +] + +[package.dependencies] +typing-extensions = {version = "*", markers = "python_version < \"3.11\""} + [[package]] name = "tavily-python" version = "0.7.2" @@ -7897,7 +7792,6 @@ experimental = ["granian", "uvloop"] external-tools = ["docker", "langchain", "langchain-community", "wikipedia"] google = ["google-genai"] postgres = ["asyncpg", "pg8000", "pgvector", "psycopg2", "psycopg2-binary"] -qdrant = ["qdrant-client"] redis = ["redis"] server = ["fastapi", "uvicorn"] tests = ["wikipedia"] @@ -7905,4 +7799,4 @@ tests = ["wikipedia"] [metadata] lock-version = "2.1" python-versions = "<3.14,>=3.10" -content-hash = "55838208216d2c09d6b2319fa18653c73a770722842204fe1537178dc68df7f4" +content-hash = "ce40c1a5c61327463e698e66ededc408fd37e9fb9682d5e1c20a6f7036d91635" diff --git a/pyproject.toml b/pyproject.toml index e0a8fbb3..8e42ab06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,6 @@ html2text = "^2020.1.16" sqlalchemy = {extras = ["asyncio"], version = "^2.0.41"} pexpect = {version = "^4.9.0", optional = true} pyright = {version = "^1.1.347", optional = true} -qdrant-client = {version="^1.9.1", optional = true} #pymilvus = {version ="^2.4.3", optional = true} python-box = "^7.1.1" sqlmodel = "^0.0.16" @@ -73,7 +72,7 @@ llama-index = "^0.12.2" llama-index-embeddings-openai = "^0.3.1" e2b-code-interpreter = {version = "^1.0.3", optional = true} anthropic = "^0.49.0" -letta_client = "^0.1.153" +letta_client = "^0.1.155" openai = "^1.60.0" opentelemetry-api = "1.30.0" opentelemetry-sdk = "1.30.0" @@ -97,6 +96,7 @@ mistralai = "^1.8.1" uvloop = {version = "^0.21.0", optional = true} granian = {version = "^2.3.2", extras = ["uvloop", "reload"], optional = true} redis = {version = "^6.2.0", optional = true} +structlog = "^25.4.0" [tool.poetry.extras] @@ -105,7 +105,6 @@ redis = ["redis"] dev = ["pytest", "pytest-asyncio", "pexpect", "black", "pre-commit", "pyright", "pytest-order", "autoflake", "isort", "locust"] experimental = ["uvloop", "granian"] server = ["websockets", "fastapi", "uvicorn"] -qdrant = ["qdrant-client"] cloud-tool-sandbox = ["e2b-code-interpreter"] external-tools = ["docker", "langchain", "wikipedia", "langchain-community"] tests = ["wikipedia"] diff --git a/tests/pytest.ini b/tests/pytest.ini index 299f27d4..35efd715 100644 --- a/tests/pytest.ini +++ b/tests/pytest.ini @@ -4,6 +4,8 @@ testpaths = /tests asyncio_mode = auto filterwarnings = ignore::pytest.PytestRemovedIn9Warning + # suppresses the warnings we see with the event_loop fixture + ignore:.*is asynchronous and explicitly requests the "event_loop" fixture. Asynchronous fixtures and test functions should use "asyncio.get_running_loop\(\)" instead.* markers = local_sandbox: mark test as part of local sandbox tests e2b_sandbox: mark test as part of E2B sandbox tests diff --git a/tests/utils.py b/tests/utils.py index 04778d11..86215d0f 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -131,27 +131,6 @@ def configure_letta(enable_openai=False, enable_azure=False): configure_letta_localllm() -def qdrant_server_running() -> bool: - """Check if Qdrant server is running.""" - - try: - response = requests.get("http://localhost:6333", timeout=10.0) - response_json = response.json() - return response_json.get("title") == "qdrant - vector search engine" - except (requests.exceptions.ConnectionError, requests.exceptions.Timeout): - return False - - -def with_qdrant_storage(storage: list[str]): - """If Qdrant server is running and `qdrant_client` is installed, - append `'qdrant'` to the storage list""" - - if util.find_spec("qdrant_client") is not None and qdrant_server_running(): - storage.append("qdrant") - - return storage - - def wait_for_incoming_message( client: Letta, agent_id: str,