Unverified Commit 85460312 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

python3Packages.langchain*: bulk update (#394752)

parents 015f3c9b 0f4299f5
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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"
+5 −10
Original line number Diff line number Diff line
@@ -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" ];
    };
  };

+46 −0
Original line number Diff line number Diff line
#!/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 ]"
+2 −2
Original line number Diff line number Diff line
@@ -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";
+7 −3
Original line number Diff line number Diff line
@@ -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.
Loading