mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-27 04:20:09 +00:00
- Update quality-gate.yml to only lint hanzo_mcp and tests directories
- Add ruff config to pyproject.toml:
- Exclude vscode-extension and node_modules
- Ignore lint rules that conflict with test patterns:
B023 (loop variable binding), B904 (raise from),
E741 (ambiguous vars), F401/F821/F841 (unused/undefined in tests)
- Apply per-file ignores for tests/ and __init__.py
- Apply ruff fixes for import sorting and format
31 lines
813 B
Python
31 lines
813 B
Python
"""Context handling fix for MCP tools.
|
|
|
|
This module provides backward compatibility by re-exporting the
|
|
context normalization utilities from the decorators module.
|
|
|
|
DEPRECATED: Use hanzo_mcp.tools.common.decorators directly.
|
|
"""
|
|
|
|
# Re-export for backward compatibility
|
|
from hanzo_mcp.tools.common.decorators import (
|
|
MockContext,
|
|
with_context_normalization,
|
|
)
|
|
from hanzo_mcp.tools.common.decorators import (
|
|
_is_valid_context as is_valid_context,
|
|
)
|
|
|
|
|
|
# Backward compatibility function
|
|
def normalize_context(ctx):
|
|
"""Normalize context - backward compatibility wrapper.
|
|
|
|
DEPRECATED: Use decorators.with_context_normalization instead.
|
|
"""
|
|
if is_valid_context(ctx):
|
|
return ctx
|
|
return MockContext()
|
|
|
|
|
|
__all__ = ["MockContext", "normalize_context", "with_context_normalization"]
|