Skip to content

Conversation

Kludex
Copy link
Member

@Kludex Kludex commented Aug 9, 2025

Took me my morning, but I got it.

This PR doesn't have any change on the package itself (src/mcp).

Note

See #1254 (comment), as
I had to bump pydantic to 2.11, and that may not be wanted? The package is broken for FastMCP with proper
generic usage on early versions of pydantic tho.

@Kludex Kludex requested review from a team as code owners August 9, 2025 10:57
@Kludex Kludex requested review from pcarleton, ochafik and Copilot August 9, 2025 10:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables pyright strict mode across the entire project by adding comprehensive type annotations and fixing type-related issues. The changes improve type safety and developer experience while maintaining backward compatibility.

  • Enhanced type safety with strict pyright configuration and proper type annotations
  • Fixed import formatting by consolidating multi-line imports into single lines
  • Added comprehensive type hints for function parameters, return values, and variables across test files, examples, and server implementations

Reviewed Changes

Copilot reviewed 74 out of 74 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pyproject.toml Enabled strict type checking with execution environments for different project areas
tests/ Added type annotations for variables, function parameters, and return types
examples/ Updated server and client examples with proper type hints and Context typing
scripts/ Fixed type annotations for regex match objects
src/mcp/shared/memory.py Consolidated imports and maintained existing functionality

@@ -40,7 +40,7 @@ select = ["E", "F", "I"]
ignore = []

[tool.ruff]
line-length = 88
line-length = 120
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those changes were made to match the main line-length. I did it in this PR because when I changed one of the files in the examples, it trigger the formatting.

@Kludex
Copy link
Member Author

Kludex commented Aug 9, 2025

It seems we do need to bump pydantic to 2.11.0, otherwise weird errors happen. There was a discussion about it here: #1041 (even if the PR didn't really bump pydantic in the package itself).

@Kludex Kludex requested a review from dsp-ant August 9, 2025 12:03
@dsp-ant dsp-ant merged commit c7671e4 into main Aug 11, 2025
22 of 23 checks passed
@dsp-ant dsp-ant deleted the strict-mode-on-tests branch August 11, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants