dycw-utilities 0.166.19__py3-none-any.whl → 0.166.21__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.19.dist-info → dycw_utilities-0.166.21.dist-info}/METADATA +1 -1
- {dycw_utilities-0.166.19.dist-info → dycw_utilities-0.166.21.dist-info}/RECORD +9 -9
- utilities/__init__.py +1 -1
- utilities/pydantic_settings_sops.py +3 -2
- utilities/pytest.py +29 -3
- utilities/pytest_plugins/pytest_regressions.py +6 -2
- {dycw_utilities-0.166.19.dist-info → dycw_utilities-0.166.21.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.166.19.dist-info → dycw_utilities-0.166.21.dist-info}/entry_points.txt +0 -0
- {dycw_utilities-0.166.19.dist-info → dycw_utilities-0.166.21.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=X2YbMqUPwpJb6zXgoy6sq5FDjCkXba4dKqbURe75W3w,61
|
2
2
|
utilities/aeventkit.py,sha256=ddoleSwW9zdc2tjX5Ge0pMKtYwV_JMxhHYOxnWX2AGM,12609
|
3
3
|
utilities/altair.py,sha256=nHdpWt8ZwdUwRQN970MvHd5bRWokNqzHcZQEdSHKRuE,9033
|
4
4
|
utilities/asyncio.py,sha256=PUedzQ5deqlSECQ33sam9cRzI9TnygHz3FdOqWJWPTM,15288
|
@@ -54,9 +54,9 @@ utilities/pqdm.py,sha256=idv2seRVP2f6NeSfpeEnT5A-tQezaHZKDyeu16g2-0E,3091
|
|
54
54
|
utilities/psutil.py,sha256=KUlu4lrUw9Zg1V7ZGetpWpGb9DB8l_SSDWGbANFNCPU,2104
|
55
55
|
utilities/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
56
56
|
utilities/pydantic_settings.py,sha256=bFr9UDrVhdqTl7O_TPutCLdsQ5rUp--nO76-_F8z0bs,5102
|
57
|
-
utilities/pydantic_settings_sops.py,sha256=
|
57
|
+
utilities/pydantic_settings_sops.py,sha256=m2uB9wDw1PU2CiSL7KwxulDXT0STjOZTu3Ctc2q7jc0,1943
|
58
58
|
utilities/pyinstrument.py,sha256=hnXaL-4HE7wWBI5JKaPfYTpsrXe68YiuZKahHV0VJn8,841
|
59
|
-
utilities/pytest.py,sha256=
|
59
|
+
utilities/pytest.py,sha256=pl4j9-GReiYQMZkAFOGxsHIO_DcTHbJ_VaiLPFrw57g,8370
|
60
60
|
utilities/pytest_regressions.py,sha256=ocjHTtfOeiGfQAKIei8pKNd61sxN9dawrJJ9gPt2wzA,4097
|
61
61
|
utilities/random.py,sha256=hZlH4gnAtoaofWswuJYjcygejrY8db4CzP-z_adO2Mo,4165
|
62
62
|
utilities/re.py,sha256=S4h-DLL6ScMPqjboZ_uQ1BVTJajrqV06r_81D--_HCE,4573
|
@@ -90,9 +90,9 @@ utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
|
|
90
90
|
utilities/zoneinfo.py,sha256=tdIScrTB2-B-LH0ukb1HUXKooLknOfJNwHk10MuMYvA,3619
|
91
91
|
utilities/pytest_plugins/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
92
92
|
utilities/pytest_plugins/pytest_randomly.py,sha256=B1qYVlExGOxTywq2r1SMi5o7btHLk2PNdY_b1p98dkE,409
|
93
|
-
utilities/pytest_plugins/pytest_regressions.py,sha256=
|
94
|
-
dycw_utilities-0.166.
|
95
|
-
dycw_utilities-0.166.
|
96
|
-
dycw_utilities-0.166.
|
97
|
-
dycw_utilities-0.166.
|
98
|
-
dycw_utilities-0.166.
|
93
|
+
utilities/pytest_plugins/pytest_regressions.py,sha256=mnHYBfdprz50UGVkVzV1bZERZN5CFfoF8YbokGxdFwU,1639
|
94
|
+
dycw_utilities-0.166.21.dist-info/METADATA,sha256=QaOBA9ZPw7DqBXar1Vm0SZ4xiZoAMnLI9yKI4e84jTU,1702
|
95
|
+
dycw_utilities-0.166.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
96
|
+
dycw_utilities-0.166.21.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
|
97
|
+
dycw_utilities-0.166.21.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
98
|
+
dycw_utilities-0.166.21.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
@@ -7,6 +7,7 @@ from pydantic_settings_sops import SOPSConfigSettingsSource
|
|
7
7
|
|
8
8
|
from utilities.pydantic_settings import (
|
9
9
|
CustomBaseSettings,
|
10
|
+
PathLikeOrWithSection,
|
10
11
|
_ensure_section,
|
11
12
|
_get_section,
|
12
13
|
)
|
@@ -17,14 +18,14 @@ if TYPE_CHECKING:
|
|
17
18
|
from pydantic_settings import BaseSettings, PydanticBaseSettingsSource
|
18
19
|
from pydantic_settings.sources import PathType
|
19
20
|
|
20
|
-
from utilities.types import MaybeSequenceStr
|
21
|
+
from utilities.types import MaybeSequenceStr
|
21
22
|
|
22
23
|
|
23
24
|
class SopsBaseSettings(CustomBaseSettings):
|
24
25
|
"""Base settings for loading secrets using `sops/age`."""
|
25
26
|
|
26
27
|
# paths
|
27
|
-
secret_files: ClassVar[Sequence[
|
28
|
+
secret_files: ClassVar[Sequence[PathLikeOrWithSection]] = []
|
28
29
|
|
29
30
|
@classmethod
|
30
31
|
@override
|
utilities/pytest.py
CHANGED
@@ -13,7 +13,13 @@ from utilities.atomicwrites import writer
|
|
13
13
|
from utilities.functools import cache
|
14
14
|
from utilities.hashlib import md5_hash
|
15
15
|
from utilities.os import get_env_var
|
16
|
-
from utilities.pathlib import
|
16
|
+
from utilities.pathlib import (
|
17
|
+
_GetTailEmptyError,
|
18
|
+
ensure_suffix,
|
19
|
+
get_root,
|
20
|
+
get_tail,
|
21
|
+
module_path,
|
22
|
+
)
|
17
23
|
from utilities.platform import (
|
18
24
|
IS_LINUX,
|
19
25
|
IS_MAC,
|
@@ -118,10 +124,15 @@ def node_id_path(
|
|
118
124
|
path_file, *parts = node_id.split("::")
|
119
125
|
path_file = Path(path_file)
|
120
126
|
if path_file.suffix != ".py":
|
121
|
-
raise
|
127
|
+
raise _NodeIdToPathNotPythonFileError(node_id=node_id)
|
122
128
|
path = path_file.with_suffix("")
|
123
129
|
if root is not None:
|
124
|
-
|
130
|
+
try:
|
131
|
+
path = get_tail(path, root)
|
132
|
+
except _GetTailEmptyError as error:
|
133
|
+
raise _NodeIdToPathNotGetTailError(
|
134
|
+
node_id=node_id, path=error.path, root=error.root
|
135
|
+
) from None
|
125
136
|
path = Path(module_path(path), "__".join(parts))
|
126
137
|
if suffix is not None:
|
127
138
|
path = ensure_suffix(path, suffix)
|
@@ -132,11 +143,26 @@ def node_id_path(
|
|
132
143
|
class NodeIdToPathError(Exception):
|
133
144
|
node_id: str
|
134
145
|
|
146
|
+
|
147
|
+
@dataclass(kw_only=True, slots=True)
|
148
|
+
class _NodeIdToPathNotPythonFileError(NodeIdToPathError):
|
135
149
|
@override
|
136
150
|
def __str__(self) -> str:
|
137
151
|
return f"Node ID must be a Python file; got {self.node_id!r}"
|
138
152
|
|
139
153
|
|
154
|
+
@dataclass(kw_only=True, slots=True)
|
155
|
+
class _NodeIdToPathNotGetTailError(NodeIdToPathError):
|
156
|
+
path: PathLike
|
157
|
+
root: PathLike
|
158
|
+
|
159
|
+
@override
|
160
|
+
def __str__(self) -> str:
|
161
|
+
return (
|
162
|
+
f"Unable to get the tail of {str(self.path)!r} with root {str(self.root)!r}"
|
163
|
+
)
|
164
|
+
|
165
|
+
|
140
166
|
##
|
141
167
|
|
142
168
|
|
@@ -41,11 +41,15 @@ else:
|
|
41
41
|
|
42
42
|
def _get_path(request: FixtureRequest, /) -> Path:
|
43
43
|
from utilities.pathlib import get_root
|
44
|
-
from utilities.pytest import node_id_path
|
44
|
+
from utilities.pytest import _NodeIdToPathNotGetTailError, node_id_path
|
45
45
|
|
46
46
|
path = Path(cast("Any", request).fspath)
|
47
47
|
root = Path("src", "tests")
|
48
|
-
|
48
|
+
try:
|
49
|
+
tail = node_id_path(request.node.nodeid, root=root)
|
50
|
+
except _NodeIdToPathNotGetTailError:
|
51
|
+
root = Path("tests")
|
52
|
+
tail = node_id_path(request.node.nodeid, root=root)
|
49
53
|
return get_root(path).joinpath(root, "regressions", tail)
|
50
54
|
|
51
55
|
|
File without changes
|
File without changes
|
File without changes
|