| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…rning This was the last call site emitting the built-in `DeprecationWarning`, which Python hides by default so users never saw it. Every other deprecation in the SDK uses `@deprecated(..., category=MCPDeprecationWarning)` so it is visible without `-W` and flagged statically by pyright. Bring this provider in line, and update the two tests that asserted the old category.
Revert the @deprecated decorator approach; the minimal change is to swap the warning category so it is visible by default, leaving the existing warnings.warn call and tests otherwise untouched.
There was a problem hiding this comment.
LGTM — small, mechanical change switching the deprecation warning category to MCPDeprecationWarning, matching the SDK-wide pattern, with the affected tests updated accordingly.
Extended reasoning...The PR changes a single warnings.warn call in RFC7523OAuthClientProvider.__init__ from the built-in DeprecationWarning to MCPDeprecationWarning, plus the import. The two tests that interact with this warning (the fixture filter in tests/client/auth/extensions/test_client_credentials.py and the pytest.warns assertion in tests/docs_src/test_oauth_clients.py) are updated to the new category. The warning message, stacklevel, and all surrounding logic are untouched.
None. Although the file lives under client/auth, the change does not modify any authentication, token-exchange, or JWT logic — only the warning category emitted on construction of an already-deprecated provider.
Low. MCPDeprecationWarning already exists in mcp.shared.exceptions, is exported from mcp/__init__.py, and is the established category used for every other deprecation in the SDK (client/server sessions, peer, context, etc.), so this brings the one outlier in line with convention. The repo's pytest filterwarnings = ["error", ...] config is unaffected because the only two test sites that construct the deprecated provider were updated to the new category in the same PR.
The bug-hunting system found no issues, the diff is 6 lines of substantive change across 3 files, and existing test coverage directly exercises the new warning category via pytest.warns.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
RFC7523OAuthClientProvider.__init__ emitted the built-in DeprecationWarning, which Python hides by default so users never saw it. This switches the category to MCPDeprecationWarning (a UserWarning subclass) so it shows up without -W, matching how the rest of the SDK surfaces deprecations.
The warnings.warn call is otherwise unchanged. The two tests that asserted the old category are updated to MCPDeprecationWarning.
AI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.