Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 6 # build-system 7 pdm-backend, 8 9 # dependencies 10 chromadb, 11 langchain-core, 12 numpy, 13 14 # tests 15 langchain-tests, 16 pytestCheckHook, 17 pytest-asyncio, 18 19 # passthru 20 gitUpdater, 21}: 22 23buildPythonPackage rec { 24 pname = "langchain-chroma"; 25 version = "0.2.4"; 26 pyproject = true; 27 28 src = fetchFromGitHub { 29 owner = "langchain-ai"; 30 repo = "langchain"; 31 tag = "langchain-chroma==${version}"; 32 hash = "sha256-w4xvPPLYkPiQA34bimVHLe+vghMI9Pq36CHoE/EMnr8="; 33 }; 34 35 sourceRoot = "${src.name}/libs/partners/chroma"; 36 37 patches = [ ./001-async-test.patch ]; 38 39 build-system = [ pdm-backend ]; 40 41 pythonRelaxDeps = [ 42 # Each component release requests the exact latest core. 43 # That prevents us from updating individual components. 44 "langchain-core" 45 "numpy" 46 ]; 47 48 dependencies = [ 49 chromadb 50 langchain-core 51 numpy 52 ]; 53 54 pythonImportsCheck = [ "langchain_chroma" ]; 55 56 nativeCheckInputs = [ 57 langchain-tests 58 pytest-asyncio 59 pytestCheckHook 60 ]; 61 62 disabledTests = [ 63 # Bad integration test, not used or vetted by the langchain team 64 "test_chroma_update_document" 65 ]; 66 67 passthru.updateScript = gitUpdater { 68 rev-prefix = "langchain-chroma=="; 69 }; 70 71 meta = { 72 changelog = "https://github.com/langchain-ai/langchain/releases/tag/${src.tag}"; 73 description = "Integration package connecting Chroma and LangChain"; 74 homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/chroma"; 75 license = lib.licenses.mit; 76 maintainers = with lib.maintainers; [ 77 natsukium 78 sarahec 79 ]; 80 }; 81}