Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python312Packages.langchain-chroma: fix broken tests #345803

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/libs/partners/chroma/tests/integration_tests/test_vectorstores.py b/libs/partners/chroma/tests/integration_tests/test_vectorstores.py
index 382b24cb5..f99a34112 100644
--- a/tests/integration_tests/test_vectorstores.py
+++ b/tests/integration_tests/test_vectorstores.py
@@ -36,7 +36,7 @@ def test_chroma() -> None:

assert output == [Document(page_content="foo")]

-
+@pytest.mark.asyncio
async def test_chroma_async() -> None:
"""Test end to end construction and search."""
texts = ["foo", "bar", "baz"]
13 changes: 11 additions & 2 deletions pkgs/development/python-modules/langchain-chroma/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
numpy,
poetry-core,
pytestCheckHook,
pytest-asyncio,
}:

buildPythonPackage rec {
Expand All @@ -23,6 +24,8 @@ buildPythonPackage rec {

sourceRoot = "${src.name}/libs/partners/chroma";

patches = [ ./001-async-test.patch ];

build-system = [ poetry-core ];

pythonRelaxDeps = [ "chromadb" ];
Expand All @@ -35,7 +38,10 @@ buildPythonPackage rec {

pythonImportsCheck = [ "langchain_chroma" ];

nativeCheckInputs = [ pytestCheckHook ];
nativeCheckInputs = [
pytest-asyncio
pytestCheckHook
];

passthru = {
inherit (langchain-core) updateScript;
Expand All @@ -46,6 +52,9 @@ buildPythonPackage rec {
description = "Integration package connecting Chroma and LangChain";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/chroma";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
maintainers = with lib.maintainers; [
natsukium
sarahec
];
};
}