diff --git a/pkgs/by-name/mc/mcp-proxy/package.nix b/pkgs/by-name/mc/mcp-proxy/package.nix index 7b66f756bfac..cea0fd0bd6fe 100644 --- a/pkgs/by-name/mc/mcp-proxy/package.nix +++ b/pkgs/by-name/mc/mcp-proxy/package.nix @@ -28,6 +28,18 @@ python3Packages.buildPythonApplication rec { pytest-asyncio ]; + disabledTests = [ + # AssertionError: expected call not found. + # Expected: mock(PromptReference(type='ref/prompt', name='name'), CompletionArgument(name='name', value='value')) + # Actual: mock(PromptReference(type='ref/prompt', name='name'), CompletionArgument(name='name', value='value'), None) + "test_call_tool[server-AsyncMock]" + "test_call_tool[proxy-AsyncMock]" + "test_complete[server-AsyncMock]" + "test_complete[proxy-AsyncMock]" + ]; + + __darwinAllowLocalNetworking = true; + meta = { description = "MCP server which proxies other MCP servers from stdio to SSE or from SSE to stdio"; homepage = "https://github.com/sparfenyuk/mcp-proxy"; diff --git a/pkgs/by-name/ot/oterm/package.nix b/pkgs/by-name/ot/oterm/package.nix index 60575cd030e0..ff09474e8a53 100644 --- a/pkgs/by-name/ot/oterm/package.nix +++ b/pkgs/by-name/ot/oterm/package.nix @@ -29,6 +29,7 @@ python3Packages.buildPythonApplication rec { "pydantic" "textual" "typer" + "fastmcp" ]; build-system = with python3Packages; [ hatchling ]; diff --git a/pkgs/development/python-modules/fastapi-mcp/default.nix b/pkgs/development/python-modules/fastapi-mcp/default.nix index 2d6e76197162..0767727a927b 100644 --- a/pkgs/development/python-modules/fastapi-mcp/default.nix +++ b/pkgs/development/python-modules/fastapi-mcp/default.nix @@ -27,14 +27,14 @@ buildPythonPackage rec { pname = "fastapi-mcp"; - version = "0.3.4"; + version = "0.3.7"; pyproject = true; src = fetchFromGitHub { owner = "tadata-org"; repo = "fastapi_mcp"; tag = "v${version}"; - hash = "sha256-t6p/jXQjbhUmIlwoqszRj3GGSrLS0Gcoh1BtizNaw8o="; + hash = "sha256-WQ+Y/TM5fz0lHjCKvEuYGY6hzxo2ePcgRnq7piNC+KQ="; }; build-system = [ @@ -64,6 +64,11 @@ buildPythonPackage rec { pytestCheckHook ]; + disabledTestPaths = [ + # Flaky, would try to allocate a port on Darwin + "tests/test_sse_real_transport.py" + ]; + __darwinAllowLocalNetworking = true; meta = { diff --git a/pkgs/development/python-modules/fastmcp/default.nix b/pkgs/development/python-modules/fastmcp/default.nix index 8f3da4a17d58..c87ef6e3e938 100644 --- a/pkgs/development/python-modules/fastmcp/default.nix +++ b/pkgs/development/python-modules/fastmcp/default.nix @@ -10,31 +10,35 @@ # dependencies authlib, + cyclopts, exceptiongroup, httpx, mcp, openapi-pydantic, + pydantic, + pyperclip, python-dotenv, rich, - typer, # tests dirty-equals, + email-validator, fastapi, + pytest-asyncio, pytest-httpx, pytestCheckHook, }: buildPythonPackage rec { pname = "fastmcp"; - version = "2.8.0"; + version = "2.10.6"; pyproject = true; src = fetchFromGitHub { owner = "jlowin"; repo = "fastmcp"; tag = "v${version}"; - hash = "sha256-FleJkqdUIhGsV+DVYv/Nf5IORntH/aFq9abKn2r/6Is="; + hash = "sha256-Wxugk2ocuur710WZLG7xph2R/n02Y9BvH7Lf4BuEMYs="; }; postPatch = '' @@ -49,28 +53,51 @@ buildPythonPackage rec { dependencies = [ authlib + cyclopts exceptiongroup httpx mcp openapi-pydantic + pyperclip python-dotenv rich - typer ]; pythonImportsCheck = [ "fastmcp" ]; nativeCheckInputs = [ dirty-equals + email-validator fastapi + pydantic + pytest-asyncio pytest-httpx pytestCheckHook writableTmpDirAsHomeHook - ]; + ] + ++ pydantic.optional-dependencies.email; disabledTests = [ # AssertionError: assert 'INFO' == 'DEBUG' "test_temporary_settings" + + # RuntimeError: Client failed to connect: Connection close + "test_keep_alive_maintains_session_across_multiple_calls" + "test_keep_alive_false_starts_new_session_across_multiple_calls" + "test_keep_alive_starts_new_session_if_manually_closed" + "test_keep_alive_maintains_session_if_reentered" + "test_close_session_and_try_to_use_client_raises_error" + + # RuntimeError: Client failed to connect: Timed out while waiting for response + "test_timeout" + "test_timeout_tool_call_overrides_client_timeout_even_if_lower" + + # assert 0 == 2 + "test_multi_client" + + # fastmcp.exceptions.ToolError: Unknown tool + "test_multi_client_with_logging" + "test_multi_client_with_elicitation" ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ diff --git a/pkgs/development/python-modules/gradio/default.nix b/pkgs/development/python-modules/gradio/default.nix index faafbae3e653..02fcfec7ce3e 100644 --- a/pkgs/development/python-modules/gradio/default.nix +++ b/pkgs/development/python-modules/gradio/default.nix @@ -75,20 +75,20 @@ buildPythonPackage rec { pname = "gradio"; - version = "5.38.0"; + version = "5.38.2"; pyproject = true; src = fetchFromGitHub { owner = "gradio-app"; repo = "gradio"; tag = "gradio@${version}"; - hash = "sha256-NbVRbwqHUSwyG+v+cDKCrVtzjj6ThxGRfO+xjqXOy5I="; + hash = "sha256-zKAH/tbF1S+LIi1i+BuKBUWDSI0+Ii5FhsZ3sQaFtto="; }; pnpmDeps = pnpm_9.fetchDeps { inherit pname version src; fetcherVersion = 1; - hash = "sha256-E6dBajJoKzaJF67KRrSB/LNAyLDmT78mCmTar5G6P6g="; + hash = "sha256-sIEsolHffX3cpAJU79w+ndRY4vvmWLxp2efTryv+j38="; }; pythonRelaxDeps = [ diff --git a/pkgs/development/python-modules/mcp/default.nix b/pkgs/development/python-modules/mcp/default.nix index 5ad4d0b7b956..82e3584482c8 100644 --- a/pkgs/development/python-modules/mcp/default.nix +++ b/pkgs/development/python-modules/mcp/default.nix @@ -11,6 +11,7 @@ anyio, httpx, httpx-sse, + jsonschema, pydantic, pydantic-settings, python-multipart, @@ -28,6 +29,7 @@ websockets, # tests + dirty-equals, inline-snapshot, pytest-asyncio, pytest-examples, @@ -38,20 +40,31 @@ buildPythonPackage rec { pname = "mcp"; - version = "1.9.4"; + version = "1.12.2"; pyproject = true; src = fetchFromGitHub { owner = "modelcontextprotocol"; repo = "python-sdk"; tag = "v${version}"; - hash = "sha256-VXbu/wHbXGS+cISJVUgCVEpTmZc0VfckNRoMj3GDi/A="; + hash = "sha256-K3S+2Z4yuo8eAOo8gDhrI8OOfV6ADH4dAb1h8PqYntc="; }; postPatch = '' substituteInPlace pyproject.toml \ --replace-fail ', "uv-dynamic-versioning"' "" \ --replace-fail 'dynamic = ["version"]' 'version = "${version}"' + '' + + lib.optionalString stdenv.buildPlatform.isDarwin '' + # time.sleep(0.1) feels a bit optimistic and it has been flaky whilst + # testing this on macOS under load. + substituteInPlace \ + "tests/client/test_stdio.py" \ + "tests/server/fastmcp/test_integration.py" \ + "tests/shared/test_ws.py" \ + "tests/shared/test_sse.py" \ + "tests/shared/test_streamable_http.py" \ + --replace-fail "time.sleep(0.1)" "time.sleep(1)" ''; build-system = [ hatchling ]; @@ -64,6 +77,7 @@ buildPythonPackage rec { anyio httpx httpx-sse + jsonschema pydantic pydantic-settings python-multipart @@ -88,6 +102,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "mcp" ]; nativeCheckInputs = [ + dirty-equals inline-snapshot pytest-asyncio pytest-examples @@ -97,29 +112,45 @@ buildPythonPackage rec { ] ++ lib.flatten (lib.attrValues optional-dependencies); - pytestFlags = [ - "-Wignore::pydantic.warnings.PydanticDeprecatedSince211" - ]; - disabledTests = [ # attempts to run the package manager uv "test_command_execution" - # performance-dependent test + # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) + "test_lifespan_cleanup_executed" + + # AssertionError: Child process should be writing + "test_basic_child_process_cleanup" + + # AssertionError: parent process should be writing + "test_nested_process_tree" + + # AssertionError: Child should be writing + "test_early_parent_exit" + + # pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO ... + "test_list_tools_returns_all_tools" + + # AssertionError: Server startup marker not created + "test_stdin_close_triggers_cleanup" + + # pytest.PytestUnraisableExceptionWarning: Exception ignored in: =1.76.0" "openai" - ''; - build-system = [ hatchling ]; @@ -47,8 +41,6 @@ buildPythonPackage rec { "agents" ]; - passthru.updateScript = nix-update-script { }; - meta = { changelog = "https://github.com/openai/openai-agents-python/releases/tag/${version}"; homepage = "https://github.com/openai/openai-agents-python"; diff --git a/pkgs/development/python-modules/smolagents/default.nix b/pkgs/development/python-modules/smolagents/default.nix index 1a1d4f3e90e2..ad177f998e12 100644 --- a/pkgs/development/python-modules/smolagents/default.nix +++ b/pkgs/development/python-modules/smolagents/default.nix @@ -141,6 +141,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "smolagents" ]; + disabledTestPaths = [ + # ImportError: cannot import name 'require_soundfile' from 'transformers.testing_utils' + "tests/test_types.py" + ]; + disabledTests = [ # Missing dependencies "test_cleanup" diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 07f5c52d45f7..6d91fdd0b4ae 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -147,6 +147,10 @@ let tag = "v${version}"; hash = "sha256-Z2NN6k4mD6NixDON1MUOELpBZW9JvMvFErcCbFPdg2o="; }; + pytestFlagsArray = [ + "-W" + "ignore::pydantic.warnings.PydanticDeprecatedSince211" + ]; }); notifications-android-tv = super.notifications-android-tv.overridePythonAttrs (oldAttrs: rec {