diff --git a/pkgs/development/python-modules/langchain-community/default.nix b/pkgs/development/python-modules/langchain-community/default.nix index 1652b899434b..56eba2b3cb10 100644 --- a/pkgs/development/python-modules/langchain-community/default.nix +++ b/pkgs/development/python-modules/langchain-community/default.nix @@ -37,14 +37,14 @@ buildPythonPackage rec { pname = "langchain-community"; - version = "0.3.19"; + version = "0.3.20"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; tag = "langchain-community==${version}"; - hash = "sha256-U7L60GyxRQL9ze22Wy7g6ZdI/IFyAtUe1bRCconv6pg="; + hash = "sha256-6YLy7G1kZIqHAGMUIQoGCfDO2ZuVgNEtpkOI1o8eFvc="; }; sourceRoot = "${src.name}/libs/community"; @@ -122,6 +122,11 @@ buildPythonPackage rec { "test_group_dependencies" ]; + disabledTestPaths = [ + # ValueError: Received unsupported arguments {'strict': None} + "tests/unit_tests/chat_models/test_cloudflare_workersai.py" + ]; + passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex" diff --git a/pkgs/development/python-modules/langchain-core/default.nix b/pkgs/development/python-modules/langchain-core/default.nix index 411e0ed3b329..0903e6d2d509 100644 --- a/pkgs/development/python-modules/langchain-core/default.nix +++ b/pkgs/development/python-modules/langchain-core/default.nix @@ -28,21 +28,18 @@ pytest-xdist, pytestCheckHook, syrupy, - - # passthru - nix-update-script, }: buildPythonPackage rec { pname = "langchain-core"; - version = "0.3.47"; + version = "0.3.49"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; tag = "langchain-core==${version}"; - hash = "sha256-UUsT8RvBK4TJNrAwXjv/LPzHrgTEoSewUb+8pHG6Xa8="; + hash = "sha256-s1vZ7G6Wzywf3euwX/RdCPkgzxvZTYVG0udGpHTIiQc="; }; sourceRoot = "${src.name}/libs/core"; @@ -95,11 +92,9 @@ buildPythonPackage rec { doCheck = true; }); - updateScript = nix-update-script { - extraArgs = [ - "--version-regex" - "^langchain-core==([0-9.]+)$" - ]; + updateScript = { + command = [ ./update.sh ]; + supportedFeatures = [ "commit" ]; }; }; diff --git a/pkgs/development/python-modules/langchain-core/update.sh b/pkgs/development/python-modules/langchain-core/update.sh new file mode 100755 index 000000000000..5568df95e43b --- /dev/null +++ b/pkgs/development/python-modules/langchain-core/update.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p common-updater-scripts jq + +set -euo pipefail + +declare -ar packages=( + langchain + langchain-azure-dynamic-sessions + langchain-chroma + langchain-community + langchain-core + langchain-groq + langchain-huggingface + langchain-mongodb + langchain-ollama + langchain-openai + langchain-tests + langchain-text-splitters +) + +tags=$(git ls-remote --tags --refs "https://github.com/langchain-ai/langchain" | cut --delimiter=/ --field=3-) + +# Will be printed as JSON at the end to list what needs updating +updates="" + +for package in ${packages[@]} +do + pyPackage="python3Packages.$package" + oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion $pyPackage" | tr -d '"')" + newVersion=$(echo "$tags" | grep -Po "(?<=$package==)\d+\.\d+\.\d+$" | sort --version-sort --reverse | head -1 ) + if [[ "$newVersion" != "$oldVersion" ]]; then + update-source-version $pyPackage "$newVersion" + updates+="{ + \"attrPath\": \"$pyPackage\", + \"oldVersion\": \"$oldVersion\", + \"newVersion\": \"$newVersion\", + \"files\": [ + \"$PWD/pkgs/development/python-modules/${package}/default.nix\" + ] +}," + fi +done +# Remove trailing comma +updates=${updates%,} +# Print the updates in JSON format +echo "[ $updates ]" diff --git a/pkgs/development/python-modules/langchain-groq/default.nix b/pkgs/development/python-modules/langchain-groq/default.nix index 212791cd9fed..a54f98e1e28b 100644 --- a/pkgs/development/python-modules/langchain-groq/default.nix +++ b/pkgs/development/python-modules/langchain-groq/default.nix @@ -18,14 +18,14 @@ buildPythonPackage rec { pname = "langchain-groq"; - version = "0.3.1"; + version = "0.3.2"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; tag = "langchain-groq==${version}"; - hash = "sha256-kdqgX2fnagVL+W6dRJwnpngcJK2q4E4nk8r4+zIwPt4="; + hash = "sha256-KsKT7+jpTTiSVMZWcIwW7+1BCL7rpZHg/OX3PNLI6As="; }; sourceRoot = "${src.name}/libs/partners/groq"; diff --git a/pkgs/development/python-modules/langchain-ollama/default.nix b/pkgs/development/python-modules/langchain-ollama/default.nix index b3f6baf00161..149091e699c6 100644 --- a/pkgs/development/python-modules/langchain-ollama/default.nix +++ b/pkgs/development/python-modules/langchain-ollama/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, # build-system + pdm-backend, poetry-core, # dependencies @@ -21,19 +22,22 @@ buildPythonPackage rec { pname = "langchain-ollama"; - version = "0.2.3"; + version = "0.3.0"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; tag = "langchain-ollama==${version}"; - hash = "sha256-G7faykRlpfmafSnSe/CdPW87uCtofBp7mLzbxZgBBhM="; + hash = "sha256-KsQV2jM2rXbFg+ZlDnpw8sD3Nm8C37BWo+DkDTaMDtQ="; }; sourceRoot = "${src.name}/libs/partners/ollama"; - build-system = [ poetry-core ]; + build-system = [ + pdm-backend + poetry-core + ]; pythonRelaxDeps = [ # Each component release requests the exact latest core. diff --git a/pkgs/development/python-modules/langchain-openai/default.nix b/pkgs/development/python-modules/langchain-openai/default.nix index 8a44d9cb0c44..cdb4d9c64e3d 100644 --- a/pkgs/development/python-modules/langchain-openai/default.nix +++ b/pkgs/development/python-modules/langchain-openai/default.nix @@ -29,14 +29,14 @@ buildPythonPackage rec { pname = "langchain-openai"; - version = "0.3.8"; + version = "0.3.11"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; tag = "langchain-openai==${version}"; - hash = "sha256-ooqIUHel/tAI0jNI/j7OXD9ytAH3pXQ3QN5YMhFt2ac="; + hash = "sha256-yIYVRn9IHjxBSxnBOTayYrIxw8ZbAeuawu3gKk9gA0M="; }; sourceRoot = "${src.name}/libs/partners/openai"; diff --git a/pkgs/development/python-modules/langchain-tests/default.nix b/pkgs/development/python-modules/langchain-tests/default.nix index b4f9ee35cca7..77ef7dcac9f3 100644 --- a/pkgs/development/python-modules/langchain-tests/default.nix +++ b/pkgs/development/python-modules/langchain-tests/default.nix @@ -2,7 +2,6 @@ lib, buildPythonPackage, fetchFromGitHub, - nix-update-script, # build-system pdm-backend, @@ -24,14 +23,14 @@ buildPythonPackage rec { pname = "langchain-tests"; - version = "0.3.13"; + version = "0.3.17"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; tag = "langchain-tests==${version}"; - hash = "sha256-N209wUGdlHkOZynhSSE+ZHylL7cK+8H3PfZIG/wvMd0="; + hash = "sha256-jhdCpZsRvCxDIfaZpdqAdx+rxJTU6QHDgNKc4w7XmR8="; }; sourceRoot = "${src.name}/libs/standard-tests"; @@ -62,11 +61,8 @@ buildPythonPackage rec { pytestCheckHook ]; - passthru.updateScript = nix-update-script { - extraArgs = [ - "--version-regex" - "^langchain-tests==([0-9.]+)$" - ]; + passthru = { + inherit (langchain-core) updateScript; }; meta = { diff --git a/pkgs/development/python-modules/langchain-text-splitters/default.nix b/pkgs/development/python-modules/langchain-text-splitters/default.nix index 4bcfcf159414..e15c3e6e30a1 100644 --- a/pkgs/development/python-modules/langchain-text-splitters/default.nix +++ b/pkgs/development/python-modules/langchain-text-splitters/default.nix @@ -18,14 +18,14 @@ buildPythonPackage rec { pname = "langchain-text-splitters"; - version = "0.3.6"; + version = "0.3.7"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; tag = "langchain-text-splitters==${version}"; - hash = "sha256-mYaIVE/v+t7TJw/l87IJcFh893OTIew6jl6OVj0gXCo="; + hash = "sha256-tIX1nxmXU3xhJuM2Q3Tm4fbCoJwI0A8+G1aSyLcoNo0="; }; sourceRoot = "${src.name}/libs/text-splitters"; diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix index d9a8c52f5e07..92a4c7d67001 100644 --- a/pkgs/development/python-modules/langchain/default.nix +++ b/pkgs/development/python-modules/langchain/default.nix @@ -41,14 +41,14 @@ buildPythonPackage rec { pname = "langchain"; - version = "0.3.20"; + version = "0.3.21"; pyproject = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; tag = "langchain==${version}"; - hash = "sha256-N209wUGdlHkOZynhSSE+ZHylL7cK+8H3PfZIG/wvMd0="; + hash = "sha256-Up/pH2TxLPiPO49oIa2ZlNeH3TyN9sZSlNsqOIRmlxc="; }; sourceRoot = "${src.name}/libs/langchain";