Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions pkgs/development/python-modules/langchain-aws/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,

# build-system
poetry-core,
Expand Down Expand Up @@ -52,6 +53,9 @@ buildPythonPackage rec {
pythonRelaxDeps = [
# Boto @ 1.35 has outstripped the version requirement
"boto3"
# Each component release requests the exact latest core.
# That prevents us from updating individul components.
"langchain-core"
];

nativeCheckInputs = [
Expand All @@ -64,10 +68,11 @@ 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.]+)$"
];
};

meta = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,

# build-system
poetry-core,
Expand Down Expand Up @@ -41,6 +42,12 @@ buildPythonPackage rec {

build-system = [ poetry-core ];

pythonRelaxDeps = [
# Each component release requests the exact latest core.
# That prevents us from updating individul components.
"langchain-core"
];

dependencies = [
azure-identity
langchain-core
Expand All @@ -65,10 +72,11 @@ 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.]+)$"
];
};

meta = {
Expand Down
17 changes: 12 additions & 5 deletions pkgs/development/python-modules/langchain-chroma/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,
chromadb,
langchain-core,
langchain-tests,
Expand Down Expand Up @@ -29,7 +30,12 @@ buildPythonPackage rec {

build-system = [ pdm-backend ];

pythonRelaxDeps = [ "numpy" ];
pythonRelaxDeps = [
# Each component release requests the exact latest core.
# That prevents us from updating individul components.
"langchain-core"
"numpy"
];

dependencies = [
chromadb
Expand All @@ -50,10 +56,11 @@ 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.]+)$"
];
};

meta = {
Expand Down
19 changes: 12 additions & 7 deletions pkgs/development/python-modules/langchain-community/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,

# build-system
pdm-backend,
Expand Down Expand Up @@ -56,7 +57,10 @@ buildPythonPackage rec {
];

pythonRelaxDeps = [
"langchain" # Can fail during updates where building sees the old langchain
# Each component release requests the exact latest langchain and -core.
# That prevents us from updating individul components.
"langchain"
"langchain-core"
"numpy"
"pydantic-settings"
"tenacity"
Expand Down Expand Up @@ -98,12 +102,6 @@ buildPythonPackage rec {

pytestFlagsArray = [ "tests/unit_tests" ];

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

__darwinAllowLocalNetworking = true;

disabledTests = [
Expand All @@ -124,6 +122,13 @@ buildPythonPackage rec {
"test_group_dependencies"
];

passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"^langchain-community==(.*)"
];
};

meta = {
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-community==${version}";
description = "Community contributed LangChain integrations";
Expand Down
31 changes: 8 additions & 23 deletions pkgs/development/python-modules/langchain-core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
syrupy,

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

buildPythonPackage rec {
Expand Down Expand Up @@ -94,28 +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
'';
# updates the wrong fetcher rev attribute
skipBulkUpdate = true;

updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"^langchain-core==([0-9.]+)$"
];
};
};

disabledTests =
Expand Down
15 changes: 11 additions & 4 deletions pkgs/development/python-modules/langchain-groq/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,

# build-system
pdm-backend,
Expand Down Expand Up @@ -31,7 +32,11 @@ buildPythonPackage rec {

build-system = [ pdm-backend ];

pythonRelaxDeps = [ "langchain-core" ];
pythonRelaxDeps = [
# Each component release requests the exact latest core.
# That prevents us from updating individul components.
"langchain-core"
];

dependencies = [
langchain-core
Expand All @@ -47,9 +52,11 @@ buildPythonPackage rec {

pythonImportsCheck = [ "langchain_groq" ];

passthru = {
inherit (langchain-core) updateScript;
skipBulkUpdate = true; # Broken, see https://github.com/NixOS/nixpkgs/issues/379898
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"^langchain-groq==([0-9.]+)$"
];
};

meta = {
Expand Down
16 changes: 12 additions & 4 deletions pkgs/development/python-modules/langchain-huggingface/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,

# build-system
poetry-core,
Expand Down Expand Up @@ -44,6 +45,12 @@ buildPythonPackage rec {

build-system = [ poetry-core ];

pythonRelaxDeps = [
# Each component release requests the exact latest core.
# That prevents us from updating individul components.
"langchain-core"
];

dependencies = [
huggingface-hub
langchain-core
Expand Down Expand Up @@ -71,10 +78,11 @@ buildPythonPackage rec {

pythonImportsCheck = [ "langchain_huggingface" ];

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

meta = {
Expand Down
13 changes: 9 additions & 4 deletions pkgs/development/python-modules/langchain-mongodb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,

# build-system
poetry-core,
Expand Down Expand Up @@ -37,6 +38,9 @@ buildPythonPackage rec {
build-system = [ poetry-core ];

pythonRelaxDeps = [
# Each component release requests the exact latest core.
# That prevents us from updating individul components.
"langchain-core"
"numpy"
];

Expand All @@ -60,10 +64,11 @@ buildPythonPackage rec {

pythonImportsCheck = [ "langchain_mongodb" ];

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

meta = {
Expand Down
8 changes: 6 additions & 2 deletions pkgs/development/python-modules/langchain-ollama/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ buildPythonPackage rec {

build-system = [ poetry-core ];

pythonRelaxDeps = [
# Each component release requests the exact latest core.
# That prevents us from updating individul components.
"langchain-core"
];

dependencies = [
langchain-core
ollama
Expand All @@ -57,8 +63,6 @@ buildPythonPackage rec {
"langchain-ollama==(.*)"
];
};
# updates the wrong fetcher rev attribute
passthru.skipBulkUpdate = true;

meta = {
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-ollama==${version}";
Expand Down
16 changes: 12 additions & 4 deletions pkgs/development/python-modules/langchain-openai/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,

# build-system
pdm-backend,
Expand Down Expand Up @@ -47,6 +48,12 @@ buildPythonPackage rec {

build-system = [ pdm-backend ];

pythonRelaxDeps = [
# Each component release requests the exact latest core.
# That prevents us from updating individul components.
"langchain-core"
];

dependencies = [
langchain-core
openai
Expand Down Expand Up @@ -89,10 +96,11 @@ buildPythonPackage rec {

pythonImportsCheck = [ "langchain_openai" ];

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

meta = {
Expand Down
Loading