mcp(chore[pytest]): Stop hiding our own deprecation warnings - #112
Open
tony wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #112 +/- ##
=======================================
Coverage 86.13% 86.13%
=======================================
Files 46 46
Lines 3593 3593
Branches 516 516
=======================================
Hits 3095 3095
Misses 354 354
Partials 144 144 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
why: filterwarnings ignored DeprecationWarning for libtmux.*, libtmux_mcp.*, and tests. A deprecation is attributed to the frame the raising library points stacklevel at -- the caller -- so those three patterns matched exactly the warnings that say this codebase must change, while unrelated third-party noise still surfaced. FastMCP's FastMCPDeprecationWarning subclasses DeprecationWarning, so its deprecations were caught by the same filters. SEP-2596 obliges Tier 1 SDKs to emit DeprecationWarning when a deprecated feature is exercised, and mcp 2.0.0, fastmcp v4, and spec revision 2026-07-28 are all imminent. Verified by A/B probe under the real config: a warning attributed to libtmux_mcp.server was suppressed while one from an unrelated module surfaced in the same run. what: - Drop the three blanket ignore::DeprecationWarning:<module>: entries, keeping the message-scoped docutils filter - Replace asyncio.iscoroutinefunction with inspect.iscoroutinefunction, the one live deprecation the mask was hiding (removal in Python 3.16) - Do not escalate DeprecationWarning to an error: this project pins two fast-moving pre-2.0 dependencies, and an upstream patch release should not be able to turn CI red on its own schedule
why: The change is developer-facing tooling, not shipped product surface, so it belongs under Development. what: - Add a Development entry covering the removed filters, the stacklevel reasoning, the one warning that was hidden, and why DeprecationWarning is not escalated to an error
tony
force-pushed
the
deprecation-warnings-visible
branch
from
July 25, 2026 19:48
43a2bec to
0f6d53e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #111.
filterwarningssilencedDeprecationWarningforlibtmux.*,libtmux_mcp.*, andtests. Those look like they filter dependency noise. They do the opposite.A deprecation is attributed to the frame the raising library points
stacklevelat, which by convention is the caller — so the warning that says "this line uses a deprecated API" is attributed tolibtmux_mcp.somethingor to the test body that exercised it. The three filters matched precisely those, while a warning from an unrelated package sailed through.FastMCPDeprecationWarningsubclassesDeprecationWarning, so FastMCP's own deprecations were caught too.Evidence
A/B probe under the repo's real config — two tests, one run, one warning emitted from each namespace:
libtmux_mcp.serversome_other_package.thingAnd the MRO, since it's what makes the category filters reach FastMCP:
What was hidden
Exactly one thing, and it is real. Removing the filters surfaced
asyncio.iscoroutinefunctionattests/test_wait_for_tools.py:57-58— "deprecated and slated for removal in Python 3.16; useinspect.iscoroutinefunction()instead". Fixed here.Nothing else warns. The suppression bought no quiet; it cost one signal, and that signal was a scheduled standard-library removal.
Why now
SEP-2596 obliges Tier 1 SDKs to emit a runtime
DeprecationWarningwhen a deprecated feature is exercised, once that feature enters the Deprecated state. Three things land imminently: spec revision2026-07-28(which deprecates Roots, Sampling, and Logging via SEP-2577),mcp2.0.0 targeted for the same date, andfastmcpv4 already in alpha against the<4.0.0ceiling here.There is real exposure waiting behind that: 13
.inputSchemareads across the history tests,mcp.typesimports inmiddleware.py(the submodule becomes a standalone package in 2.x), and_client_label()reading client identity off theinitializehandshake that2026-07-28removes. None of it can break today —fastmcp3.4.4 pinsmcp<2.0, so 2.x cannot resolve into this environment — but warnings are how that transition is meant to announce itself, and the suite was configured not to listen.What this does not do
It does not escalate
DeprecationWarningto an error. This project pins two fast-moving pre-2.0 dependencies; making warnings fatal hands upstream the ability to turn CI red on its own release schedule, with no local change. Visible-but-not-fatal restores the signal without that coupling. Worth revisiting oncemcp2.x andfastmcpv4 have settled.The message-scoped docutils filter is untouched — that one is correctly shaped, filtering a specific known message rather than a category across a module.
Verification
ruff check,ruff format --check,mypy(65 files),pytest --reruns 0(801 passed, 0 warnings),just build-docsclean.Independent of #110, which is also open — that one migrates
wait_for_textoff the deprecated MCP Logging capability. No overlapping files.