dycw-utilities 0.166.4__py3-none-any.whl → 0.166.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dycw_utilities-0.166.4.dist-info → dycw_utilities-0.166.5.dist-info}/METADATA +1 -1
- {dycw_utilities-0.166.4.dist-info → dycw_utilities-0.166.5.dist-info}/RECORD +7 -7
- utilities/__init__.py +1 -1
- utilities/typed_settings.py +9 -3
- {dycw_utilities-0.166.4.dist-info → dycw_utilities-0.166.5.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.166.4.dist-info → dycw_utilities-0.166.5.dist-info}/entry_points.txt +0 -0
- {dycw_utilities-0.166.4.dist-info → dycw_utilities-0.166.5.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=xvChk1eEP7CsKFlfHtKDpIE4uTrhOrGLZKZUo5E6FG4,60
|
2
2
|
utilities/aeventkit.py,sha256=ddoleSwW9zdc2tjX5Ge0pMKtYwV_JMxhHYOxnWX2AGM,12609
|
3
3
|
utilities/altair.py,sha256=92E2lCdyHY4Zb-vCw6rEJIsWdKipuu-Tu2ab1ufUfAk,9079
|
4
4
|
utilities/asyncio.py,sha256=PUedzQ5deqlSECQ33sam9cRzI9TnygHz3FdOqWJWPTM,15288
|
@@ -74,7 +74,7 @@ utilities/text.py,sha256=NVPywVHGnHzyjs1N1U8J4YIqKCU3v-794y6c3px1wYo,13667
|
|
74
74
|
utilities/threading.py,sha256=GvBOp4CyhHfN90wGXZuA2VKe9fGzMaEa7oCl4f3nnPU,1009
|
75
75
|
utilities/timer.py,sha256=oXfTii6ymu57niP0BDGZjFD55LEHi2a19kqZKiTgaFQ,2588
|
76
76
|
utilities/traceback.py,sha256=b1nSvlyrGmI1MyZLkkoLVET3DQBSGt9qqIlAAQbyjEw,9629
|
77
|
-
utilities/typed_settings.py,sha256=
|
77
|
+
utilities/typed_settings.py,sha256=bCGybctbjNDEbUBCvQFhKitRFrk9ixImpvbIpshgbtA,4644
|
78
78
|
utilities/types.py,sha256=IlRrCtPdLkGYVfpe-QIg2qNUgBr8OJNN7BhTKxnhh-M,18817
|
79
79
|
utilities/typing.py,sha256=QYoCIc71e_u5W-kBeiNzrD-GXxpLtMOGc9PqgZjMXeE,25274
|
80
80
|
utilities/tzdata.py,sha256=fgNVj66yUbCSI_-vrRVzSD3gtf-L_8IEJEPjP_Jel5Y,266
|
@@ -88,8 +88,8 @@ utilities/zoneinfo.py,sha256=tdIScrTB2-B-LH0ukb1HUXKooLknOfJNwHk10MuMYvA,3619
|
|
88
88
|
utilities/pytest_plugins/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
89
89
|
utilities/pytest_plugins/pytest_randomly.py,sha256=B1qYVlExGOxTywq2r1SMi5o7btHLk2PNdY_b1p98dkE,409
|
90
90
|
utilities/pytest_plugins/pytest_regressions.py,sha256=9v8kAXDM2ycIXJBimoiF4EgrwbUvxTycFWJiGR_GHhM,1466
|
91
|
-
dycw_utilities-0.166.
|
92
|
-
dycw_utilities-0.166.
|
93
|
-
dycw_utilities-0.166.
|
94
|
-
dycw_utilities-0.166.
|
95
|
-
dycw_utilities-0.166.
|
91
|
+
dycw_utilities-0.166.5.dist-info/METADATA,sha256=QvQYweBet4AC2aW4Ye_JWOCElDpKFtoZompsUJvxp_g,1696
|
92
|
+
dycw_utilities-0.166.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
93
|
+
dycw_utilities-0.166.5.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
|
94
|
+
dycw_utilities-0.166.5.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
95
|
+
dycw_utilities-0.166.5.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/typed_settings.py
CHANGED
@@ -30,7 +30,7 @@ from utilities.pathlib import to_path
|
|
30
30
|
from utilities.string import substitute_environ
|
31
31
|
|
32
32
|
if TYPE_CHECKING:
|
33
|
-
from collections.abc import Callable
|
33
|
+
from collections.abc import Callable, Iterable
|
34
34
|
|
35
35
|
from typed_settings.loaders import Loader
|
36
36
|
from typed_settings.processors import Processor
|
@@ -38,6 +38,9 @@ if TYPE_CHECKING:
|
|
38
38
|
from utilities.types import MaybeCallablePathLike, MaybeIterable, PathLike
|
39
39
|
|
40
40
|
|
41
|
+
type _ConverterItem = tuple[type[Any], Callable[..., Any]]
|
42
|
+
|
43
|
+
|
41
44
|
##
|
42
45
|
|
43
46
|
|
@@ -50,9 +53,10 @@ class ExtendedTSConverter(TSConverter):
|
|
50
53
|
*,
|
51
54
|
resolve_paths: bool = True,
|
52
55
|
strlist_sep: str | Callable[[str], list] | None = ":",
|
56
|
+
extra: Iterable[_ConverterItem] = (),
|
53
57
|
) -> None:
|
54
58
|
super().__init__(resolve_paths=resolve_paths, strlist_sep=strlist_sep)
|
55
|
-
cases: list[
|
59
|
+
cases: list[_ConverterItem] = [
|
56
60
|
(Date, Date.parse_common_iso),
|
57
61
|
(DateDelta, DateDelta.parse_common_iso),
|
58
62
|
(DateTimeDelta, DateTimeDelta.parse_common_iso),
|
@@ -66,6 +70,7 @@ class ExtendedTSConverter(TSConverter):
|
|
66
70
|
(UUID, UUID),
|
67
71
|
(YearMonth, YearMonth.parse_common_iso),
|
68
72
|
(ZonedDateTime, ZonedDateTime.parse_common_iso),
|
73
|
+
*extra,
|
69
74
|
]
|
70
75
|
extras = {cls: _make_converter(cls, func) for cls, func in cases}
|
71
76
|
self.scalar_converters |= extras
|
@@ -113,6 +118,7 @@ def load_settings[T](
|
|
113
118
|
start_dir: PathLike | None = None,
|
114
119
|
loaders: MaybeIterable[Loader] | None = None,
|
115
120
|
processors: MaybeIterable[Processor] = (),
|
121
|
+
converters: Iterable[_ConverterItem] = (),
|
116
122
|
base_dir: Path = _BASE_DIR,
|
117
123
|
) -> T:
|
118
124
|
if not search(r"^[A-Za-z]+(?:_[A-Za-z]+)*$", app_name):
|
@@ -129,7 +135,7 @@ def load_settings[T](
|
|
129
135
|
cls,
|
130
136
|
loaders_use,
|
131
137
|
processors=list(always_iterable(processors)),
|
132
|
-
converter=ExtendedTSConverter(),
|
138
|
+
converter=ExtendedTSConverter(extra=converters),
|
133
139
|
base_dir=base_dir,
|
134
140
|
)
|
135
141
|
|
File without changes
|
File without changes
|
File without changes
|