Commit c7fb45d
committed
[v1.x] Complete the FastMCP Settings model at import time
Settings.lifespan is annotated with FastMCP, which is defined further down
the module, so pydantic left the Settings model incomplete until the first
FastMCP() call rebuilt it. pydantic-settings 2.15 now emits
IncompleteFieldDefinitionWarning whenever a settings source inspects such a
field, which means a warning on every FastMCP() construction (and, with
warnings treated as errors, a failing test suite on the "highest"
dependency resolution).
Call Settings.model_rebuild() once FastMCP exists so the model is complete
before anything instantiates it.1 parent 98b7159 commit c7fb45d
2 files changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1087 | 1087 | | |
1088 | 1088 | | |
1089 | 1089 | | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1090 | 1095 | | |
1091 | 1096 | | |
1092 | 1097 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
0 commit comments