From 34adeb01724d323b449df83517274b662a53b71f Mon Sep 17 00:00:00 2001 From: Chester Curme Date: Mon, 9 Dec 2024 16:06:19 -0500 Subject: [PATCH] update --- poetry.lock | 45 ++----------------- pyproject.toml | 2 +- .../test_vectorstore_standard_tests.py | 25 +++++++++-- 3 files changed, 27 insertions(+), 45 deletions(-) diff --git a/poetry.lock b/poetry.lock index 0787e04..b71bde3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1353,13 +1353,13 @@ typing-extensions = ">=4.7" [[package]] name = "langchain-tests" -version = "0.3.6" +version = "0.3.7" description = "Standard tests for LangChain implementations" optional = false python-versions = "<4.0,>=3.9" files = [ - {file = "langchain_tests-0.3.6-py3-none-any.whl", hash = "sha256:a651e24e8e4d92458a1b9745e26896cb5736cb8f8d64d73ac06859d28a885cfb"}, - {file = "langchain_tests-0.3.6.tar.gz", hash = "sha256:84251d637d55557b99f25e651ac7fea00f66eea1769003516304586938e6d16c"}, + {file = "langchain_tests-0.3.7-py3-none-any.whl", hash = "sha256:ebbb15bb4b81a75b15272ecfd8a6b9ff45f015c6edccdcf0a16d1fe461a33c90"}, + {file = "langchain_tests-0.3.7.tar.gz", hash = "sha256:28c1edff887de6f50b399345568f54f38797b7fa25d1d01b05e07172717ff7a0"}, ] [package.dependencies] @@ -1712,43 +1712,6 @@ jupyter-server = ">=1.8,<3" [package.extras] test = ["pytest", "pytest-console-scripts", "pytest-jupyter", "pytest-tornasync"] -[[package]] -name = "numpy" -version = "1.24.4" -description = "Fundamental package for array computing in Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "numpy-1.24.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c0bfb52d2169d58c1cdb8cc1f16989101639b34c7d3ce60ed70b19c63eba0b64"}, - {file = "numpy-1.24.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ed094d4f0c177b1b8e7aa9cba7d6ceed51c0e569a5318ac0ca9a090680a6a1b1"}, - {file = "numpy-1.24.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79fc682a374c4a8ed08b331bef9c5f582585d1048fa6d80bc6c35bc384eee9b4"}, - {file = "numpy-1.24.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ffe43c74893dbf38c2b0a1f5428760a1a9c98285553c89e12d70a96a7f3a4d6"}, - {file = "numpy-1.24.4-cp310-cp310-win32.whl", hash = "sha256:4c21decb6ea94057331e111a5bed9a79d335658c27ce2adb580fb4d54f2ad9bc"}, - {file = "numpy-1.24.4-cp310-cp310-win_amd64.whl", hash = "sha256:b4bea75e47d9586d31e892a7401f76e909712a0fd510f58f5337bea9572c571e"}, - {file = "numpy-1.24.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f136bab9c2cfd8da131132c2cf6cc27331dd6fae65f95f69dcd4ae3c3639c810"}, - {file = "numpy-1.24.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e2926dac25b313635e4d6cf4dc4e51c8c0ebfed60b801c799ffc4c32bf3d1254"}, - {file = "numpy-1.24.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:222e40d0e2548690405b0b3c7b21d1169117391c2e82c378467ef9ab4c8f0da7"}, - {file = "numpy-1.24.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7215847ce88a85ce39baf9e89070cb860c98fdddacbaa6c0da3ffb31b3350bd5"}, - {file = "numpy-1.24.4-cp311-cp311-win32.whl", hash = "sha256:4979217d7de511a8d57f4b4b5b2b965f707768440c17cb70fbf254c4b225238d"}, - {file = "numpy-1.24.4-cp311-cp311-win_amd64.whl", hash = "sha256:b7b1fc9864d7d39e28f41d089bfd6353cb5f27ecd9905348c24187a768c79694"}, - {file = "numpy-1.24.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1452241c290f3e2a312c137a9999cdbf63f78864d63c79039bda65ee86943f61"}, - {file = "numpy-1.24.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:04640dab83f7c6c85abf9cd729c5b65f1ebd0ccf9de90b270cd61935eef0197f"}, - {file = "numpy-1.24.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5425b114831d1e77e4b5d812b69d11d962e104095a5b9c3b641a218abcc050e"}, - {file = "numpy-1.24.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd80e219fd4c71fc3699fc1dadac5dcf4fd882bfc6f7ec53d30fa197b8ee22dc"}, - {file = "numpy-1.24.4-cp38-cp38-win32.whl", hash = "sha256:4602244f345453db537be5314d3983dbf5834a9701b7723ec28923e2889e0bb2"}, - {file = "numpy-1.24.4-cp38-cp38-win_amd64.whl", hash = "sha256:692f2e0f55794943c5bfff12b3f56f99af76f902fc47487bdfe97856de51a706"}, - {file = "numpy-1.24.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2541312fbf09977f3b3ad449c4e5f4bb55d0dbf79226d7724211acc905049400"}, - {file = "numpy-1.24.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9667575fb6d13c95f1b36aca12c5ee3356bf001b714fc354eb5465ce1609e62f"}, - {file = "numpy-1.24.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3a86ed21e4f87050382c7bc96571755193c4c1392490744ac73d660e8f564a9"}, - {file = "numpy-1.24.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d11efb4dbecbdf22508d55e48d9c8384db795e1b7b51ea735289ff96613ff74d"}, - {file = "numpy-1.24.4-cp39-cp39-win32.whl", hash = "sha256:6620c0acd41dbcb368610bb2f4d83145674040025e5536954782467100aa8835"}, - {file = "numpy-1.24.4-cp39-cp39-win_amd64.whl", hash = "sha256:befe2bf740fd8373cf56149a5c23a0f601e82869598d41f8e188a0e9869926f8"}, - {file = "numpy-1.24.4-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:31f13e25b4e304632a4619d0e0777662c2ffea99fcae2029556b17d8ff958aef"}, - {file = "numpy-1.24.4-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95f7ac6540e95bc440ad77f56e520da5bf877f87dca58bd095288dce8940532a"}, - {file = "numpy-1.24.4-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e98f220aa76ca2a977fe435f5b04d7b3470c0a2e6312907b37ba6068f26787f2"}, - {file = "numpy-1.24.4.tar.gz", hash = "sha256:80f5e3a4e498641401868df4208b74581206afbee7cf7b8329daae82676d9463"}, -] - [[package]] name = "numpy" version = "1.26.4" @@ -3300,4 +3263,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "5dd8fb0a3969b3fc6231acf7849a3716aff0435cd47ced9e9a203fb3c2b69dac" +content-hash = "d9cb071efbb2e562b65a9950ddfa0e05bd460f5db51895de2a6f929453d82021" diff --git a/pyproject.toml b/pyproject.toml index 53cbb68..0164257 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ pytest-asyncio = "^0.23.2" pytest-socket = "^0.7.0" pytest-cov = "^5.0.0" pytest-timeout = "^2.3.1" -langchain-tests = "0.3.6" +langchain-tests = "0.3.7" [tool.poetry.group.codespell] optional = true diff --git a/tests/unit_tests/test_vectorstore_standard_tests.py b/tests/unit_tests/test_vectorstore_standard_tests.py index 5ce1672..489128e 100644 --- a/tests/unit_tests/test_vectorstore_standard_tests.py +++ b/tests/unit_tests/test_vectorstore_standard_tests.py @@ -1,13 +1,13 @@ -from typing import Generator +from typing import AsyncGenerator, Generator import pytest from langchain_core.vectorstores import VectorStore from langchain_tests.integration_tests import VectorStoreIntegrationTests -from tests.unit_tests.test_vectorstore import get_vectorstore +from tests.unit_tests.test_vectorstore import aget_vectorstore, get_vectorstore -class TestStandard(VectorStoreIntegrationTests): +class TestSync(VectorStoreIntegrationTests): @pytest.fixture() def vectorstore(self) -> Generator[VectorStore, None, None]: # type: ignore """Get an empty vectorstore for unit tests.""" @@ -16,3 +16,22 @@ def vectorstore(self) -> Generator[VectorStore, None, None]: # type: ignore vstore.create_tables_if_not_exists() vstore.create_collection() yield vstore + + @property + def has_async(self) -> bool: + return False + + +class TestAsync(VectorStoreIntegrationTests): + @pytest.fixture() + async def vectorstore(self) -> AsyncGenerator[VectorStore, None]: # type: ignore + """Get an empty vectorstore for unit tests.""" + async with aget_vectorstore(embedding=self.get_embeddings()) as vstore: + await vstore.adrop_tables() + await vstore.acreate_tables_if_not_exists() + await vstore.acreate_collection() + yield vstore + + @property + def has_sync(self) -> bool: + return False