You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test.py:4: error: Incompatible types (expression has type "str", TypedDict item "env_file" has type "Path | list[Path] | tuple[Path, ...] | None") [typeddict-item]
Can be fixed by including str in the allowed type for env_file config.
The second error:
test.py:8: error: Missing named argument "test_field" for "TestSettings" [call-arg]
There was some logic related to setting management in V1 mypy plugin which has been removed because settings management is not part of Pydantic V2.
I think we can create a mypy plugin for pydantic-settings that inherit from Pydantic V2 mypy plugin and add specific logic for pydantic-settings.
It seems that mypy has some issues with the new BaseSettings.
I did the same tests with pydantic v1 and it did not throw these errors.
Using this example:
Mypy is throwing the following:
Here the Mypy configuration I am using:
pydantic
version: 2.0pydantic-core
version: 2.0.1pydantic-settings
version: 2.0mypy
version: 1.4.1Selected Assignee: @dmontagu
The text was updated successfully, but these errors were encountered: