satisfy pyright untyped decorators in mcp.server.fastmcp.server#181
Conversation
.gitignore
Outdated
There was a problem hiding this comment.
omit artifacts from vscode-based editors
There was a problem hiding this comment.
Terribel. Feel free to keep it. I dont use vscode myself but i am sure plenty people do.
pyright complaining about untyped decorators in mcp.server.fastmcp.server.pypyright untyped decorators in mcp.server.fastmcp.server.py
pyright untyped decorators in mcp.server.fastmcp.server.pypyright untyped decorators in mcp.server.fastmcp.server
dsp-ant
left a comment
There was a problem hiding this comment.
Thank you. This is great! Throwing this back into you queue for two pieces:
- Shall we rename
_Functionto something that is exported? - How can we check in CI/pre-commit that we won't break this?
src/mcp/server/fastmcp/server.py
Outdated
There was a problem hiding this comment.
Any reason to use the _. I wonder if a caller wants to somehow wrap add_tool and type it, they might want to reuse the type?
05bad54 to
a7a69e9
Compare
|
@dsp-ant - I've updated the PR to move/rename as for the question of catching typing regressions in CI, are you suggesting something in addition to the Not sure what'd be preferable to you, but happy to take a shot at it (here or follow up PR) if one of them sounds attractive! |
a7a69e9 to
ca06001
Compare
Is there abenefit over mypy? I guess the current checks should be sufficient right? |
|
Thank you! Much appreciated! The more type safety the better! |
I think so! perhaps someday a pyright config file in a the root of the repo could more specifically config that existing thanks for the review! |
Motivation and Context
using a
.vscode/settings.jsonlike this{ "python.analysis.typeCheckingMode": "strict" }the following example throws squiggles on
mainHow Has This Been Tested?
observing a marked lack of squiggles on this branch
Breaking Changes
no
Types of changes
Checklist
Additional context
i purposefully wasn't so prescriptive with
_Function, happy to be more specific if neededif you're wondering how I got here: PrefectHQ/marvin#1042