mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-24 06:24:18 +02:00
Merge pull request #677 from jlowin/remove-deprecation
Remove deprecation notice
This commit is contained in:
commit
181c5d7b9d
2 changed files with 0 additions and 21 deletions
|
|
@ -131,16 +131,6 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
tools: list[Tool | Callable[..., Any]] | None = None,
|
||||
**settings: Any,
|
||||
):
|
||||
if settings:
|
||||
# TODO: remove settings. Deprecated since 2.3.4
|
||||
warnings.warn(
|
||||
"Passing runtime and transport-specific settings as kwargs "
|
||||
"to the FastMCP constructor is deprecated (as of 2.3.4), "
|
||||
"including most transport settings. If possible, provide settings when calling "
|
||||
"run() instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
self.settings = fastmcp.settings.ServerSettings(**settings)
|
||||
|
||||
# If mask_error_details is provided, override the settings value
|
||||
|
|
|
|||
|
|
@ -9,17 +9,6 @@ from starlette.applications import Starlette
|
|||
from fastmcp import Client, FastMCP
|
||||
|
||||
|
||||
def test_fastmcp_kwargs_settings_deprecation_warning():
|
||||
"""Test that passing settings as kwargs to FastMCP raises a deprecation warning."""
|
||||
with pytest.warns(
|
||||
DeprecationWarning,
|
||||
match="Passing runtime and transport-specific settings as kwargs to the FastMCP constructor is deprecated",
|
||||
):
|
||||
server = FastMCP("TestServer", host="127.0.0.2", port=8001)
|
||||
assert server.settings.host == "127.0.0.2"
|
||||
assert server.settings.port == 8001
|
||||
|
||||
|
||||
def test_sse_app_deprecation_warning():
|
||||
"""Test that sse_app raises a deprecation warning."""
|
||||
server = FastMCP("TestServer")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue