Commit 0808d2bb authored by Sarah Clark's avatar Sarah Clark
Browse files

python3Packages.langchain*: define version regex in update script

parent 882b04f6
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  nix-update-script,

  # build-system
  poetry-core,
@@ -64,11 +65,14 @@ buildPythonPackage rec {

  pythonImportsCheck = [ "langchain_aws" ];

  passthru = {
    inherit (langchain-core) updateScript;
    # updates the wrong fetcher rev attribute
    skipBulkUpdate = true;
  passthru.updateScript = nix-update-script {
    extraArgs = [
      "--version-regex"
      "^langchain-aws==([0-9.]+)$"
    ];
  };
  # updates the wrong fetcher rev attribute
  passthru.skipBulkUpdate = true;

  meta = {
    changelog = "https://github.com/langchain-ai/langchain-aws/releases/tag/v${version}";
+8 −4
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  nix-update-script,

  # build-system
  poetry-core,
@@ -65,11 +66,14 @@ buildPythonPackage rec {

  pythonImportsCheck = [ "langchain_azure_dynamic_sessions" ];

  passthru = {
    inherit (langchain-core) updateScript;
    # updates the wrong fetcher rev attribute
    skipBulkUpdate = true;
  passthru.updateScript = nix-update-script {
    extraArgs = [
      "--version-regex"
      "^langchain-azure-dynamic-sessions==([0-9.]+)$"
    ];
  };
  # updates the wrong fetcher rev attribute
  passthru.skipBulkUpdate = true;

  meta = {
    description = "Integration package connecting Azure Container Apps dynamic sessions and LangChain";
+8 −4
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  nix-update-script,
  chromadb,
  langchain-core,
  langchain-tests,
@@ -50,11 +51,14 @@ buildPythonPackage rec {
    "test_chroma_update_document"
  ];

  passthru = {
    inherit (langchain-core) updateScript;
    # updates the wrong fetcher rev attribute
    skipBulkUpdate = true;
  passthru.updateScript = nix-update-script {
    extraArgs = [
      "--version-regex"
      "^langchain-chroma==([0-9.]+)$"
    ];
  };
  # updates the wrong fetcher rev attribute
  passthru.skipBulkUpdate = true;

  meta = {
    changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-chroma==${version}";
+10 −6
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  nix-update-script,

  # build-system
  pdm-backend,
@@ -98,12 +99,6 @@ buildPythonPackage rec {

  pytestFlagsArray = [ "tests/unit_tests" ];

  passthru = {
    inherit (langchain-core) updateScript;
    # updates the wrong fetcher rev attribute
    skipBulkUpdate = true;
  };

  __darwinAllowLocalNetworking = true;

  disabledTests = [
@@ -124,6 +119,15 @@ buildPythonPackage rec {
    "test_group_dependencies"
  ];

  passthru.updateScript = nix-update-script {
    extraArgs = [
      "--version-regex"
      "^langchain-community==([0-9.]+)$"
    ];
  };
  # updates the wrong fetcher rev attribute
  passthru.skipBulkUpdate = true;

  meta = {
    changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-community==${version}";
    description = "Community contributed LangChain integrations";
+8 −21
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
  syrupy,

  # passthru
  writeScript,
  nix-update-script,
}:

buildPythonPackage rec {
@@ -94,26 +94,13 @@ buildPythonPackage rec {
    tests.pytest = langchain-core.overridePythonAttrs (_: {
      doCheck = true;
    });
    # Updates to core tend to drive updates in everything else
    updateScript = writeScript "update.sh" ''
      #!/usr/bin/env nix-shell
      #!nix-shell -i bash -p nix-update

      set -u -o pipefail +e
      # Common core
      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

      # Extensions
      nix-update --commit --version-regex 'langchain-aws==(.*)' python3Packages.langchain-aws
      nix-update --commit --version-regex 'langchain-azure-dynamic-sessions==(.*)' python3Packages.langchain-azure-dynamic-sessions
      nix-update --commit --version-regex 'langchain-chroma==(.*)' python3Packages.langchain-chroma
      nix-update --commit --version-regex 'langchain-huggingface==(.*)' python3Packages.langchain-huggingface
      nix-update --commit --version-regex 'langchain-mongodb==(.*)' python3Packages.langchain-mongodb
      nix-update --commit --version-regex 'langchain-openai==(.*)' python3Packages.langchain-openai
    '';

    updateScript = nix-update-script {
      extraArgs = [
        "--version-regex"
        "^langchain-core==([0-9.]+)$"
      ];
    };
    # updates the wrong fetcher rev attribute
    skipBulkUpdate = true;
  };
Loading