about summary refs log tree commit diff
path: root/pkgs/development/python-modules/langchain-text-splitters/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/langchain-text-splitters/default.nix')
-rw-r--r--pkgs/development/python-modules/langchain-text-splitters/default.nix42
1 files changed, 26 insertions, 16 deletions
diff --git a/pkgs/development/python-modules/langchain-text-splitters/default.nix b/pkgs/development/python-modules/langchain-text-splitters/default.nix
index 3f8fa837af7a3..d24c177a07125 100644
--- a/pkgs/development/python-modules/langchain-text-splitters/default.nix
+++ b/pkgs/development/python-modules/langchain-text-splitters/default.nix
@@ -1,42 +1,52 @@
 {
   lib,
   buildPythonPackage,
-  fetchPypi,
+  fetchFromGitHub,
   poetry-core,
   langchain-core,
-  lxml,
+  pytest-asyncio,
+  pytestCheckHook,
   pythonOlder,
 }:
 
 buildPythonPackage rec {
   pname = "langchain-text-splitters";
-  version = "0.0.2";
+  version = "0.2.1";
   pyproject = true;
 
   disabled = pythonOlder "3.9";
 
-  src = fetchPypi {
-    pname = "langchain_text_splitters";
-    inherit version;
-    hash = "sha256-rIkn3AugjrpwL2lhye19986tjeGan3EBqyteo0IBs8E=";
+  src = fetchFromGitHub {
+    owner = "langchain-ai";
+    repo = "langchain";
+    rev = "refs/tags/langchain-text-splitters==${version}";
+    hash = "sha256-5le+P+7iGjrTetnTHiJilqtc7G7kJbZnEsUgFyF2aQ8=";
   };
 
+  sourceRoot = "${src.name}/libs/text-splitters";
+
   build-system = [ poetry-core ];
 
-  dependencies = [
-    langchain-core
-    lxml
+  dependencies = [ langchain-core ];
+
+  pythonImportsCheck = [ "langchain_text_splitters" ];
+
+  nativeCheckInputs = [
+    pytest-asyncio
+    pytestCheckHook
   ];
 
-  # PyPI source does not have tests
-  doCheck = false;
+  pytestFlagsArray = [ "tests/unit_tests" ];
 
-  pythonImportsCheck = [ "langchain_text_splitters" ];
+  passthru = {
+    inherit (langchain-core) updateScript;
+  };
 
-  meta = with lib; {
+  meta = {
     description = "Build context-aware reasoning applications";
     homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/text-splitters";
-    license = licenses.mit;
-    maintainers = with maintainers; [ fab ];
+    changelog = "https://github.com/langchain-ai/langchain/releases/tag/${src.rev}";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ fab ];
   };
 }