encommon 0.7.3__tar.gz → 0.7.4__tar.gz
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.
- {encommon-0.7.3/encommon.egg-info → encommon-0.7.4}/PKG-INFO +1 -1
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/sample.py +13 -9
- encommon-0.7.4/encommon/version.txt +1 -0
- {encommon-0.7.3 → encommon-0.7.4/encommon.egg-info}/PKG-INFO +1 -1
- {encommon-0.7.3 → encommon-0.7.4}/setup.cfg +2 -1
- encommon-0.7.3/encommon/version.txt +0 -1
- {encommon-0.7.3 → encommon-0.7.4}/LICENSE +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/MANIFEST.in +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/README.md +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/common.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/config.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/files.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/logger.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/params.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/paths.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/test_common.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/test_config.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/test_files.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/test_logger.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/test_paths.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/conftest.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/crypts.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/hashes.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/params.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/test/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/test/test_crypts.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/test/test_hashes.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/py.typed +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/common.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/duration.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/parse.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_common.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_duration.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_parse.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_timers.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_times.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_window.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/timers.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/times.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/times/window.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/types/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/types/dicts.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/types/empty.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/types/strings.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/types/test/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/types/test/test_dicts.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/types/test/test_empty.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/types/test/test_strings.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/common.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/match.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/paths.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/stdout.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/test/__init__.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/test/test_match.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/test/test_paths.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/test/test_sample.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/test/test_stdout.py +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon.egg-info/SOURCES.txt +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon.egg-info/dependency_links.txt +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon.egg-info/requires.txt +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/encommon.egg-info/top_level.txt +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/pyproject.toml +0 -0
- {encommon-0.7.3 → encommon-0.7.4}/reqs-install.txt +0 -0
@@ -20,11 +20,11 @@ from .. import WORKSPACE
|
|
20
20
|
|
21
21
|
|
22
22
|
def prep_sample(
|
23
|
-
content: Any,
|
23
|
+
content: Any,
|
24
24
|
*,
|
25
25
|
default: Callable[[Any], str] = str,
|
26
|
-
replace: Optional[dict[str, str]] = None,
|
27
|
-
) -> Any:
|
26
|
+
replace: Optional[dict[str, str | Path]] = None,
|
27
|
+
) -> Any:
|
28
28
|
"""
|
29
29
|
Return the content after processing using JSON functions.
|
30
30
|
|
@@ -55,10 +55,14 @@ def prep_sample(
|
|
55
55
|
replace = replace or {}
|
56
56
|
|
57
57
|
replace |= {
|
58
|
-
'PROJECT':
|
59
|
-
'WORKSPACE':
|
58
|
+
'PROJECT': PROJECT,
|
59
|
+
'WORKSPACE': WORKSPACE}
|
60
60
|
|
61
61
|
for old, new in replace.items():
|
62
|
+
|
63
|
+
if isinstance(new, Path):
|
64
|
+
new = str(new)
|
65
|
+
|
62
66
|
content = content.replace(
|
63
67
|
new, f'_/{prefix}/{old}/_')
|
64
68
|
|
@@ -72,8 +76,8 @@ def load_sample(
|
|
72
76
|
update: bool = False,
|
73
77
|
*,
|
74
78
|
default: Callable[[Any], str] = str,
|
75
|
-
replace: Optional[dict[str, str]] = None,
|
76
|
-
) -> Any:
|
79
|
+
replace: Optional[dict[str, str | Path]] = None,
|
80
|
+
) -> Any:
|
77
81
|
"""
|
78
82
|
Load the sample file and compare using provided content.
|
79
83
|
|
@@ -115,7 +119,7 @@ def load_sample(
|
|
115
119
|
dumps(content, indent=2))
|
116
120
|
|
117
121
|
|
118
|
-
def _load_sample() -> Any:
|
122
|
+
def _load_sample() -> Any:
|
119
123
|
return loads(
|
120
124
|
path.read_text(
|
121
125
|
encoding='utf-8'))
|
@@ -124,7 +128,7 @@ def load_sample(
|
|
124
128
|
if path.exists():
|
125
129
|
loaded = _load_sample()
|
126
130
|
|
127
|
-
if not path.exists():
|
131
|
+
if not path.exists():
|
128
132
|
_save_sample()
|
129
133
|
|
130
134
|
elif (update is True
|
@@ -0,0 +1 @@
|
|
1
|
+
0.7.4
|
@@ -12,6 +12,7 @@ ignore =
|
|
12
12
|
per-file-ignores =
|
13
13
|
encommon/crypts/hashes.py:S324,
|
14
14
|
encommon/times/timers.py:S608,
|
15
|
+
encommon/utils/sample.py:ANN401,SIM114,
|
15
16
|
encommon/utils/stdout.py:SIM114,
|
16
17
|
encommon/utils/test/test_stdout.py:LIT015,
|
17
18
|
|
@@ -21,7 +22,7 @@ strict = True
|
|
21
22
|
|
22
23
|
[coverage:report]
|
23
24
|
exclude_lines =
|
24
|
-
|
25
|
+
NOCVR
|
25
26
|
if TYPE_CHECKING
|
26
27
|
|
27
28
|
[egg_info]
|
@@ -1 +0,0 @@
|
|
1
|
-
0.7.3
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|