diff --git a/pkgs/development/python-modules/langchain-ollama/default.nix b/pkgs/development/python-modules/langchain-ollama/default.nix index 1614d8f7bd8c..104796cce3ea 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,36 +15,33 @@ langchain-tests, pytestCheckHook, pytest-asyncio, + pytest-socket, syrupy, # passthru 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 ]; - pythonRelaxDeps = [ - # Each component release requests the exact latest core. - # That prevents us from updating individual components. - "langchain-core" - ]; - dependencies = [ langchain-core ollama @@ -53,11 +51,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 = { @@ -69,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 ]; }; -} +})