Skip to content

Commit 87326d6

Browse files
committed
1 parent 197e264 commit 87326d6

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

pyproject.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,16 @@ extend-exclude = ["README.md"]
125125

126126
[tool.ruff.lint]
127127
select = [
128-
"C4", # flake8-comprehensions
129-
"C90", # mccabe
130-
"D212", # pydocstyle: multi-line docstring summary should start at the first line
131-
"E", # pycodestyle
132-
"F", # pyflakes
133-
"I", # isort
134-
"PERF", # Perflint
135-
"PL", # Pylint
136-
"UP", # pyupgrade
128+
"C4", # flake8-comprehensions
129+
"C90", # mccabe
130+
"D212", # pydocstyle: multi-line docstring summary should start at the first line
131+
"E", # pycodestyle
132+
"F", # pyflakes
133+
"I", # isort
134+
"PERF", # Perflint
135+
"PL", # Pylint
136+
"UP", # pyupgrade
137+
"TID251", # https://docs.astral.sh/ruff/rules/banned-api/
137138
]
138139
ignore = ["PERF203", "PLC0415", "PLR0402"]
139140

src/mcp/server/auth/handlers/authorize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
from dataclasses import dataclass
33
from typing import Any, Literal
44

5-
from pydantic import AnyUrl, BaseModel, Field, RootModel, ValidationError
5+
# TODO(Marcelo): We should drop the `RootModel`.
6+
from pydantic import AnyUrl, BaseModel, Field, RootModel, ValidationError # noqa: TID251
67
from starlette.datastructures import FormData, QueryParams
78
from starlette.requests import Request
89
from starlette.responses import RedirectResponse, Response

src/mcp/server/fastmcp/utilities/func_metadata.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from typing import Annotated, Any, cast, get_args, get_origin, get_type_hints
77

88
import pydantic_core
9-
from pydantic import BaseModel, ConfigDict, Field, RootModel, WithJsonSchema, create_model
9+
from pydantic import BaseModel, ConfigDict, Field, WithJsonSchema, create_model
1010
from pydantic.fields import FieldInfo
1111
from pydantic.json_schema import GenerateJsonSchema, JsonSchemaWarningKind
1212
from typing_extensions import is_typeddict
@@ -477,6 +477,8 @@ def _create_wrapped_model(func_name: str, annotation: Any) -> type[BaseModel]:
477477

478478
def _create_dict_model(func_name: str, dict_annotation: Any) -> type[BaseModel]:
479479
"""Create a RootModel for dict[str, T] types."""
480+
# TODO(Marcelo): We should not rely on RootModel for this.
481+
from pydantic import RootModel # noqa: TID251
480482

481483
class DictModel(RootModel[dict_annotation]):
482484
pass

0 commit comments

Comments
 (0)