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.nix53
1 files changed, 30 insertions, 23 deletions
diff --git a/pkgs/development/python-modules/langchain-text-splitters/default.nix b/pkgs/development/python-modules/langchain-text-splitters/default.nix
index 81cb942e51553..73a1e722019a4 100644
--- a/pkgs/development/python-modules/langchain-text-splitters/default.nix
+++ b/pkgs/development/python-modules/langchain-text-splitters/default.nix
@@ -1,44 +1,51 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, poetry-core
-, langchain-core
-, lxml
-, pythonOlder
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  poetry-core,
+  langchain-core,
+  pytest-asyncio,
+  pytestCheckHook,
+  pythonOlder,
 }:
 
 buildPythonPackage rec {
   pname = "langchain-text-splitters";
-  version = "0.0.1";
+  version = "0.2.0";
   pyproject = true;
 
   disabled = pythonOlder "3.9";
 
-  src = fetchPypi {
-    pname = "langchain_text_splitters";
-    inherit version;
-    hash = "sha256-rEWfqYeZ9RF61UJakzCyGWEyHjC8GaKi+fdh3a3WKqE=";
+  src = fetchFromGitHub {
+    owner = "langchain-ai";
+    repo = "langchain";
+    rev = "refs/tags/langchain-text-splitters==${version}";
+    hash = "sha256-QrgZ0j/YdOgEgLeQNSKjOIwqdr/Izuw9Gh6eKQ/00tQ=";
   };
 
-  nativeBuildInputs = [
-    poetry-core
-  ];
+  sourceRoot = "${src.name}/libs/text-splitters";
 
-  propagatedBuildInputs = [
-    langchain-core
-    lxml
-  ];
+  build-system = [ poetry-core ];
+
+  dependencies = [ langchain-core ];
 
-  # PyPI source does not have tests
-  doCheck = false;
+  pythonImportsCheck = [ "langchain_text_splitters" ];
 
-  pythonImportsCheck = [
-    "langchain_text_splitters"
+  nativeCheckInputs = [
+    pytest-asyncio
+    pytestCheckHook
   ];
 
+  pytestFlagsArray = [ "tests/unit_tests" ];
+
+  passthru = {
+    inherit (langchain-core) updateScript;
+  };
+
   meta = with lib; {
     description = "Build context-aware reasoning applications";
     homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/text-splitters";
+    changelog = "https://github.com/langchain-ai/langchain/releases/tag/${src.rev}";
     license = licenses.mit;
     maintainers = with maintainers; [ fab ];
   };