Spaces:
Running
Running
Jeremiah Lowin commited on
Commit ·
92415e9
1
Parent(s): ea8c89c
Update deprecation message
Browse files- src/fastmcp/server/server.py +2 -2
- tests/test_deprecated.py +1 -1
src/fastmcp/server/server.py
CHANGED
|
@@ -119,9 +119,9 @@ class FastMCP(Generic[LifespanResultT]):
|
|
| 119 |
if settings:
|
| 120 |
# TODO: remove settings. Deprecated since 2.3.4
|
| 121 |
warnings.warn(
|
| 122 |
-
"Passing transport-specific
|
| 123 |
"to the FastMCP constructor is deprecated (as of 2.3.4), "
|
| 124 |
-
"including most transport settings.
|
| 125 |
"run() instead.",
|
| 126 |
DeprecationWarning,
|
| 127 |
stacklevel=2,
|
|
|
|
| 119 |
if settings:
|
| 120 |
# TODO: remove settings. Deprecated since 2.3.4
|
| 121 |
warnings.warn(
|
| 122 |
+
"Passing runtime and transport-specific settings as kwargs "
|
| 123 |
"to the FastMCP constructor is deprecated (as of 2.3.4), "
|
| 124 |
+
"including most transport settings. If possible, provide settings when calling "
|
| 125 |
"run() instead.",
|
| 126 |
DeprecationWarning,
|
| 127 |
stacklevel=2,
|
tests/test_deprecated.py
CHANGED
|
@@ -13,7 +13,7 @@ def test_fastmcp_kwargs_settings_deprecation_warning():
|
|
| 13 |
"""Test that passing settings as kwargs to FastMCP raises a deprecation warning."""
|
| 14 |
with pytest.warns(
|
| 15 |
DeprecationWarning,
|
| 16 |
-
match="Passing settings as kwargs to the FastMCP constructor is deprecated",
|
| 17 |
):
|
| 18 |
server = FastMCP("TestServer", host="127.0.0.2", port=8001)
|
| 19 |
assert server.settings.host == "127.0.0.2"
|
|
|
|
| 13 |
"""Test that passing settings as kwargs to FastMCP raises a deprecation warning."""
|
| 14 |
with pytest.warns(
|
| 15 |
DeprecationWarning,
|
| 16 |
+
match="Passing runtime and transport-specific settings as kwargs to the FastMCP constructor is deprecated",
|
| 17 |
):
|
| 18 |
server = FastMCP("TestServer", host="127.0.0.2", port=8001)
|
| 19 |
assert server.settings.host == "127.0.0.2"
|