From 7cd9b1612d99bd791991a900fcd4e10798b599d7 Mon Sep 17 00:00:00 2001 From: Amadej Kastelic Date: Wed, 13 Aug 2025 18:14:01 +0200 Subject: [PATCH] mcp-nixos: 1.0.0 -> 1.0.1 https://github.com/utensils/mcp-nixos/releases/tag/v1.0.1 --- pkgs/by-name/mc/mcp-nixos/package.nix | 15 +++++++++------ .../mc/mcp-nixos/tests-mock-nix-channels.patch | 13 +++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/mc/mcp-nixos/package.nix b/pkgs/by-name/mc/mcp-nixos/package.nix index bc44ee41e5be..5263ca5546b6 100644 --- a/pkgs/by-name/mc/mcp-nixos/package.nix +++ b/pkgs/by-name/mc/mcp-nixos/package.nix @@ -6,14 +6,14 @@ python3Packages.buildPythonApplication rec { pname = "mcp-nixos"; - version = "1.0.0"; + version = "1.0.1"; pyproject = true; src = fetchFromGitHub { owner = "utensils"; repo = "mcp-nixos"; tag = "v${version}"; - hash = "sha256-NwP+zM1VGLOzIm+mLZVK9/9ImFwuiWhRJ9QK3hGpQsY="; + hash = "sha256-NFy38FrU4N+bk4qGyRnrpf2AaBrlQyC9SyRbCLm/d9Y="; }; patches = [ @@ -25,10 +25,13 @@ python3Packages.buildPythonApplication rec { dependencies = with python3Packages; [ beautifulsoup4 + fastmcp mcp requests ]; + pythonRelaxDeps = [ "fastmcp" ]; + nativeCheckInputs = with python3Packages; [ anthropic pytestCheckHook @@ -43,11 +46,11 @@ python3Packages.buildPythonApplication rec { disabledTestPaths = [ # Require network access - "tests/test_nixhub_evals.py" - "tests/test_mcp_behavior_evals.py" - "tests/test_option_info_improvements.py" + "tests/test_nixhub.py" + "tests/test_mcp_behavior.py" + "tests/test_options.py" # Requires configured channels - "tests/test_dynamic_channels.py" + "tests/test_channels.py" ]; pythonImportsCheck = [ "mcp_nixos" ]; diff --git a/pkgs/by-name/mc/mcp-nixos/tests-mock-nix-channels.patch b/pkgs/by-name/mc/mcp-nixos/tests-mock-nix-channels.patch index b7fc92841ab8..0aca953007cf 100644 --- a/pkgs/by-name/mc/mcp-nixos/tests-mock-nix-channels.patch +++ b/pkgs/by-name/mc/mcp-nixos/tests-mock-nix-channels.patch @@ -1,11 +1,12 @@ diff --git a/tests/conftest.py b/tests/conftest.py -index 0a11295..1172182 100644 +index baae124..2b4bf01 100644 --- a/tests/conftest.py +++ b/tests/conftest.py -@@ -3,6 +3,30 @@ - import pytest # pylint: disable=unused-import +@@ -1,6 +1,27 @@ + """Minimal test configuration for refactored MCP-NixOS.""" ++import pytest +@pytest.fixture(autouse=True) +def mock_get_channels(monkeypatch): + """Mock get_channels function to return fixed channels for all tests.""" @@ -23,11 +24,7 @@ index 0a11295..1172182 100644 + monkeypatch.setattr('mcp_nixos.server.get_channels', mock_channels) + + # Also patch any imported references in test modules -+ monkeypatch.setattr('tests.test_channel_handling.get_channels', mock_channels) -+ monkeypatch.setattr('tests.test_dynamic_channels.get_channels', mock_channels, raising=False) -+ monkeypatch.setattr('tests.test_mcp_behavior_comprehensive.get_channels', mock_channels, raising=False) -+ monkeypatch.setattr('tests.test_real_world_scenarios.get_channels', mock_channels, raising=False) -+ monkeypatch.setattr('tests.test_server_comprehensive.get_channels', mock_channels, raising=False) ++ monkeypatch.setattr('tests.test_server.get_channels', mock_channels) + + def pytest_addoption(parser):