1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 poetry-core,
8
9 # dependencies
10 boto3,
11 langchain-core,
12 numpy,
13 pydantic,
14
15 # tests
16 langchain-tests,
17 pytest-asyncio,
18 pytest-cov-stub,
19 pytestCheckHook,
20
21 # passthru
22 gitUpdater,
23}:
24
25buildPythonPackage rec {
26 pname = "langchain-aws";
27 version = "0.2.33";
28 pyproject = true;
29
30 src = fetchFromGitHub {
31 owner = "langchain-ai";
32 repo = "langchain-aws";
33 tag = "langchain-aws==${version}";
34 hash = "sha256-8VRZhwrR5PdLo9FamQClKbYfuHUGVxamku4osyl8Wl4=";
35 };
36
37 postPatch = ''
38 substituteInPlace pyproject.toml \
39 --replace-fail "--snapshot-warn-unused" ""
40 '';
41
42 sourceRoot = "${src.name}/libs/aws";
43
44 build-system = [ poetry-core ];
45
46 dependencies = [
47 boto3
48 langchain-core
49 numpy
50 pydantic
51 ];
52
53 pythonRelaxDeps = [
54 # Boto @ 1.35 has outstripped the version requirement
55 "boto3"
56 # Each component release requests the exact latest core.
57 # That prevents us from updating individual components.
58 "langchain-core"
59 ];
60
61 nativeCheckInputs = [
62 langchain-tests
63 pytest-asyncio
64 pytest-cov-stub
65 pytestCheckHook
66 ];
67
68 enabledTestPaths = [ "tests/unit_tests" ];
69
70 pythonImportsCheck = [ "langchain_aws" ];
71
72 passthru = {
73 # python updater script sets the wrong tag
74 skipBulkUpdate = true;
75 updateScript = gitUpdater {
76 rev-prefix = "langchain-aws==";
77 };
78 };
79
80 meta = {
81 changelog = "https://github.com/langchain-ai/langchain-aws/releases/tag/${src.tag}";
82 description = "Build LangChain application on AWS";
83 homepage = "https://github.com/langchain-ai/langchain-aws/";
84 license = lib.licenses.mit;
85 maintainers = with lib.maintainers; [
86 natsukium
87 sarahec
88 ];
89 };
90}