forked from pool/python-pydantic-settings
- Update to 2.7.1:
* Move preferred alias resolution to private method * Fix test_protected_namespace_defaults with -Wdefault * Make tests more robust to the running environment * Fix rendering of annotations in code example * Fix alias resolution for default settings source. * Use the class name in the __repr__ implementations * Fix default help text for union of submodels. * Add support for CliMutuallyExclusiveGroup. * Disable abbreviations on internal parser. * Fix Secret field parsing * Fix alias resolution to use preferred key. * Strip annotated when getting submodels during CLI parsing. * Removing return type from the function in test * Relax default protected_namespaces * Add support for CLI kebab case flag. * Change reference of default values validation in documentation * Improve field value parsing by adding NoDecode and ForceDecode annotations * Fix attribute error on Python 3.9 with typing.Sequence * Add Python 3.13 support * Adding support for populate_by_name * Refactor path_type_label * Fix nested model field with alias parsing * Fix PathType typing in case of sequence * Add cli_ignore_unknown_args config option. * Fix AzureKeyVaultSettingsSource problem in case of field with underscore * Add cli_flag_prefix_char config option. * Fix nested model AliasChoices in validation alias * Add CLI App Support OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydantic-settings?expand=0&rev=12
This commit is contained in:
26
fix-settings-dump.patch
Normal file
26
fix-settings-dump.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
Index: pydantic_settings-2.7.1/docs/index.md
|
||||
===================================================================
|
||||
--- pydantic_settings-2.7.1.orig/docs/index.md
|
||||
+++ pydantic_settings-2.7.1/docs/index.md
|
||||
@@ -72,9 +72,9 @@ print(Settings().model_dump())
|
||||
{
|
||||
'auth_key': 'xxx',
|
||||
'api_key': 'xxx',
|
||||
- 'redis_dsn': Url('redis://user:pass@localhost:6379/1'),
|
||||
- 'pg_dsn': MultiHostUrl('postgres://user:pass@localhost:5432/foobar'),
|
||||
- 'amqp_dsn': Url('amqp://user:pass@localhost:5672/'),
|
||||
+ 'redis_dsn': RedisDsn('redis://user:pass@localhost:6379/1'),
|
||||
+ 'pg_dsn': PostgresDsn('postgres://user:pass@localhost:5432/foobar'),
|
||||
+ 'amqp_dsn': AmqpDsn('amqp://user:pass@localhost:5672/'),
|
||||
'special_function': math.cos,
|
||||
'domains': set(),
|
||||
'more_settings': {'foo': 'bar', 'apple': 1},
|
||||
@@ -1952,7 +1952,7 @@ class Settings(BaseSettings):
|
||||
|
||||
|
||||
print(Settings(database_dsn='postgres://postgres@localhost:5432/kwargs_db'))
|
||||
-#> database_dsn=MultiHostUrl('postgres://postgres@localhost:5432/kwargs_db')
|
||||
+#> database_dsn=PostgresDsn('postgres://postgres@localhost:5432/kwargs_db')
|
||||
```
|
||||
|
||||
By flipping `env_settings` and `init_settings`, environment variables now have precedence over `__init__` kwargs.
|
Reference in New Issue
Block a user