forked from pool/python-pydantic-settings
* Fix for init source kwarg alias resolution * Revert usage of positional only argument in BaseSettings.__init__ * Revert use of object instead of Any * CLI support for optional and variadic positional args * Improve env_prefix config doc * Add env_nested_max_split setting * Avoid using Any in BaseSettings signature to avoid mypy errors * Asynchronous CLI methods in CliApp * Don't explode env vars if env_nested_delimiter is empty - Add patch use-typing_objects.patch: * Use typing_inspection.typing_objects rather than isinstance. - Refreshed patch fix-settings-dump.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydantic-settings?expand=0&rev=14
27 lines
1.2 KiB
Diff
27 lines
1.2 KiB
Diff
Index: pydantic_settings-2.8.1/docs/index.md
|
|
===================================================================
|
|
--- pydantic_settings-2.8.1.orig/docs/index.md
|
|
+++ pydantic_settings-2.8.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},
|
|
@@ -2075,7 +2075,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.
|