From 536e6566ffe1edea82d4cdca537d38bd9e4930a0 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 24 May 2024 10:29:56 +0900 Subject: [PATCH] python311Packages.langchain-core: add updateScript --- .../python-modules/langchain-community/default.nix | 4 ++++ .../python-modules/langchain-core/default.nix | 14 ++++++++++++++ .../langchain-text-splitters/default.nix | 4 ++++ .../python-modules/langchain/default.nix | 4 ++++ 4 files changed, 26 insertions(+) diff --git a/pkgs/development/python-modules/langchain-community/default.nix b/pkgs/development/python-modules/langchain-community/default.nix index e8e028570abd..947d23fb21fd 100644 --- a/pkgs/development/python-modules/langchain-community/default.nix +++ b/pkgs/development/python-modules/langchain-community/default.nix @@ -52,6 +52,10 @@ buildPythonPackage rec { # PyPI source does not have tests doCheck = false; + passthru = { + updateScript = langchain-core.updateScript; + }; + meta = with lib; { description = "Community contributed LangChain integrations"; homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/community"; diff --git a/pkgs/development/python-modules/langchain-core/default.nix b/pkgs/development/python-modules/langchain-core/default.nix index 8cfa8cafd9ee..d2ee9ee504cf 100644 --- a/pkgs/development/python-modules/langchain-core/default.nix +++ b/pkgs/development/python-modules/langchain-core/default.nix @@ -13,6 +13,7 @@ pyyaml, requests, tenacity, + writeScript, }: buildPythonPackage rec { @@ -53,6 +54,19 @@ buildPythonPackage rec { # PyPI source does not have tests doCheck = false; + passthru = { + updateScript = writeScript "update.sh" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p nix-update + + set -eu -o pipefail + nix-update --commit --version-regex 'langchain-core==(.*)' python3Packages.langchain-core + nix-update --commit --version-regex 'langchain-text-splitters==(.*)' python3Packages.langchain-text-splitters + nix-update --commit --version-regex 'langchain==(.*)' python3Packages.langchain + nix-update --commit --version-regex 'langchain-community==(.*)' python3Packages.langchain-community + ''; + }; + meta = with lib; { description = "Building applications with LLMs through composability"; homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/core"; diff --git a/pkgs/development/python-modules/langchain-text-splitters/default.nix b/pkgs/development/python-modules/langchain-text-splitters/default.nix index 3f8fa837af7a..6084bbf5ee0b 100644 --- a/pkgs/development/python-modules/langchain-text-splitters/default.nix +++ b/pkgs/development/python-modules/langchain-text-splitters/default.nix @@ -33,6 +33,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "langchain_text_splitters" ]; + 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"; diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix index 804f63a88e9f..7b085b2cde6f 100644 --- a/pkgs/development/python-modules/langchain/default.nix +++ b/pkgs/development/python-modules/langchain/default.nix @@ -166,6 +166,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "langchain" ]; + passthru = { + updateScript = langchain-core.updateScript; + }; + meta = with lib; { description = "Building applications with LLMs through composability"; homepage = "https://github.com/langchain-ai/langchain";