pydantic / pydantic-settings

Settings management using pydantic
https://docs.pydantic.dev/latest/usage/pydantic_settings/
MIT License
508 stars 50 forks source link

TomlConfigSettingsSource is nowhere to be found #257

Closed pynchia closed 4 months ago

pynchia commented 4 months ago

Initial Checks

Description

I am following this tutorial https://docs.pydantic.dev/latest/concepts/pydantic_settings/#customise-settings-sources

and there is no way I can import TomlConfigSettingsSource from pydantic_settings. Are you sure it's there at all? I have updated my deps to the latest version (pydantic v2.6.4 and pydantic-settings v2.1.0)

Example Code

No response

Python, Pydantic & OS Version

pydantic version: 2.6.4
        pydantic-core version: 2.16.3
          pydantic-core build: profile=release pgo=true
                 install path: /home/mbb/prj/0-mine/fastapi_prj/.venv/lib/python3.11/site-packages/pydantic
               python version: 3.11.3 (main, May  1 2023, 19:58:35) [GCC 12.2.0]
                     platform: Linux-6.2.0-39-generic-x86_64-with-glibc2.37
             related packages: email-validator-2.1.0.post1 pydantic-extra-types-2.1.0 fastapi-0.110.0 typing_extensions-4.10.0 pydantic-settings-2.1.0
                       commit: unknown
hramezani commented 4 months ago

You need to install pydantic-settings==2.2.1 or update the current version. The TomlConfigSettingsSource has been introduced in 2.2.1.

You can take a look at the docs