1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 poetry-core,
8
9 # dependencies
10 langchain-core,
11 numpy,
12 pymongo,
13
14 freezegun,
15 httpx,
16 langchain,
17 pytest-asyncio,
18 pytestCheckHook,
19 pytest-mock,
20 syrupy,
21
22 # passthru
23 gitUpdater,
24}:
25
26buildPythonPackage rec {
27 pname = "langchain-mongodb";
28 version = "0.2.0";
29 pyproject = true;
30
31 src = fetchFromGitHub {
32 owner = "langchain-ai";
33 repo = "langchain";
34 tag = "langchain-mongodb==${version}";
35 hash = "sha256-Jd9toXkS9dGtSIrJQ/5W+swV1z2BJOJKBtkyGzj3oSc=";
36 };
37
38 sourceRoot = "${src.name}/libs/partners/mongodb";
39
40 build-system = [ poetry-core ];
41
42 pythonRelaxDeps = [
43 # Each component release requests the exact latest core.
44 # That prevents us from updating individual components.
45 "langchain-core"
46 "numpy"
47 ];
48
49 dependencies = [
50 langchain-core
51 numpy
52 pymongo
53 ];
54
55 nativeCheckInputs = [
56 freezegun
57 httpx
58 langchain
59 pytest-asyncio
60 pytestCheckHook
61 pytest-mock
62 syrupy
63 ];
64
65 enabledTestPaths = [ "tests/unit_tests" ];
66
67 pythonImportsCheck = [ "langchain_mongodb" ];
68
69 passthru = {
70 # python updater script sets the wrong tag
71 skipBulkUpdate = true;
72 updateScript = gitUpdater {
73 rev-prefix = "langchain-mongodb==";
74 };
75 };
76
77 meta = {
78 changelog = "https://github.com/langchain-ai/langchain/releases/tag/${src.tag}";
79 description = "Integration package connecting MongoDB and LangChain";
80 homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/mongodb";
81 license = lib.licenses.mit;
82 maintainers = with lib.maintainers; [
83 natsukium
84 sarahec
85 ];
86 };
87}