From 3f5b5e6ee65a2f122aa0ca74b0eb02c65c525d2c Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 24 May 2024 02:24:26 +0000 Subject: [PATCH] python3Packages.langchain-text-splitters: 0.0.2 -> 0.2.0 Diff: https://github.com/langchain-ai/langchain/compare/refs/tags/langchain-text-splitters==0.0.2...langchain-text-splitters==0.2.0 --- .../langchain-text-splitters/default.nix | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/langchain-text-splitters/default.nix b/pkgs/development/python-modules/langchain-text-splitters/default.nix index 6084bbf5ee0b..73a1e722019a 100644 --- a/pkgs/development/python-modules/langchain-text-splitters/default.nix +++ b/pkgs/development/python-modules/langchain-text-splitters/default.nix @@ -1,38 +1,43 @@ { 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.0"; 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-QrgZ0j/YdOgEgLeQNSKjOIwqdr/Izuw9Gh6eKQ/00tQ="; }; + sourceRoot = "${src.name}/libs/text-splitters"; + build-system = [ poetry-core ]; - dependencies = [ - langchain-core - lxml - ]; - - # PyPI source does not have tests - doCheck = false; + dependencies = [ langchain-core ]; pythonImportsCheck = [ "langchain_text_splitters" ]; + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + pytestFlagsArray = [ "tests/unit_tests" ]; + passthru = { inherit (langchain-core) updateScript; }; @@ -40,6 +45,7 @@ buildPythonPackage rec { 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 ]; };