python3Packages.mcp: 1.9.4 -> 1.12.2, and fix dependent packages build failures (#428733)

authored by Gaétan Lepage and committed by GitHub 3f3dc789 a18142f9

+118 -38
+12
pkgs/by-name/mc/mcp-proxy/package.nix
··· 28 28 pytest-asyncio 29 29 ]; 30 30 31 + disabledTests = [ 32 + # AssertionError: expected call not found. 33 + # Expected: mock(PromptReference(type='ref/prompt', name='name'), CompletionArgument(name='name', value='value')) 34 + # Actual: mock(PromptReference(type='ref/prompt', name='name'), CompletionArgument(name='name', value='value'), None) 35 + "test_call_tool[server-AsyncMock]" 36 + "test_call_tool[proxy-AsyncMock]" 37 + "test_complete[server-AsyncMock]" 38 + "test_complete[proxy-AsyncMock]" 39 + ]; 40 + 41 + __darwinAllowLocalNetworking = true; 42 + 31 43 meta = { 32 44 description = "MCP server which proxies other MCP servers from stdio to SSE or from SSE to stdio"; 33 45 homepage = "https://github.com/sparfenyuk/mcp-proxy";
+1
pkgs/by-name/ot/oterm/package.nix
··· 29 29 "pydantic" 30 30 "textual" 31 31 "typer" 32 + "fastmcp" 32 33 ]; 33 34 34 35 build-system = with python3Packages; [ hatchling ];
+7 -2
pkgs/development/python-modules/fastapi-mcp/default.nix
··· 27 27 28 28 buildPythonPackage rec { 29 29 pname = "fastapi-mcp"; 30 - version = "0.3.4"; 30 + version = "0.3.7"; 31 31 pyproject = true; 32 32 33 33 src = fetchFromGitHub { 34 34 owner = "tadata-org"; 35 35 repo = "fastapi_mcp"; 36 36 tag = "v${version}"; 37 - hash = "sha256-t6p/jXQjbhUmIlwoqszRj3GGSrLS0Gcoh1BtizNaw8o="; 37 + hash = "sha256-WQ+Y/TM5fz0lHjCKvEuYGY6hzxo2ePcgRnq7piNC+KQ="; 38 38 }; 39 39 40 40 build-system = [ ··· 62 62 pytest-asyncio 63 63 pytest-cov-stub 64 64 pytestCheckHook 65 + ]; 66 + 67 + disabledTestPaths = [ 68 + # Flaky, would try to allocate a port on Darwin 69 + "tests/test_sse_real_transport.py" 65 70 ]; 66 71 67 72 __darwinAllowLocalNetworking = true;
+32 -5
pkgs/development/python-modules/fastmcp/default.nix
··· 10 10 11 11 # dependencies 12 12 authlib, 13 + cyclopts, 13 14 exceptiongroup, 14 15 httpx, 15 16 mcp, 16 17 openapi-pydantic, 18 + pydantic, 19 + pyperclip, 17 20 python-dotenv, 18 21 rich, 19 - typer, 20 22 21 23 # tests 22 24 dirty-equals, 25 + email-validator, 23 26 fastapi, 27 + pytest-asyncio, 24 28 pytest-httpx, 25 29 pytestCheckHook, 26 30 }: 27 31 28 32 buildPythonPackage rec { 29 33 pname = "fastmcp"; 30 - version = "2.8.0"; 34 + version = "2.10.6"; 31 35 pyproject = true; 32 36 33 37 src = fetchFromGitHub { 34 38 owner = "jlowin"; 35 39 repo = "fastmcp"; 36 40 tag = "v${version}"; 37 - hash = "sha256-FleJkqdUIhGsV+DVYv/Nf5IORntH/aFq9abKn2r/6Is="; 41 + hash = "sha256-Wxugk2ocuur710WZLG7xph2R/n02Y9BvH7Lf4BuEMYs="; 38 42 }; 39 43 40 44 postPatch = '' ··· 49 53 50 54 dependencies = [ 51 55 authlib 56 + cyclopts 52 57 exceptiongroup 53 58 httpx 54 59 mcp 55 60 openapi-pydantic 61 + pyperclip 56 62 python-dotenv 57 63 rich 58 - typer 59 64 ]; 60 65 61 66 pythonImportsCheck = [ "fastmcp" ]; 62 67 63 68 nativeCheckInputs = [ 64 69 dirty-equals 70 + email-validator 65 71 fastapi 72 + pydantic 73 + pytest-asyncio 66 74 pytest-httpx 67 75 pytestCheckHook 68 76 writableTmpDirAsHomeHook 69 - ]; 77 + ] 78 + ++ pydantic.optional-dependencies.email; 70 79 71 80 disabledTests = [ 72 81 # AssertionError: assert 'INFO' == 'DEBUG' 73 82 "test_temporary_settings" 83 + 84 + # RuntimeError: Client failed to connect: Connection close 85 + "test_keep_alive_maintains_session_across_multiple_calls" 86 + "test_keep_alive_false_starts_new_session_across_multiple_calls" 87 + "test_keep_alive_starts_new_session_if_manually_closed" 88 + "test_keep_alive_maintains_session_if_reentered" 89 + "test_close_session_and_try_to_use_client_raises_error" 90 + 91 + # RuntimeError: Client failed to connect: Timed out while waiting for response 92 + "test_timeout" 93 + "test_timeout_tool_call_overrides_client_timeout_even_if_lower" 94 + 95 + # assert 0 == 2 96 + "test_multi_client" 97 + 98 + # fastmcp.exceptions.ToolError: Unknown tool 99 + "test_multi_client_with_logging" 100 + "test_multi_client_with_elicitation" 74 101 ]; 75 102 76 103 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
+3 -3
pkgs/development/python-modules/gradio/default.nix
··· 75 75 76 76 buildPythonPackage rec { 77 77 pname = "gradio"; 78 - version = "5.38.0"; 78 + version = "5.38.2"; 79 79 pyproject = true; 80 80 81 81 src = fetchFromGitHub { 82 82 owner = "gradio-app"; 83 83 repo = "gradio"; 84 84 tag = "gradio@${version}"; 85 - hash = "sha256-NbVRbwqHUSwyG+v+cDKCrVtzjj6ThxGRfO+xjqXOy5I="; 85 + hash = "sha256-zKAH/tbF1S+LIi1i+BuKBUWDSI0+Ii5FhsZ3sQaFtto="; 86 86 }; 87 87 88 88 pnpmDeps = pnpm_9.fetchDeps { 89 89 inherit pname version src; 90 90 fetcherVersion = 1; 91 - hash = "sha256-E6dBajJoKzaJF67KRrSB/LNAyLDmT78mCmTar5G6P6g="; 91 + hash = "sha256-sIEsolHffX3cpAJU79w+ndRY4vvmWLxp2efTryv+j38="; 92 92 }; 93 93 94 94 pythonRelaxDeps = [
+52 -18
pkgs/development/python-modules/mcp/default.nix
··· 11 11 anyio, 12 12 httpx, 13 13 httpx-sse, 14 + jsonschema, 14 15 pydantic, 15 16 pydantic-settings, 16 17 python-multipart, ··· 28 29 websockets, 29 30 30 31 # tests 32 + dirty-equals, 31 33 inline-snapshot, 32 34 pytest-asyncio, 33 35 pytest-examples, ··· 38 40 39 41 buildPythonPackage rec { 40 42 pname = "mcp"; 41 - version = "1.9.4"; 43 + version = "1.12.2"; 42 44 pyproject = true; 43 45 44 46 src = fetchFromGitHub { 45 47 owner = "modelcontextprotocol"; 46 48 repo = "python-sdk"; 47 49 tag = "v${version}"; 48 - hash = "sha256-VXbu/wHbXGS+cISJVUgCVEpTmZc0VfckNRoMj3GDi/A="; 50 + hash = "sha256-K3S+2Z4yuo8eAOo8gDhrI8OOfV6ADH4dAb1h8PqYntc="; 49 51 }; 50 52 51 53 postPatch = '' 52 54 substituteInPlace pyproject.toml \ 53 55 --replace-fail ', "uv-dynamic-versioning"' "" \ 54 56 --replace-fail 'dynamic = ["version"]' 'version = "${version}"' 57 + '' 58 + + lib.optionalString stdenv.buildPlatform.isDarwin '' 59 + # time.sleep(0.1) feels a bit optimistic and it has been flaky whilst 60 + # testing this on macOS under load. 61 + substituteInPlace \ 62 + "tests/client/test_stdio.py" \ 63 + "tests/server/fastmcp/test_integration.py" \ 64 + "tests/shared/test_ws.py" \ 65 + "tests/shared/test_sse.py" \ 66 + "tests/shared/test_streamable_http.py" \ 67 + --replace-fail "time.sleep(0.1)" "time.sleep(1)" 55 68 ''; 56 69 57 70 build-system = [ hatchling ]; ··· 64 77 anyio 65 78 httpx 66 79 httpx-sse 80 + jsonschema 67 81 pydantic 68 82 pydantic-settings 69 83 python-multipart ··· 88 102 pythonImportsCheck = [ "mcp" ]; 89 103 90 104 nativeCheckInputs = [ 105 + dirty-equals 91 106 inline-snapshot 92 107 pytest-asyncio 93 108 pytest-examples ··· 96 111 requests 97 112 ] 98 113 ++ lib.flatten (lib.attrValues optional-dependencies); 99 - 100 - pytestFlags = [ 101 - "-Wignore::pydantic.warnings.PydanticDeprecatedSince211" 102 - ]; 103 114 104 115 disabledTests = [ 105 116 # attempts to run the package manager uv 106 117 "test_command_execution" 107 118 108 - # performance-dependent test 109 - "test_messages_are_executed_concurrently" 110 - 111 119 # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) 112 - "test_client_session_version_negotiation_failure" 120 + "test_lifespan_cleanup_executed" 113 121 114 - # AttributeError: 'coroutine' object has no attribute 'client_metadata' 115 - "TestOAuthClientProvider" 122 + # AssertionError: Child process should be writing 123 + "test_basic_child_process_cleanup" 116 124 117 - # inline_snapshot._exceptions.UsageError: snapshot value should not change. Use Is(...) for dynamic snapshot parts 118 - "test_build_metadata" 119 - ] 120 - ++ lib.optionals stdenv.hostPlatform.isDarwin [ 121 - # Flaky: ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) 125 + # AssertionError: parent process should be writing 126 + "test_nested_process_tree" 127 + 128 + # AssertionError: Child should be writing 129 + "test_early_parent_exit" 130 + 131 + # pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO ... 132 + "test_list_tools_returns_all_tools" 133 + 134 + # AssertionError: Server startup marker not created 135 + "test_stdin_close_triggers_cleanup" 136 + 137 + # pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function St.. 138 + "test_resource_template_client_interaction" 139 + 140 + # Flaky: https://github.com/modelcontextprotocol/python-sdk/pull/1171 122 141 "test_notification_validation_error" 142 + 143 + # Flaky: httpx.ConnectError: All connection attempts failed 144 + "test_sse_security_" 145 + "test_streamable_http_" 146 + 147 + # This just feels a bit optimistic... 148 + # assert duration < 3 * _sleep_time_seconds 149 + # AssertionError: assert 0.0733884589999434 < (3 * 0.01) 150 + "test_messages_are_executed_concurrently" 151 + 152 + # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) 153 + "test_tool_progress" 123 154 ]; 124 155 125 156 __darwinAllowLocalNetworking = true; ··· 129 160 description = "Official Python SDK for Model Context Protocol servers and clients"; 130 161 homepage = "https://github.com/modelcontextprotocol/python-sdk"; 131 162 license = lib.licenses.mit; 132 - maintainers = with lib.maintainers; [ josh ]; 163 + maintainers = with lib.maintainers; [ 164 + bryanhonof 165 + josh 166 + ]; 133 167 }; 134 168 }
+2 -10
pkgs/development/python-modules/openai-agents/default.nix
··· 1 1 { 2 2 lib, 3 - nix-update-script, 4 3 buildPythonPackage, 5 4 fetchPypi, 6 5 hatchling, ··· 15 14 16 15 buildPythonPackage rec { 17 16 pname = "openai-agents"; 18 - version = "0.0.13"; 17 + version = "0.2.3"; 19 18 pyproject = true; 20 19 21 20 src = fetchPypi { 22 21 inherit version; 23 22 pname = "openai_agents"; 24 - hash = "sha256-a4AxXnXAa1MCxfKtui+eo4RflGFdrtRwa/uHF0D1YaU="; 23 + hash = "sha256-ldStGUxcDPGkADjLcB7ujs2q92mNh7sT48LFz/gMS00="; 25 24 }; 26 25 27 - # OpenAI 1.76.0 seems to not build currently 28 - postPatch = '' 29 - substituteInPlace pyproject.toml --replace-fail "openai>=1.76.0" "openai" 30 - ''; 31 - 32 26 build-system = [ 33 27 hatchling 34 28 ]; ··· 46 40 pythonImportsCheck = [ 47 41 "agents" 48 42 ]; 49 - 50 - passthru.updateScript = nix-update-script { }; 51 43 52 44 meta = { 53 45 changelog = "https://github.com/openai/openai-agents-python/releases/tag/${version}";
+5
pkgs/development/python-modules/smolagents/default.nix
··· 141 141 142 142 pythonImportsCheck = [ "smolagents" ]; 143 143 144 + disabledTestPaths = [ 145 + # ImportError: cannot import name 'require_soundfile' from 'transformers.testing_utils' 146 + "tests/test_types.py" 147 + ]; 148 + 144 149 disabledTests = [ 145 150 # Missing dependencies 146 151 "test_cleanup"
+4
pkgs/servers/home-assistant/default.nix
··· 147 147 tag = "v${version}"; 148 148 hash = "sha256-Z2NN6k4mD6NixDON1MUOELpBZW9JvMvFErcCbFPdg2o="; 149 149 }; 150 + pytestFlagsArray = [ 151 + "-W" 152 + "ignore::pydantic.warnings.PydanticDeprecatedSince211" 153 + ]; 150 154 }); 151 155 152 156 notifications-android-tv = super.notifications-android-tv.overridePythonAttrs (oldAttrs: rec {