python3Packages.mcp: 1.9.4 -> 1.12.2, and fix dependent packages build failures (#428733)
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -29,6 +29,7 @@ python3Packages.buildPythonApplication rec {
|
||||
"pydantic"
|
||||
"textual"
|
||||
"typer"
|
||||
"fastmcp"
|
||||
];
|
||||
|
||||
build-system = with python3Packages; [ hatchling ];
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 [
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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: <function St..
|
||||
"test_resource_template_client_interaction"
|
||||
|
||||
# Flaky: https://github.com/modelcontextprotocol/python-sdk/pull/1171
|
||||
"test_notification_validation_error"
|
||||
|
||||
# Flaky: httpx.ConnectError: All connection attempts failed
|
||||
"test_sse_security_"
|
||||
"test_streamable_http_"
|
||||
|
||||
# This just feels a bit optimistic...
|
||||
# assert duration < 3 * _sleep_time_seconds
|
||||
# AssertionError: assert 0.0733884589999434 < (3 * 0.01)
|
||||
"test_messages_are_executed_concurrently"
|
||||
|
||||
# ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
|
||||
"test_client_session_version_negotiation_failure"
|
||||
|
||||
# AttributeError: 'coroutine' object has no attribute 'client_metadata'
|
||||
"TestOAuthClientProvider"
|
||||
|
||||
# inline_snapshot._exceptions.UsageError: snapshot value should not change. Use Is(...) for dynamic snapshot parts
|
||||
"test_build_metadata"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
# Flaky: ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
|
||||
"test_notification_validation_error"
|
||||
"test_tool_progress"
|
||||
];
|
||||
|
||||
__darwinAllowLocalNetworking = true;
|
||||
@@ -129,6 +160,9 @@ buildPythonPackage rec {
|
||||
description = "Official Python SDK for Model Context Protocol servers and clients";
|
||||
homepage = "https://github.com/modelcontextprotocol/python-sdk";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ josh ];
|
||||
maintainers = with lib.maintainers; [
|
||||
bryanhonof
|
||||
josh
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
lib,
|
||||
nix-update-script,
|
||||
buildPythonPackage,
|
||||
fetchPypi,
|
||||
hatchling,
|
||||
@@ -15,20 +14,15 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "openai-agents";
|
||||
version = "0.0.13";
|
||||
version = "0.2.3";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
pname = "openai_agents";
|
||||
hash = "sha256-a4AxXnXAa1MCxfKtui+eo4RflGFdrtRwa/uHF0D1YaU=";
|
||||
hash = "sha256-ldStGUxcDPGkADjLcB7ujs2q92mNh7sT48LFz/gMS00=";
|
||||
};
|
||||
|
||||
# OpenAI 1.76.0 seems to not build currently
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml --replace-fail "openai>=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";
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user