From 6702699abd89d1ba5139dd9c0af44cb0607f1eb1 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 9 Jun 2026 14:40:39 -0700 Subject: [PATCH 1/3] python3Packages.langchain-ollama: update check inputs --- .../python-modules/langchain-ollama/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/python-modules/langchain-ollama/default.nix b/pkgs/development/python-modules/langchain-ollama/default.nix index 1614d8f7bd8c..7e2601530d6b 100644 --- a/pkgs/development/python-modules/langchain-ollama/default.nix +++ b/pkgs/development/python-modules/langchain-ollama/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchFromGitHub, + stdenv, # build-system hatchling, @@ -14,6 +15,7 @@ langchain-tests, pytestCheckHook, pytest-asyncio, + pytest-socket, syrupy, # passthru @@ -53,11 +55,17 @@ buildPythonPackage rec { langchain-tests pytestCheckHook pytest-asyncio + pytest-socket syrupy ]; enabledTestPaths = [ "tests/unit_tests" ]; + disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ + # Darwin prevents the expected shell from spawning to run this + "test_standard_params_model_override" + ]; + pythonImportsCheck = [ "langchain_ollama" ]; passthru = { From 1bafba24a4a79c75b40508f7caad590c229c3fa3 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 9 Jun 2026 14:49:53 -0700 Subject: [PATCH 2/3] python3Packages.langchain-ollama: remove dependency relaxation on langchain-core --- .../development/python-modules/langchain-ollama/default.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/development/python-modules/langchain-ollama/default.nix b/pkgs/development/python-modules/langchain-ollama/default.nix index 7e2601530d6b..0096928c62ea 100644 --- a/pkgs/development/python-modules/langchain-ollama/default.nix +++ b/pkgs/development/python-modules/langchain-ollama/default.nix @@ -40,12 +40,6 @@ buildPythonPackage rec { hatchling ]; - pythonRelaxDeps = [ - # Each component release requests the exact latest core. - # That prevents us from updating individual components. - "langchain-core" - ]; - dependencies = [ langchain-core ollama From 1edf3900ab51e800026c66b975a32cd970c0a605 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 9 Jun 2026 14:52:12 -0700 Subject: [PATCH 3/3] python3Packages.langchain-ollama: migrate to finalAttrs, structuredAttrs, and strictDeps --- .../python-modules/langchain-ollama/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/langchain-ollama/default.nix b/pkgs/development/python-modules/langchain-ollama/default.nix index 0096928c62ea..104796cce3ea 100644 --- a/pkgs/development/python-modules/langchain-ollama/default.nix +++ b/pkgs/development/python-modules/langchain-ollama/default.nix @@ -22,19 +22,21 @@ gitUpdater, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "langchain-ollama"; version = "1.1.0"; pyproject = true; + __structuredAttrs = true; + strictDeps = true; src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; - tag = "langchain-ollama==${version}"; + tag = "langchain-ollama==${finalAttrs.version}"; hash = "sha256-4MbrfHf/ElBFR9cXIx+spQB+xsw2aj94IBJ5hcB6SJ0="; }; - sourceRoot = "${src.name}/libs/partners/ollama"; + sourceRoot = "${finalAttrs.src.name}/libs/partners/ollama"; build-system = [ hatchling @@ -71,10 +73,10 @@ buildPythonPackage rec { }; meta = { - changelog = "https://github.com/langchain-ai/langchain/releases/tag/${src.tag}"; + changelog = "https://github.com/langchain-ai/langchain/releases/tag/${finalAttrs.src.tag}"; description = "Integration package connecting Ollama and LangChain"; homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/partners/ollama"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ sarahec ]; }; -} +})