Change8

v2.12.0

Breaking Changes
📦 pydantic-settingsView on GitHub →
1 breaking7 features🔧 4 symbols

Summary

pydantic-settings 2.12 introduces enum kebab‑case support, a new NestedSecretsSettings source, updated source ordering, and adds Python 3.14 support while dropping Python 3.9.

⚠️ Breaking Changes

  • Python 3.9 support has been removed. Projects must upgrade to Python 3.10 or newer.

Migration Steps

  1. If you relied on implicit default values, update your settings to define explicit defaults.
  2. Review any code that depends on the order of settings sources; the new order is init > env > dotenv > secrets > defaults.
  3. When using strict mode, ensure environment variable values are compatible with the expected types.

✨ New Features

  • Enum values can now be provided in kebab-case.
  • Source order is now applied as init > env > dotenv > secrets > defaults.
  • Added NestedSecretsSettings source for nested secret handling.
  • Non-explicit default values are stripped from the settings state.
  • Environment variables are coerced when strict mode is enabled.
  • Init keyword argument names are restored before returning the final state dictionary.
  • Added support for Python 3.14.

🔧 Affected Symbols

NestedSecretsSettingsBaseSettingsSettingsSourceEnum