Python 3.10 is no longer supported (#1003). pydantic-settings now requires Python 3.11+, since 3.10 reaches end of life this month. The tomli fallback is gone in favor of stdlib tomllib; the toml extra is kept as an empty extra so pip install pydantic-settings[toml] keeps working.
python-dotenv>=1.2.2 is now required (#971) to pick up the fix for CVE-2026-28684.
Aliases are ignored in every source when validate_by_alias=False (#1033). Env vars, secrets, CLI flags and defaults now use only field names, matching pydantic. An env var named after the alias is now ignored instead of raising extra_forbidden, and the CLI exposes --apple rather than --pomo.
validation_alias takes precedence over alias (#1038). When the two differ, values from JSON/YAML/TOML files and the CLI were silently ignored; they now load. CLI help lists the validation_alias flag first, and CliApp.serialize emits it.
CLI case-insensitivity only lowercases registered options (#1036). With case_sensitive=False, args after -- and those captured by CliUnknownArgs keep their case (-Xmx4G no longer becomes -xmx4g). Unrecognized options are now reported as typed (--NOPE instead of --nope).
JSON and YAML config files are read as UTF-8 by default (#955) instead of the locale encoding, completing the secrets-file fix from 2.15.0. json_file_encoding/yaml_file_encoding still override it.
Discriminated union defaults are partially updated again (#997). This reverts the 2.15.0 regression with nested_model_default_partial_update=True: the default is only dropped when the incoming value selects a different union member.
New features
Python 3.15 and pydantic 2.14 support (#1026, #1029, #1022). pydantic 2.14 broke CliApp.run and validate_by_alias=False handling; both are fixed.
Cached settings instances via Settings.settings_cached() and Settings.settings_clear_cache() (#952). These give you a process-local singleton per settings class without hand-rolling lru_cache wrappers. Calling the class directly still builds a fresh instance.
AWS Systems Manager Parameter Store source — AWSSystemsManagerSettingsSource (#941). It recursively reads every parameter under an ssm_path, with / mapping onto nested models. Install it with the new aws-systems-manager extra.
env_file_depth (#940) lets a relative env_file be found in parent directories, mirroring pyproject_toml_depth. This is useful when scripts run from a subdirectory of a monorepo. It defaults to 0, which keeps the current behavior.
CliVariadicArg for named variadic options (#949, #958). It accepts --param a b c in addition to repeated --param a --param b. Required fields need at least one value.
Bug fixes
CLI
CliApp.serialize output now round-trips through CliApp.run for enums, tuples, dates and Decimals (#988), explicit None values (#981), empty containers (#1008), CliVariadicArg values (#976) and populated CliUnknownArgs fields, which previously raised IndexError (#992).
Empty JSON arrays (--items []) now give an empty list instead of [''] (#994).
Tuples, frozenset, MutableSequence and other collection subtypes are now treated as repeatable/variadic options (#972), and so are named collection type aliases such as TypeAliasType('Addrs', list[IPvAnyAddress]) (#1032).
cli_exit_on_error=False is now honored in CliSubCommand parsers, which raise SettingsError instead of exiting (#977).
CliSubCommand aliases keep their case with case_sensitive=False (#989).
Each CliUnknownArgs field now receives only its own subcommand's leftover args (#1004).
CliApp.format_help no longer crashes when cli_prefix is set in model_config (#945).
Type aliases and parsing
Named union type aliases (TypeAliasType('V', list[int] | str)) now decode like their inline equivalents in env and dotenv sources, including under Optional, Annotated and custom validation aliases (#1006, #1030, #1041).
Resolving a named Annotated type alias no longer mutates shared FieldInfo metadata, which made validators run twice on subclasses or after model_rebuild() (#979).
A bare single-segment AliasPath('SOME_KEY') no longer tries to JSON-decode plain string values (#980).
collections.abc.Set/MutableSet/typing.AbstractSet fields now JSON-decode env values (#973).
A bare typing.Dict field with env_nested_delimiter no longer raises IndexError, which was a regression in 2.13.0 (#1009).
Case-insensitive matching now works for nested pydantic dataclasses (#1010).
Dotenv, secrets and config files
With extra='allow', a non-lowercase env_prefix is now stripped from dotenv extras (#959, #968).
secrets_case_sensitive=True is now honored on Windows (#1001).
An empty JSON config file is treated as an empty mapping instead of crashing (#947), matching YAML and TOML.
TOML table headers: ~ paths are now expanded when checking that the file exists (#1034), and an explicit toml_table_header=() now overrides the model config to read the file root (#1027).
Cloud sources
Azure Key Vault and GCP Secret Manager now honor env_parse_none_str (#1019, #1040).
Azure Key Vault: dash_to_underscore=True now works for nested model fields (#1025).
NestedSecretsSettingsSource now validates its specific constructor arguments (#975).
DotenvFiltering is exported from pydantic_settings.sources.types (#944).
Documentation
Document that runtime validation arguments (strict, extra, context) passed to model_validate() are not applied to BaseSettings, and give a workaround (#1017).
Explain why extra='forbid' doesn't reject misspelled top-level env vars (#986).
Clarify alias plus nested model env lookup with populate_by_name (#933), and add a nested model example for env_prefix_target (#953).
This PR contains the following updates:
| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [fastapi](https://github.com/fastapi/fastapi) ([changelog](https://fastapi.tiangolo.com/release-notes/)) | `0.143.0` → `0.143.1` |  |  |
| [pydantic-settings](https://github.com/pydantic/pydantic-settings) ([changelog](https://github.com/pydantic/pydantic-settings/releases)) | `2.15.0` → `2.16.0` |  |  |
---
### Release Notes
<details>
<summary>fastapi/fastapi (fastapi)</summary>
### [`v0.143.1`](https://github.com/fastapi/fastapi/releases/tag/0.143.1)
[Compare Source](https://github.com/fastapi/fastapi/compare/0.143.0...0.143.1)
##### Fixes
- 🐛 Fix included route metadata in `iter_route_contexts()`. PR [#​16484](https://github.com/fastapi/fastapi/pull/16484) by [@​tiangolo](https://github.com/tiangolo).
</details>
<details>
<summary>pydantic/pydantic-settings (pydantic-settings)</summary>
### [`v2.16.0`](https://github.com/pydantic/pydantic-settings/releases/tag/v2.16.0)
[Compare Source](https://github.com/pydantic/pydantic-settings/compare/v2.15.0...v2.16.0)
#### Highlights
##### Breaking changes and behavior changes
- **Python 3.10 is no longer supported** ([#​1003](https://github.com/pydantic/pydantic-settings/pull/1003)). pydantic-settings now requires Python 3.11+, since 3.10 reaches end of life this month. The `tomli` fallback is gone in favor of stdlib `tomllib`; the `toml` extra is kept as an empty extra so `pip install pydantic-settings[toml]` keeps working.
- **`python-dotenv>=1.2.2` is now required** ([#​971](https://github.com/pydantic/pydantic-settings/pull/971)) to pick up the fix for CVE-2026-28684.
- **Aliases are ignored in every source when `validate_by_alias=False`** ([#​1033](https://github.com/pydantic/pydantic-settings/pull/1033)). Env vars, secrets, CLI flags and defaults now use only field names, matching pydantic. An env var named after the alias is now ignored instead of raising `extra_forbidden`, and the CLI exposes `--apple` rather than `--pomo`.
- **`validation_alias` takes precedence over `alias`** ([#​1038](https://github.com/pydantic/pydantic-settings/pull/1038)). When the two differ, values from JSON/YAML/TOML files and the CLI were silently ignored; they now load. CLI help lists the `validation_alias` flag first, and `CliApp.serialize` emits it.
- **CLI case-insensitivity only lowercases registered options** ([#​1036](https://github.com/pydantic/pydantic-settings/pull/1036)). With `case_sensitive=False`, args after `--` and those captured by `CliUnknownArgs` keep their case (`-Xmx4G` no longer becomes `-xmx4g`). Unrecognized options are now reported as typed (`--NOPE` instead of `--nope`).
- **JSON and YAML config files are read as UTF-8 by default** ([#​955](https://github.com/pydantic/pydantic-settings/pull/955)) instead of the locale encoding, completing the secrets-file fix from 2.15.0. `json_file_encoding`/`yaml_file_encoding` still override it.
- **Discriminated union defaults are partially updated again** ([#​997](https://github.com/pydantic/pydantic-settings/pull/997)). This reverts the 2.15.0 regression with `nested_model_default_partial_update=True`: the default is only dropped when the incoming value selects a *different* union member.
##### New features
- **Python 3.15 and pydantic 2.14 support** ([#​1026](https://github.com/pydantic/pydantic-settings/pull/1026), [#​1029](https://github.com/pydantic/pydantic-settings/pull/1029), [#​1022](https://github.com/pydantic/pydantic-settings/pull/1022)). pydantic 2.14 broke `CliApp.run` and `validate_by_alias=False` handling; both are fixed.
- **Cached settings instances** via `Settings.settings_cached()` and `Settings.settings_clear_cache()` ([#​952](https://github.com/pydantic/pydantic-settings/pull/952)). These give you a process-local singleton per settings class without hand-rolling `lru_cache` wrappers. Calling the class directly still builds a fresh instance.
- **AWS Systems Manager Parameter Store source** — `AWSSystemsManagerSettingsSource` ([#​941](https://github.com/pydantic/pydantic-settings/pull/941)). It recursively reads every parameter under an `ssm_path`, with `/` mapping onto nested models. Install it with the new `aws-systems-manager` extra.
- **`env_file_depth`** ([#​940](https://github.com/pydantic/pydantic-settings/pull/940)) lets a relative `env_file` be found in parent directories, mirroring `pyproject_toml_depth`. This is useful when scripts run from a subdirectory of a monorepo. It defaults to `0`, which keeps the current behavior.
- **`CliVariadicArg` for named variadic options** ([#​949](https://github.com/pydantic/pydantic-settings/pull/949), [#​958](https://github.com/pydantic/pydantic-settings/pull/958)). It accepts `--param a b c` in addition to repeated `--param a --param b`. Required fields need at least one value.
##### Bug fixes
**CLI**
- `CliApp.serialize` output now round-trips through `CliApp.run` for enums, tuples, dates and `Decimal`s ([#​988](https://github.com/pydantic/pydantic-settings/pull/988)), explicit `None` values ([#​981](https://github.com/pydantic/pydantic-settings/pull/981)), empty containers ([#​1008](https://github.com/pydantic/pydantic-settings/pull/1008)), `CliVariadicArg` values ([#​976](https://github.com/pydantic/pydantic-settings/pull/976)) and populated `CliUnknownArgs` fields, which previously raised `IndexError` ([#​992](https://github.com/pydantic/pydantic-settings/pull/992)).
- Empty JSON arrays (`--items []`) now give an empty list instead of `['']` ([#​994](https://github.com/pydantic/pydantic-settings/pull/994)).
- Tuples, `frozenset`, `MutableSequence` and other collection subtypes are now treated as repeatable/variadic options ([#​972](https://github.com/pydantic/pydantic-settings/pull/972)), and so are named collection type aliases such as `TypeAliasType('Addrs', list[IPvAnyAddress])` ([#​1032](https://github.com/pydantic/pydantic-settings/pull/1032)).
- `cli_exit_on_error=False` is now honored in `CliSubCommand` parsers, which raise `SettingsError` instead of exiting ([#​977](https://github.com/pydantic/pydantic-settings/pull/977)).
- `CliSubCommand` aliases keep their case with `case_sensitive=False` ([#​989](https://github.com/pydantic/pydantic-settings/pull/989)).
- Each `CliUnknownArgs` field now receives only its own subcommand's leftover args ([#​1004](https://github.com/pydantic/pydantic-settings/pull/1004)).
- `CliApp.format_help` no longer crashes when `cli_prefix` is set in `model_config` ([#​945](https://github.com/pydantic/pydantic-settings/pull/945)).
**Type aliases and parsing**
- Named union type aliases (`TypeAliasType('V', list[int] | str)`) now decode like their inline equivalents in env and dotenv sources, including under `Optional`, `Annotated` and custom validation aliases ([#​1006](https://github.com/pydantic/pydantic-settings/pull/1006), [#​1030](https://github.com/pydantic/pydantic-settings/pull/1030), [#​1041](https://github.com/pydantic/pydantic-settings/pull/1041)).
- Resolving a named `Annotated` type alias no longer mutates shared `FieldInfo` metadata, which made validators run twice on subclasses or after `model_rebuild()` ([#​979](https://github.com/pydantic/pydantic-settings/pull/979)).
- A bare single-segment `AliasPath('SOME_KEY')` no longer tries to JSON-decode plain string values ([#​980](https://github.com/pydantic/pydantic-settings/pull/980)).
- `collections.abc.Set`/`MutableSet`/`typing.AbstractSet` fields now JSON-decode env values ([#​973](https://github.com/pydantic/pydantic-settings/pull/973)).
- A bare `typing.Dict` field with `env_nested_delimiter` no longer raises `IndexError`, which was a regression in 2.13.0 ([#​1009](https://github.com/pydantic/pydantic-settings/pull/1009)).
- Case-insensitive matching now works for nested pydantic dataclasses ([#​1010](https://github.com/pydantic/pydantic-settings/pull/1010)).
**Dotenv, secrets and config files**
- With `extra='allow'`, a non-lowercase `env_prefix` is now stripped from dotenv extras ([#​959](https://github.com/pydantic/pydantic-settings/pull/959), [#​968](https://github.com/pydantic/pydantic-settings/pull/968)).
- `secrets_case_sensitive=True` is now honored on Windows ([#​1001](https://github.com/pydantic/pydantic-settings/pull/1001)).
- An empty JSON config file is treated as an empty mapping instead of crashing ([#​947](https://github.com/pydantic/pydantic-settings/pull/947)), matching YAML and TOML.
- TOML table headers: `~` paths are now expanded when checking that the file exists ([#​1034](https://github.com/pydantic/pydantic-settings/pull/1034)), and an explicit `toml_table_header=()` now overrides the model config to read the file root ([#​1027](https://github.com/pydantic/pydantic-settings/pull/1027)).
**Cloud sources**
- Azure Key Vault and GCP Secret Manager now honor `env_parse_none_str` ([#​1019](https://github.com/pydantic/pydantic-settings/pull/1019), [#​1040](https://github.com/pydantic/pydantic-settings/pull/1040)).
- Azure Key Vault: `dash_to_underscore=True` now works for nested model fields ([#​1025](https://github.com/pydantic/pydantic-settings/pull/1025)).
- `NestedSecretsSettingsSource` now validates its specific constructor arguments ([#​975](https://github.com/pydantic/pydantic-settings/pull/975)).
- `DotenvFiltering` is exported from `pydantic_settings.sources.types` ([#​944](https://github.com/pydantic/pydantic-settings/pull/944)).
##### Documentation
- Document that runtime validation arguments (`strict`, `extra`, `context`) passed to `model_validate()` are not applied to `BaseSettings`, and give a workaround ([#​1017](https://github.com/pydantic/pydantic-settings/pull/1017)).
- Explain why `extra='forbid'` doesn't reject misspelled top-level env vars ([#​986](https://github.com/pydantic/pydantic-settings/pull/986)).
- Clarify alias plus nested model env lookup with `populate_by_name` ([#​933](https://github.com/pydantic/pydantic-settings/pull/933)), and add a nested model example for `env_prefix_target` ([#​953](https://github.com/pydantic/pydantic-settings/pull/953)).
- Fix assorted typos ([#​942](https://github.com/pydantic/pydantic-settings/pull/942), [#​964](https://github.com/pydantic/pydantic-settings/pull/964)).
<details>
<summary><b>All changes</b> (including dependency bumps and internal maintenance)</summary>
#### What's Changed
* Bump boto3 from 1.43.60 to 1.43.66 in the python-packages group by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/936
* docs: clarify alias + nested model env lookup with populate_by_name by @​pranjalm37 in https://github.com/pydantic/pydantic-settings/pull/933
* lint: enable flake8-bugbear and fix the issues it found by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/931
* Bump the python-packages group with 6 updates by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/943
* docs: improve ENV_FILE_SENTINEL comment phrasing in sources/types.py by @​aoright in https://github.com/pydantic/pydantic-settings/pull/942
* fix(types): include DotenvFiltering in __all__ in sources.types by @​aoright in https://github.com/pydantic/pydantic-settings/pull/944
* Add env_file_depth for parent directory env file lookup by @​dmi03 in https://github.com/pydantic/pydantic-settings/pull/940
* Add an AWS Systems Manager Parameter Store settings source by @​ChrisJr404 in https://github.com/pydantic/pydantic-settings/pull/941
* fix: use self.cli_prefix instead of cli_prefix in CliSettingsSource constructor by @​RomainL972 in https://github.com/pydantic/pydantic-settings/pull/945
* Bump the python-packages group with 6 updates by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/948
* fix: treat empty JSON config file as empty mapping instead of crashing by @​sneha4175 in https://github.com/pydantic/pydantic-settings/pull/947
* Expand ruff rule selection by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/950
* Enable ruff's flake8-return (RET) rules by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/951
* docs: add nested model alias example for env_prefix_target by @​MohammedAlkindi in https://github.com/pydantic/pydantic-settings/pull/953
* Add cached settings instances by @​tiangolo in https://github.com/pydantic/pydantic-settings/pull/952
* Bump the github-actions group with 3 updates by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/954
* Bump the python-packages group with 4 updates by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/957
* Add CliVariadicArg for named variadic CLI options by @​gyanu2507 in https://github.com/pydantic/pydantic-settings/pull/949
* Fix CliVariadicArg empty-value handling for named options by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/958
* fix: read JSON and YAML config as UTF-8, not the locale encoding by @​MohammedAlkindi in https://github.com/pydantic/pydantic-settings/pull/955
* Reach 100% test coverage by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/963
* docs: fix three small wording/typo errors by @​simpleqt in https://github.com/pydantic/pydantic-settings/pull/964
* fix: strip a case-normalized env_prefix from dotenv extras by @​MohammedAlkindi in https://github.com/pydantic/pydantic-settings/pull/959
* fix: slice the case-normalized prefix in dotenv match_prefix by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/968
* Bump the python-packages group with 3 updates by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/966
* fix: address CVE-2026-28684 in python-dotenv dependency by @​jmartens in https://github.com/pydantic/pydantic-settings/pull/971
* build(deps): bump the python-packages group with 3 updates by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/978
* Verify `NestedSecretsSettingsSource` specific arguments by @​makukha in https://github.com/pydantic/pydantic-settings/pull/975
* Fix abstract Set annotations not being treated as complex by @​mmdverse in https://github.com/pydantic/pydantic-settings/pull/973
* Fix CLI append-action detection for collection subtypes by @​mmdverse in https://github.com/pydantic/pydantic-settings/pull/972
* Honor cli_exit_on_error=False in CliSubCommand parsers by @​glaziermag in https://github.com/pydantic/pydantic-settings/pull/977
* Preserve CliVariadicArg values in CliApp.serialize argparse/env styles by @​glaziermag in https://github.com/pydantic/pydantic-settings/pull/976
* Avoid mutating field metadata when resolving type aliases by @​jakezwang in https://github.com/pydantic/pydantic-settings/pull/979
* fix: bare AliasPath complexity keyed off name length, not path length by @​ishan-1010 in https://github.com/pydantic/pydantic-settings/pull/980
* docs: clarify extra validation for environment variables by @​hulkbig in https://github.com/pydantic/pydantic-settings/pull/986
* build(deps): bump the python-packages group with 2 updates by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/990
* Preserve explicit None values in CLI serialization by @​mtcd001-tech in https://github.com/pydantic/pydantic-settings/pull/981
* Make `CliApp.serialize` output parseable for enum and non-JSON values by @​SulimanAbdulrazzaq in https://github.com/pydantic/pydantic-settings/pull/988
* Preserve CliSubCommand alias case with case_sensitive=False by @​glaziermag in https://github.com/pydantic/pydantic-settings/pull/989
* Fix Path.is_mount type-checking error on win32 platform by @​truecallerabreham in https://github.com/pydantic/pydantic-settings/pull/982
* build(deps): bump astral-sh/setup-uv from 10.0.1 to 10.2.0 in the github-actions group by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/998
* build(deps): bump the python-packages group with 3 updates by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/999
* Fix `CliApp.serialize` for models with `CliUnknownArgs` fields by @​truecallerabreham in https://github.com/pydantic/pydantic-settings/pull/992
* Honor `secrets_case_sensitive` on Windows by overriding `_load_env_vars` by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/1001
* Fix empty JSON arrays in CLI list arguments by @​hansu650 in https://github.com/pydantic/pydantic-settings/pull/994
* Bump `samuelcolvin/check-python-version` action to v5.1 by @​Viicos in https://github.com/pydantic/pydantic-settings/pull/1014
* build(deps): bump the python-packages group with 7 updates by @​dependabot[bot] in https://github.com/pydantic/pydantic-settings/pull/1015
* Only skip partial updates for discriminated unions selecting another type by @​SammyTourani in https://github.com/pydantic/pydantic-settings/pull/997
* fix: handle bare typing.Dict in EnvSettingsSource.next_field (#​1007) by @​DawnofGenX in https://github.com/pydantic/pydantic-settings/pull/1009
* Apply case-insensitive field matching to nested pydantic dataclasses by @​sungbin1015 in https://github.com/pydantic/pydantic-settings/pull/1010
* Document that runtime validation arguments are not applied to BaseSettings by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/1017
* Fix named union alias parsing in environment sources by @​hulkbig in https://github.com/pydantic/pydantic-settings/pull/1006
* Drop support for Python 3.10 by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/1003
* Add support for Python 3.15 by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/1026
* Give each CliUnknownArgs field only its own parser leftovers by @​fhgffy in https://github.com/pydantic/pydantic-settings/pull/1004
* Preserve empty containers in CLI serialization by @​fallintoplace in https://github.com/pydantic/pydantic-settings/pull/1008
* Honor env_parse_none_str for Azure Key Vault secrets by @​fhgffy in https://github.com/pydantic/pydantic-settings/pull/1019
* Fix nested Azure Key Vault dash translation by @​goudan789 in https://github.com/pydantic/pydantic-settings/pull/1025
* Support pydantic 2.14 by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/1029
* Read field names when `validate_by_alias=False` on pydantic 2.14 by @​maharanay22 in https://github.com/pydantic/pydantic-settings/pull/1022
* Ignore aliases in every source when `validate_by_alias=False` by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/1033
* Honor explicit empty TOML table header overrides by @​xiehuanyi in https://github.com/pydantic/pydantic-settings/pull/1027
* Fix CLI parsing for named collection type aliases by @​JackyHsu-X in https://github.com/pydantic/pydantic-settings/pull/1032
* Fix JSON decoding for optional named union aliases by @​hulkbig in https://github.com/pydantic/pydantic-settings/pull/1030
* Decode optional Annotated named union aliases by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/1041
* Expand home paths when checking TOML table headers by @​JunaidAhamed-7777 in https://github.com/pydantic/pydantic-settings/pull/1034
* Fix config file and CLI values being ignored when alias differs from validation_alias by @​hzmsh in https://github.com/pydantic/pydantic-settings/pull/1038
* Honor env_parse_none_str for GCP Secret Manager by @​Ganesh1729-ui in https://github.com/pydantic/pydantic-settings/pull/1040
* Simplify alias resolution branch and test alias with AliasChoices/AliasPath by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/1042
* Keep case of non-option CLI args when case_sensitive=False by @​hzmsh in https://github.com/pydantic/pydantic-settings/pull/1036
* Prepare release 2.16.0 by @​hramezani in https://github.com/pydantic/pydantic-settings/pull/1043
#### New Contributors
* @​pranjalm37 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/933
* @​aoright made their first contribution in https://github.com/pydantic/pydantic-settings/pull/942
* @​dmi03 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/940
* @​ChrisJr404 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/941
* @​RomainL972 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/945
* @​sneha4175 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/947
* @​MohammedAlkindi made their first contribution in https://github.com/pydantic/pydantic-settings/pull/953
* @​tiangolo made their first contribution in https://github.com/pydantic/pydantic-settings/pull/952
* @​gyanu2507 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/949
* @​simpleqt made their first contribution in https://github.com/pydantic/pydantic-settings/pull/964
* @​jmartens made their first contribution in https://github.com/pydantic/pydantic-settings/pull/971
* @​mmdverse made their first contribution in https://github.com/pydantic/pydantic-settings/pull/973
* @​glaziermag made their first contribution in https://github.com/pydantic/pydantic-settings/pull/977
* @​jakezwang made their first contribution in https://github.com/pydantic/pydantic-settings/pull/979
* @​ishan-1010 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/980
* @​hulkbig made their first contribution in https://github.com/pydantic/pydantic-settings/pull/986
* @​mtcd001-tech made their first contribution in https://github.com/pydantic/pydantic-settings/pull/981
* @​SulimanAbdulrazzaq made their first contribution in https://github.com/pydantic/pydantic-settings/pull/988
* @​truecallerabreham made their first contribution in https://github.com/pydantic/pydantic-settings/pull/982
* @​hansu650 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/994
* @​SammyTourani made their first contribution in https://github.com/pydantic/pydantic-settings/pull/997
* @​DawnofGenX made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1009
* @​sungbin1015 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1010
* @​fhgffy made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1004
* @​fallintoplace made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1008
* @​goudan789 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1025
* @​maharanay22 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1022
* @​xiehuanyi made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1027
* @​JackyHsu-X made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1032
* @​JunaidAhamed-7777 made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1034
* @​hzmsh made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1038
* @​Ganesh1729-ui made their first contribution in https://github.com/pydantic/pydantic-settings/pull/1040
**Full Changelog**: <https://github.com/pydantic/pydantic-settings/compare/v2.15.0...v2.16.0>
</details>
</details>
---
### Configuration
📅 **Schedule**: (in timezone Europe/Warsaw)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNDUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjE0NS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2IiwibGFiZWxzIjpbImRlcHMtY29kZSIsInJlbm92YXRlIl19-->
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
any of the package files in this branch needs updating, or
the branch becomes conflicted, or
you click the rebase/retry checkbox if found above, or
you rename this PR's title to start with "rebase!" to trigger it manually
The artifact failure details are included below:
File name: backend/pyproject.toml
Artifact update for fastapi resolved to version 0.143.3, which is a pending version that has not yet passed the Minimum Release Age threshold.
Renovate was attempting to update to 0.143.1
This is (likely) not a bug in Renovate, but due to the way your project pins dependencies, _and_ how Renovate calls your package manager to update them.
Until Renovate supports specifying an exact update to your package manager (https://github.com/renovatebot/renovate/issues/41624), it is recommended to directly pin your dependencies (with `rangeStrategy=pin` for apps, or `rangeStrategy=widen` for libraries)
See also: https://docs.renovatebot.com/dependency-pinning/
### ⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
- any of the package files in this branch needs updating, or
- the branch becomes conflicted, or
- you click the rebase/retry checkbox if found above, or
- you rename this PR's title to start with "rebase!" to trigger it manually
The artifact failure details are included below:
##### File name: backend/pyproject.toml
```
Artifact update for fastapi resolved to version 0.143.3, which is a pending version that has not yet passed the Minimum Release Age threshold.
Renovate was attempting to update to 0.143.1
This is (likely) not a bug in Renovate, but due to the way your project pins dependencies, _and_ how Renovate calls your package manager to update them.
Until Renovate supports specifying an exact update to your package manager (https://github.com/renovatebot/renovate/issues/41624), it is recommended to directly pin your dependencies (with `rangeStrategy=pin` for apps, or `rangeStrategy=widen` for libraries)
See also: https://docs.renovatebot.com/dependency-pinning/
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR contains the following updates:
0.143.0→0.143.12.15.0→2.16.0Release Notes
fastapi/fastapi (fastapi)
v0.143.1Compare Source
Fixes
iter_route_contexts(). PR #16484 by @tiangolo.pydantic/pydantic-settings (pydantic-settings)
v2.16.0Compare Source
Highlights
Breaking changes and behavior changes
tomlifallback is gone in favor of stdlibtomllib; thetomlextra is kept as an empty extra sopip install pydantic-settings[toml]keeps working.python-dotenv>=1.2.2is now required (#971) to pick up the fix for CVE-2026-28684.validate_by_alias=False(#1033). Env vars, secrets, CLI flags and defaults now use only field names, matching pydantic. An env var named after the alias is now ignored instead of raisingextra_forbidden, and the CLI exposes--applerather than--pomo.validation_aliastakes precedence overalias(#1038). When the two differ, values from JSON/YAML/TOML files and the CLI were silently ignored; they now load. CLI help lists thevalidation_aliasflag first, andCliApp.serializeemits it.case_sensitive=False, args after--and those captured byCliUnknownArgskeep their case (-Xmx4Gno longer becomes-xmx4g). Unrecognized options are now reported as typed (--NOPEinstead of--nope).json_file_encoding/yaml_file_encodingstill override it.nested_model_default_partial_update=True: the default is only dropped when the incoming value selects a different union member.New features
CliApp.runandvalidate_by_alias=Falsehandling; both are fixed.Settings.settings_cached()andSettings.settings_clear_cache()(#952). These give you a process-local singleton per settings class without hand-rollinglru_cachewrappers. Calling the class directly still builds a fresh instance.AWSSystemsManagerSettingsSource(#941). It recursively reads every parameter under anssm_path, with/mapping onto nested models. Install it with the newaws-systems-managerextra.env_file_depth(#940) lets a relativeenv_filebe found in parent directories, mirroringpyproject_toml_depth. This is useful when scripts run from a subdirectory of a monorepo. It defaults to0, which keeps the current behavior.CliVariadicArgfor named variadic options (#949, #958). It accepts--param a b cin addition to repeated--param a --param b. Required fields need at least one value.Bug fixes
CLI
CliApp.serializeoutput now round-trips throughCliApp.runfor enums, tuples, dates andDecimals (#988), explicitNonevalues (#981), empty containers (#1008),CliVariadicArgvalues (#976) and populatedCliUnknownArgsfields, which previously raisedIndexError(#992).--items []) now give an empty list instead of[''](#994).frozenset,MutableSequenceand other collection subtypes are now treated as repeatable/variadic options (#972), and so are named collection type aliases such asTypeAliasType('Addrs', list[IPvAnyAddress])(#1032).cli_exit_on_error=Falseis now honored inCliSubCommandparsers, which raiseSettingsErrorinstead of exiting (#977).CliSubCommandaliases keep their case withcase_sensitive=False(#989).CliUnknownArgsfield now receives only its own subcommand's leftover args (#1004).CliApp.format_helpno longer crashes whencli_prefixis set inmodel_config(#945).Type aliases and parsing
TypeAliasType('V', list[int] | str)) now decode like their inline equivalents in env and dotenv sources, including underOptional,Annotatedand custom validation aliases (#1006, #1030, #1041).Annotatedtype alias no longer mutates sharedFieldInfometadata, which made validators run twice on subclasses or aftermodel_rebuild()(#979).AliasPath('SOME_KEY')no longer tries to JSON-decode plain string values (#980).collections.abc.Set/MutableSet/typing.AbstractSetfields now JSON-decode env values (#973).typing.Dictfield withenv_nested_delimiterno longer raisesIndexError, which was a regression in 2.13.0 (#1009).Dotenv, secrets and config files
extra='allow', a non-lowercaseenv_prefixis now stripped from dotenv extras (#959, #968).secrets_case_sensitive=Trueis now honored on Windows (#1001).~paths are now expanded when checking that the file exists (#1034), and an explicittoml_table_header=()now overrides the model config to read the file root (#1027).Cloud sources
env_parse_none_str(#1019, #1040).dash_to_underscore=Truenow works for nested model fields (#1025).NestedSecretsSettingsSourcenow validates its specific constructor arguments (#975).DotenvFilteringis exported frompydantic_settings.sources.types(#944).Documentation
strict,extra,context) passed tomodel_validate()are not applied toBaseSettings, and give a workaround (#1017).extra='forbid'doesn't reject misspelled top-level env vars (#986).populate_by_name(#933), and add a nested model example forenv_prefix_target(#953).All changes (including dependency bumps and internal maintenance)
What's Changed
NestedSecretsSettingsSourcespecific arguments by @makukha in https://github.com/pydantic/pydantic-settings/pull/975CliApp.serializeoutput parseable for enum and non-JSON values by @SulimanAbdulrazzaq in https://github.com/pydantic/pydantic-settings/pull/988CliApp.serializefor models withCliUnknownArgsfields by @truecallerabreham in https://github.com/pydantic/pydantic-settings/pull/992secrets_case_sensitiveon Windows by overriding_load_env_varsby @hramezani in https://github.com/pydantic/pydantic-settings/pull/1001samuelcolvin/check-python-versionaction to v5.1 by @Viicos in https://github.com/pydantic/pydantic-settings/pull/1014validate_by_alias=Falseon pydantic 2.14 by @maharanay22 in https://github.com/pydantic/pydantic-settings/pull/1022validate_by_alias=Falseby @hramezani in https://github.com/pydantic/pydantic-settings/pull/1033New Contributors
Full Changelog: https://github.com/pydantic/pydantic-settings/compare/v2.15.0...v2.16.0
Configuration
📅 Schedule: (in timezone Europe/Warsaw)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Mend Renovate CLI.
⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: backend/pyproject.toml