-
Notifications
You must be signed in to change notification settings - Fork 192
fix: fix mcp types + add py.typed #2248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
integrations/mcp/pyproject.toml
Outdated
"mcp.*", | ||
"mcp", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid adding mcp
to ignore_missing_imports
?
Otherwise, we'd end up not verifying MCP types at all
integrations/mcp/pyproject.toml
Outdated
[[tool.mypy.overrides]] | ||
# MCP package types | ||
module = [ | ||
"httpx", | ||
"exceptiongroup", | ||
"anyio.*", | ||
] | ||
ignore_missing_imports = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried removing this block altogether?
If possible, it would be the best thing to do. But sometimes, libraries do not provide valid types, so it's not always doable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
Related Issues
Proposed Changes:
hatch run test:types
and fix type errors(this means testing with all dependencies installed, differently from
hatch run lint:typing
that did not install dependencies)hatch run test:types
in the test workflowhatch run lint:typing
haystack_integrations
integrations/mcp/src/haystack_integrations/tools/mcp/py.typed
How did you test it?
CI
Notes for the reviewer
This PR can be seen as a complete example of the work we need to do for each integration to fix #1771.
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.