Compare commits
18 Commits
Author | SHA256 | Date | |
---|---|---|---|
dc573251dd | |||
082e820302 | |||
8ca27fd8ae | |||
6400f49133 | |||
b393ce4c0c | |||
5e05958622 | |||
e4a8a0d837 | |||
492f548e7b | |||
5803852694 | |||
eb66cf607e | |||
7571a3d0c9 | |||
32b68a6f83 | |||
d804c84ea9 | |||
ffb9010f83 | |||
f40c4004b6 | |||
a28b60ca93 | |||
a5fbc080a9 | |||
16dba026f5 |
@@ -1,32 +0,0 @@
|
||||
Index: pydantic_settings-2.3.4/tests/test_settings.py
|
||||
===================================================================
|
||||
--- pydantic_settings-2.3.4.orig/tests/test_settings.py
|
||||
+++ pydantic_settings-2.3.4/tests/test_settings.py
|
||||
@@ -10,6 +10,7 @@ from datetime import datetime, timezone
|
||||
from enum import IntEnum
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Dict, Generic, Hashable, List, Optional, Set, Tuple, Type, TypeVar, Union
|
||||
+from unittest import mock
|
||||
|
||||
import pytest
|
||||
import typing_extensions
|
||||
@@ -1116,7 +1117,8 @@ def test_multiple_env_file(tmp_path):
|
||||
|
||||
model_config = SettingsConfigDict(env_file=[base_env, prod_env])
|
||||
|
||||
- s = Settings()
|
||||
+ with mock.patch.dict('os.environ', {}, clear=True):
|
||||
+ s = Settings()
|
||||
assert s.debug_mode is False
|
||||
assert s.host == 'https://example.com/services'
|
||||
assert s.port == 8000
|
||||
@@ -1135,7 +1137,8 @@ def test_model_env_file_override_model_c
|
||||
|
||||
model_config = SettingsConfigDict(env_file=prod_env)
|
||||
|
||||
- s = Settings(_env_file=base_env)
|
||||
+ with mock.patch.dict('os.environ', {}, clear=True):
|
||||
+ s = Settings(_env_file=base_env)
|
||||
assert s.debug_mode is True
|
||||
assert s.host == 'localhost'
|
||||
assert s.port == 8000
|
@@ -1,26 +0,0 @@
|
||||
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.
|
BIN
pydantic_settings-2.3.4.tar.gz
(Stored with Git LFS)
BIN
pydantic_settings-2.3.4.tar.gz
(Stored with Git LFS)
Binary file not shown.
BIN
pydantic_settings-2.4.0.tar.gz
(Stored with Git LFS)
BIN
pydantic_settings-2.4.0.tar.gz
(Stored with Git LFS)
Binary file not shown.
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:10c9caad35e64bfb3c2fbf70a078c0e25cc92499782e5200747f942a065dec93
|
||||
size 79920
|
BIN
pydantic_settings-2.8.1.tar.gz
(Stored with Git LFS)
BIN
pydantic_settings-2.8.1.tar.gz
(Stored with Git LFS)
Binary file not shown.
BIN
pydantic_settings-2.9.1.tar.gz
(Stored with Git LFS)
BIN
pydantic_settings-2.9.1.tar.gz
(Stored with Git LFS)
Binary file not shown.
@@ -1,33 +0,0 @@
|
||||
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']
|
||||
|
Reference in New Issue
Block a user