about summary refs log tree commit diff
path: root/pkgs/development/python-modules/langchain-community/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/langchain-community/default.nix')
-rw-r--r--pkgs/development/python-modules/langchain-community/default.nix54
1 files changed, 35 insertions, 19 deletions
diff --git a/pkgs/development/python-modules/langchain-community/default.nix b/pkgs/development/python-modules/langchain-community/default.nix
index 063ee482ddb5c..6d29c6e12ffd2 100644
--- a/pkgs/development/python-modules/langchain-community/default.nix
+++ b/pkgs/development/python-modules/langchain-community/default.nix
@@ -2,70 +2,81 @@
   lib,
   buildPythonPackage,
   fetchFromGitHub,
+
+  # build-system
   poetry-core,
-  pythonOlder,
+
+  # dependencies
   aiohttp,
   dataclasses-json,
-  duckdb-engine,
-  langchain,
   langchain-core,
+  langchain,
   langsmith,
-  lark,
+  pydantic-settings,
+  pyyaml,
+  requests,
+  sqlalchemy,
+  tenacity,
+
+  # optional-dependencies
+  typer,
   numpy,
+
+  # tests
+  httpx,
+  langchain-standard-tests,
+  lark,
   pandas,
   pytest-asyncio,
   pytest-mock,
   pytestCheckHook,
-  pyyaml,
-  requests,
   requests-mock,
   responses,
-  sqlalchemy,
   syrupy,
-  tenacity,
   toml,
-  typer,
 }:
 
 buildPythonPackage rec {
   pname = "langchain-community";
-  version = "0.2.5";
+  version = "0.3.1";
   pyproject = true;
 
-  disabled = pythonOlder "3.8";
-
   src = fetchFromGitHub {
     owner = "langchain-ai";
     repo = "langchain";
-    rev = "refs/tags/${pname}==${version}";
-    hash = "sha256-SVqhNfRAQoVyUsPw55ByPtVzU/h1II/ox8I79QJsci8=";
+    rev = "refs/tags/langchain-community==${version}";
+    hash = "sha256-h7+89w8PkSpFxGGQKFC6FuB6Q2B27EYgLk0aiPqwp4s=";
   };
 
   sourceRoot = "${src.name}/libs/community";
 
   build-system = [ poetry-core ];
 
+  pythonRelaxDeps = [ "pydantic-settings" ];
+
   dependencies = [
     aiohttp
     dataclasses-json
     langchain-core
     langchain
     langsmith
-    numpy
+    pydantic-settings
     pyyaml
     requests
     sqlalchemy
     tenacity
   ];
 
-  passthru.optional-dependencies = {
+  optional-dependencies = {
     cli = [ typer ];
+    numpy = [ numpy ];
   };
 
   pythonImportsCheck = [ "langchain_community" ];
 
   nativeCheckInputs = [
-    duckdb-engine
+    httpx
+    langchain-standard-tests
     lark
     pandas
     pytest-asyncio
@@ -80,7 +91,7 @@ buildPythonPackage rec {
   pytestFlagsArray = [ "tests/unit_tests" ];
 
   passthru = {
-    updateScript = langchain-core.updateScript;
+    inherit (langchain-core) updateScript;
   };
 
   __darwinAllowLocalNetworking = true;
@@ -88,12 +99,17 @@ buildPythonPackage rec {
   disabledTests = [
     # Test require network access
     "test_ovhcloud_embed_documents"
+    "test_yandex"
+    # duckdb-engine needs python-wasmer which is not yet available in Python 3.12
+    # See https://github.com/NixOS/nixpkgs/pull/326337 and https://github.com/wasmerio/wasmer-python/issues/778
+    "test_table_info"
+    "test_sql_database_run"
   ];
 
   meta = {
+    changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-community==${version}";
     description = "Community contributed LangChain integrations";
     homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/community";
-    changelog = "https://github.com/langchain-ai/langchain/releases/tag/v${version}";
     license = lib.licenses.mit;
     maintainers = with lib.maintainers; [ natsukium ];
   };