Migrating to Pydantic Settings v2.9.0
Version v2.9.0 introduces 2 breaking changes. This guide details how to update your code.
Released: 4/18/2025
2
Breaking Changes
4
Migration Steps
5
Affected Symbols
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
pydantic_settings.sourcespydantic_settings.aws_secrets_managerpydantic_settings.gcp_secret_managerpydantic_settings.azure_key_vaultpydantic_settings.cliBreaking Changes
●Issue #1
Dropped support for Python 3.8; upgrade your runtime to Python 3.9 or newer.
●Issue #2
Refactored `sources.py` into a `sources` subpackage, breaking imports that referenced `pydantic_settings.sources` directly. Update imports to `pydantic_settings.sources.<module>`.
Migration Steps
- 1Replace any `from pydantic_settings import sources` imports with `from pydantic_settings import sources` submodule usage, e.g., `from pydantic_settings.sources import <module>`.
- 2Review code that relied on the previous `sources.py` layout and adjust import paths accordingly.
- 3If you used the CLI, verify new flags (`--json-default`, `--suppress-submodel`, `--allow-unknown-args`) and update scripts.
- 4Ensure your project’s `pyproject.toml` or `requirements.txt` reflects the updated `pydantic` version constraint.
Release Summary
pydantic-settings v2.9.0 drops Python 3.8, refactors the sources module, adds secret manager integrations and several CLI enhancements, while fixing documentation typos and updating the pydantic core dependency.
Need More Details?
View the full release notes and all changes for Pydantic Settings v2.9.0.
View Full Changelog