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
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
Index: pydantic_settings-2.8.1/pydantic_settings/sources.py
|
|
===================================================================
|
|
--- pydantic_settings-2.8.1.orig/pydantic_settings/sources.py
|
|
+++ pydantic_settings-2.8.1/pydantic_settings/sources.py
|
|
@@ -45,6 +45,7 @@ from pydantic.dataclasses import is_pyda
|
|
from pydantic.fields import FieldInfo
|
|
from pydantic_core import PydanticUndefined
|
|
from typing_extensions import Annotated, _AnnotatedAlias, get_args, get_origin
|
|
+from typing_inspection import typing_objects
|
|
|
|
from pydantic_settings.utils import path_type_label
|
|
|
|
@@ -1996,7 +1997,7 @@ class CliSettingsSource(EnvSettingsSourc
|
|
return '...'
|
|
elif isinstance(obj, Representation):
|
|
return repr(obj)
|
|
- elif isinstance(obj, typing_extensions.TypeAliasType):
|
|
+ elif typing_objects.is_typealiastype(obj):
|
|
return str(obj)
|
|
|
|
if not isinstance(obj, (typing_base, WithArgsTypes, type)):
|
|
Index: pydantic_settings-2.8.1/pyproject.toml
|
|
===================================================================
|
|
--- pydantic_settings-2.8.1.orig/pyproject.toml
|
|
+++ pydantic_settings-2.8.1/pyproject.toml
|
|
@@ -43,6 +43,7 @@ requires-python = '>=3.8'
|
|
dependencies = [
|
|
'pydantic>=2.7.0',
|
|
'python-dotenv>=0.21.0',
|
|
+ 'typing-inspection>=0.4.0',
|
|
]
|
|
dynamic = ['version']
|
|
|