Change8

v2.15.0

📦 pydantic-settingsView on GitHub →
6 features🐛 12 fixes🔧 9 symbols

Summary

This release introduces several new features, including support for TOML table headers, improved CLI help text, and enhanced debugging capabilities. It also includes numerous bug fixes for environment variable loading, secret management, and configuration parsing.

Migration Steps

  1. Update documentation link for Pydantic settings.
  2. Clarify environment variable helper descriptions.
  3. Move SecretsManagerClient type import under TYPE_CHECKING.
  4. Skip partial update merging for discriminated union fields.
  5. Don't complain about missing table headers in a TOML file that isn't there.
  6. Address issues in toml table header implementation.
  7. Prevent NestedSecretsSettingsSource from following symlinks outside secrets_dir.
  8. Add 'Part of the Pydantic Stack' footer to README.
  9. Add explicit callout for the case where the unprefixed value is in dotenv.
  10. Fix typos in docs and source comments.
  11. Recommend async settings loading pattern.

✨ New Features

  • Support using a table header as root when reading a TOML file.
  • Add support for showing environment variable names in CLI help text.
  • Support case_sensitive in InitSettingsSource and config file sources.
  • Support Traversable for json/toml/yaml config file sources.
  • Add PYDANTIC_SETTINGS_DEBUG for debugging settings sources.
  • Add debug logging for env_file and secret file resolution.

🐛 Bug Fixes

  • Skip list_secrets call when case_sensitive=True.
  • GoogleSecretManagerSettingsSource: read project_id from previous sources.
  • Fix loading env vars on Windows with case_sensitive=True.
  • Fix AliasPath on nested model fields not decoding env values.
  • Warn when using fields not fully resolved at instantiation.
  • Apply case-insensitive field matching to optional nested models.
  • Parse enum names through nested annotations.
  • Fix dotenv extras being claimed by complex fields sharing a name prefix.
  • Coerce empty yaml_config_section to an empty mapping instead of crashing.
  • Read secret files as UTF-8 instead of the locale encoding.
  • Treat Secret subclasses as non-complex fields.
  • Raise ValidationError for non-JSON env values on strict fields.

Affected Symbols