From 071b79e61d475447b2938d06817356274e32e402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 14 Jun 2026 02:25:42 +0200 Subject: [PATCH] python314Packages.fastmcp: 3.2.4 -> 3.3.1, python3Packages.fastmcp-slim: init at 3.3.1 Changelog: https://github.com/PrefectHQ/fastmcp/releases/tag/v3.3.0 Changelog: https://github.com/PrefectHQ/fastmcp/releases/tag/v3.3.1 --- .../python-modules/fastmcp-slim/default.nix | 132 ++++++++++++++ .../python-modules/fastmcp/default.nix | 162 ++++-------------- pkgs/top-level/python-packages.nix | 2 + 3 files changed, 166 insertions(+), 130 deletions(-) create mode 100644 pkgs/development/python-modules/fastmcp-slim/default.nix diff --git a/pkgs/development/python-modules/fastmcp-slim/default.nix b/pkgs/development/python-modules/fastmcp-slim/default.nix new file mode 100644 index 000000000000..6eb705b108ba --- /dev/null +++ b/pkgs/development/python-modules/fastmcp-slim/default.nix @@ -0,0 +1,132 @@ +{ + lib, + buildPythonPackage, + fastmcp, + + # build-system + hatchling, + uv-dynamic-versioning, + + # dependencies + anthropic, + authlib, + azure-identity, + cyclopts, + exceptiongroup, + google-genai, + griffelib, + httpx, + jsonref, + jsonschema-path, + mcp, + openai, + openapi-pydantic, + opentelemetry-api, + packaging, + platformdirs, + py-key-value-aio, + pydantic, + pydantic-monty, + pydantic-settings, + pydocket, + pyjwt, + pyperclip, + python-dotenv, + python-multipart, + pyyaml, + rich, + typing-extensions, + uncalled-for, + uvicorn, + watchfiles, + websockets, +}: + +buildPythonPackage (finalAttrs: { + pname = "fastmcp-slim"; + inherit (fastmcp) version src; + sourceRoot = "${finalAttrs.src.name}/fastmcp_slim"; + pyproject = true; + + build-system = [ + hatchling + uv-dynamic-versioning + ]; + + dependencies = [ + platformdirs + pydantic + pydantic-settings + python-dotenv + rich + typing-extensions + ] + ++ pydantic.optional-dependencies.email; + + optional-dependencies = { + anthropic = [ anthropic ]; + apps = [ + # unpackaged prefab-ui + ]; + azure = [ + azure-identity + pyjwt + ]; + client = [ + authlib + ] + ++ finalAttrs.passthru.optional-dependencies.mcp + ++ py-key-value-aio.optional-dependencies.filetree + ++ py-key-value-aio.optional-dependencies.keyring + ++ py-key-value-aio.optional-dependencies.memory; + code-mode = [ pydantic-monty ]; + gemini = [ + google-genai + jsonref + ]; + mcp = [ + exceptiongroup + httpx + mcp + opentelemetry-api + ]; + openai = [ openai ]; + server = [ + authlib + cyclopts + griffelib + jsonref + jsonschema-path + openapi-pydantic + packaging + py-key-value-aio + pyperclip + python-multipart + pyyaml + uncalled-for + uvicorn + watchfiles + websockets + ] + ++ finalAttrs.passthru.optional-dependencies.mcp + ++ py-key-value-aio.optional-dependencies.filetree + ++ py-key-value-aio.optional-dependencies.keyring + ++ py-key-value-aio.optional-dependencies.memory; + tasks = [ + pydocket + ]; + }; + + pythonImportsCheck = [ "fastmcp" ]; + + # tests are done in fastmcp package + doCheck = false; + + meta = { + description = "Dependency-slim FastMCP package"; + changelog = "https://github.com/jlowin/fastmcp/releases/tag/${finalAttrs.src.tag}"; + homepage = "https://github.com/PrefectHQ/fastmcp/tree/main/fastmcp_slim"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/development/python-modules/fastmcp/default.nix b/pkgs/development/python-modules/fastmcp/default.nix index 531d87fdfc38..3879e40bb830 100644 --- a/pkgs/development/python-modules/fastmcp/default.nix +++ b/pkgs/development/python-modules/fastmcp/default.nix @@ -10,54 +10,26 @@ uv-dynamic-versioning, # dependencies - anthropic, - authlib, - azure-identity, - cyclopts, - exceptiongroup, - griffelib, - httpx, - jsonref, - jsonschema-path, - mcp, - fakeredis, - google-genai, - openai, - openapi-pydantic, - opentelemetry-api, - packaging, - platformdirs, - py-key-value-aio, - pydantic, - pydantic-monty, - pydocket, - pyjwt, - pyperclip, - python-dotenv, - pyyaml, - rich, - uncalled-for, - uvicorn, - watchfiles, - websockets, + fastmcp-slim, # tests dirty-equals, - email-validator, fastapi, inline-snapshot, - lupa, opentelemetry-sdk, psutil, pytest-asyncio, pytest-examples, pytest-httpx, + pytest-rerunfailures, + pytest-timeout, + pytest-xdist, pytestCheckHook, }: buildPythonPackage (finalAttrs: { pname = "fastmcp"; - version = "3.2.4"; + version = "3.3.1"; pyproject = true; __structuredAttrs = true; @@ -65,7 +37,7 @@ buildPythonPackage (finalAttrs: { owner = "PrefectHQ"; repo = "fastmcp"; tag = "v${finalAttrs.version}"; - hash = "sha256-rJpxPvqAaa6/vXhG1+R9dI32cY/54e6I+F/zyBVoqBM="; + hash = "sha256-1W5NbWIULxFXGSozZEeITcPt1EbY6IsJLQdyevcn9BI="; }; build-system = [ @@ -73,121 +45,66 @@ buildPythonPackage (finalAttrs: { uv-dynamic-versioning ]; - pythonRelaxDeps = [ - "py-key-value-aio" - "pydocket" - ]; dependencies = [ - authlib - cyclopts - exceptiongroup - griffelib - httpx - jsonref - jsonschema-path - mcp - openapi-pydantic - opentelemetry-api - packaging - platformdirs - py-key-value-aio - pydantic - pyperclip - python-dotenv - pyyaml - rich - uncalled-for - uvicorn - watchfiles - websockets + fastmcp-slim ] - ++ py-key-value-aio.optional-dependencies.filetree - ++ py-key-value-aio.optional-dependencies.keyring - ++ py-key-value-aio.optional-dependencies.memory - ++ pydantic.optional-dependencies.email; + ++ fastmcp-slim.optional-dependencies.client + ++ fastmcp-slim.optional-dependencies.server; optional-dependencies = { - anthropic = [ anthropic ]; - azure = [ - azure-identity - pyjwt - ]; - code-mode = [ pydantic-monty ]; - gemini = [ google-genai ]; - openai = [ openai ]; - tasks = [ - pydocket - fakeredis - ] - ++ fakeredis.optional-dependencies.lua; + anthropic = fastmcp-slim.optional-dependencies.anthropic; + apps = fastmcp-slim.optional-dependencies.apps; + azure = fastmcp-slim.optional-dependencies.azure; + code-mode = fastmcp-slim.optional-dependencies.code-mode; + gemini = fastmcp-slim.optional-dependencies.gemini; + openai = fastmcp-slim.optional-dependencies.openai; + tasks = fastmcp-slim.optional-dependencies.tasks; }; pythonImportsCheck = [ "fastmcp" ]; nativeCheckInputs = [ dirty-equals - email-validator fastapi inline-snapshot - lupa opentelemetry-sdk psutil pytest-asyncio pytest-examples pytest-httpx + pytest-rerunfailures + pytest-timeout + pytest-xdist pytestCheckHook writableTmpDirAsHomeHook ] ++ finalAttrs.passthru.optional-dependencies.anthropic + ++ finalAttrs.passthru.optional-dependencies.apps ++ finalAttrs.passthru.optional-dependencies.azure ++ finalAttrs.passthru.optional-dependencies.code-mode ++ finalAttrs.passthru.optional-dependencies.gemini ++ finalAttrs.passthru.optional-dependencies.openai + ++ finalAttrs.passthru.optional-dependencies.tasks ++ inline-snapshot.optional-dependencies.dirty-equals; disabledTests = [ + # requires internet + "test_github_api_schema_performance" + # RuntimeError: Client failed to connect: Connection closed - "test_keep_alive_maintains_session_across_multiple_calls" - "test_keep_alive_false_starts_new_session_across_multiple_calls" - "test_keep_alive_false_exit_scope_kills_server" - "test_keep_alive_starts_new_session_if_manually_closed" - "test_keep_alive_true_exit_scope_kills_client" - "test_keep_alive_maintains_session_if_reentered" - "test_close_session_and_try_to_use_client_raises_error" - "test_parallel_calls" + "test_single_server_config_include_tags_filtering" "test_run_mcp_config" - "test_settings_from_environment_issue_1749" + + # requires uv "test_uv_transport" "test_uv_transport_module" - "test_github_api_schema_performance" # Hang forever "test_nested_streamable_http_server_resolves_correctly" - # RuntimeError: Client failed to connect: Timed out while waiting for response - "test_timeout" - "test_timeout_tool_call_overrides_client_timeout_even_if_lower" - # Requires prefab-ui (optional dependency) - "test_auto_registers_renderer_resource" - "test_auto_synthesizes_renderer_resource" - "test_equivalent_to_app_true" - - # Requires pydocket (tasks optional dependency, not in test inputs) - "test_mounted_server_does_not_have_docket" - "test_get_tasks_returns_task_eligible_tools" - "test_task_teardown_does_not_hang" - "test_background_task_can_read_snapshotted_request_headers" - "test_background_task_current_http_dependencies_restore_headers" - "test_task_execution_auto_populated_for_task_enabled_tool" - "test_function_tool_task_config_still_works" - "test_async_partial_with_task_true_does_not_raise" - "test_sync_partial_with_task_true_raises" - "test_is_docket_available" - "test_require_docket_passes_when_installed" - - # Shared dependency caching differs in sandbox - "TestSharedDependencies" + "TestPrefabAppConfig" + "test_doc_examples_quality" # AssertionError: assert 'INFO' == 'DEBUG' "test_temporary_settings" @@ -195,36 +112,21 @@ buildPythonPackage (finalAttrs: { # Subprocess-based multi-client tests fail in sandbox "test_multi_client" "test_multi_server" - "test_single_server_config_include_tags_filtering" "test_server_starts_without_auth" "test_canonical_multi_client_with_transforms" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # RuntimeError: Server failed to start after 10 attempts - "test_unauthorized_access" - "test_stateless_proxy" + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # floating point error + "test_index_retrieval[float32-quantization1-1-metric0-3]" ]; disabledTestPaths = [ # Requires prefab-ui (optional dependency) "tests/apps" - "tests/docs/test_doc_examples.py" "tests/test_apps_prefab.py" "tests/test_fastmcp_app.py" # Subprocess crash recovery tests are flaky in sandbox "tests/client/test_stdio.py" - # Requires pydocket/fakeredis (tasks optional dependency, not in test inputs) - "tests/server/tasks" - "tests/server/test_server_docket.py" - "tests/client/tasks" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # RuntimeError: Server failed to start after 10 attempts - "tests/client/auth/test_oauth_client.py" - "tests/client/test_sse.py" - "tests/client/test_streamable_http.py" - "tests/server/auth/test_jwt_provider.py" - "tests/server/http/test_http_dependencies.py" ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1eb593023500..c2522ca5f542 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5593,6 +5593,8 @@ self: super: with self; { fastmcp = callPackage ../development/python-modules/fastmcp { }; + fastmcp-slim = callPackage ../development/python-modules/fastmcp-slim { }; + fastmri = callPackage ../development/python-modules/fastmri { }; fastnlo-toolkit = toPythonModule (