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.
Files changed (70) hide show
  1. {encommon-0.7.3/encommon.egg-info → encommon-0.7.4}/PKG-INFO +1 -1
  2. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/sample.py +13 -9
  3. encommon-0.7.4/encommon/version.txt +1 -0
  4. {encommon-0.7.3 → encommon-0.7.4/encommon.egg-info}/PKG-INFO +1 -1
  5. {encommon-0.7.3 → encommon-0.7.4}/setup.cfg +2 -1
  6. encommon-0.7.3/encommon/version.txt +0 -1
  7. {encommon-0.7.3 → encommon-0.7.4}/LICENSE +0 -0
  8. {encommon-0.7.3 → encommon-0.7.4}/MANIFEST.in +0 -0
  9. {encommon-0.7.3 → encommon-0.7.4}/README.md +0 -0
  10. {encommon-0.7.3 → encommon-0.7.4}/encommon/__init__.py +0 -0
  11. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/__init__.py +0 -0
  12. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/common.py +0 -0
  13. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/config.py +0 -0
  14. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/files.py +0 -0
  15. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/logger.py +0 -0
  16. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/params.py +0 -0
  17. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/paths.py +0 -0
  18. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/__init__.py +0 -0
  19. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/test_common.py +0 -0
  20. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/test_config.py +0 -0
  21. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/test_files.py +0 -0
  22. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/test_logger.py +0 -0
  23. {encommon-0.7.3 → encommon-0.7.4}/encommon/config/test/test_paths.py +0 -0
  24. {encommon-0.7.3 → encommon-0.7.4}/encommon/conftest.py +0 -0
  25. {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/__init__.py +0 -0
  26. {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/crypts.py +0 -0
  27. {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/hashes.py +0 -0
  28. {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/params.py +0 -0
  29. {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/test/__init__.py +0 -0
  30. {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/test/test_crypts.py +0 -0
  31. {encommon-0.7.3 → encommon-0.7.4}/encommon/crypts/test/test_hashes.py +0 -0
  32. {encommon-0.7.3 → encommon-0.7.4}/encommon/py.typed +0 -0
  33. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/__init__.py +0 -0
  34. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/common.py +0 -0
  35. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/duration.py +0 -0
  36. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/parse.py +0 -0
  37. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/__init__.py +0 -0
  38. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_common.py +0 -0
  39. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_duration.py +0 -0
  40. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_parse.py +0 -0
  41. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_timers.py +0 -0
  42. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_times.py +0 -0
  43. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/test/test_window.py +0 -0
  44. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/timers.py +0 -0
  45. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/times.py +0 -0
  46. {encommon-0.7.3 → encommon-0.7.4}/encommon/times/window.py +0 -0
  47. {encommon-0.7.3 → encommon-0.7.4}/encommon/types/__init__.py +0 -0
  48. {encommon-0.7.3 → encommon-0.7.4}/encommon/types/dicts.py +0 -0
  49. {encommon-0.7.3 → encommon-0.7.4}/encommon/types/empty.py +0 -0
  50. {encommon-0.7.3 → encommon-0.7.4}/encommon/types/strings.py +0 -0
  51. {encommon-0.7.3 → encommon-0.7.4}/encommon/types/test/__init__.py +0 -0
  52. {encommon-0.7.3 → encommon-0.7.4}/encommon/types/test/test_dicts.py +0 -0
  53. {encommon-0.7.3 → encommon-0.7.4}/encommon/types/test/test_empty.py +0 -0
  54. {encommon-0.7.3 → encommon-0.7.4}/encommon/types/test/test_strings.py +0 -0
  55. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/__init__.py +0 -0
  56. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/common.py +0 -0
  57. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/match.py +0 -0
  58. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/paths.py +0 -0
  59. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/stdout.py +0 -0
  60. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/test/__init__.py +0 -0
  61. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/test/test_match.py +0 -0
  62. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/test/test_paths.py +0 -0
  63. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/test/test_sample.py +0 -0
  64. {encommon-0.7.3 → encommon-0.7.4}/encommon/utils/test/test_stdout.py +0 -0
  65. {encommon-0.7.3 → encommon-0.7.4}/encommon.egg-info/SOURCES.txt +0 -0
  66. {encommon-0.7.3 → encommon-0.7.4}/encommon.egg-info/dependency_links.txt +0 -0
  67. {encommon-0.7.3 → encommon-0.7.4}/encommon.egg-info/requires.txt +0 -0
  68. {encommon-0.7.3 → encommon-0.7.4}/encommon.egg-info/top_level.txt +0 -0
  69. {encommon-0.7.3 → encommon-0.7.4}/pyproject.toml +0 -0
  70. {encommon-0.7.3 → encommon-0.7.4}/reqs-install.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.7.3
3
+ Version: 0.7.4
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3
@@ -20,11 +20,11 @@ from .. import WORKSPACE
20
20
 
21
21
 
22
22
  def prep_sample(
23
- content: Any, # noqa: ANN401
23
+ content: Any,
24
24
  *,
25
25
  default: Callable[[Any], str] = str,
26
- replace: Optional[dict[str, str]] = None,
27
- ) -> Any: # noqa: ANN401
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': str(PROJECT.resolve()),
59
- 'WORKSPACE': str(WORKSPACE.resolve())}
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: # noqa: ANN401
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: # noqa: ANN401
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(): # noqa: SIM114
131
+ if not path.exists():
128
132
  _save_sample()
129
133
 
130
134
  elif (update is True
@@ -0,0 +1 @@
1
+ 0.7.4
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.7.3
3
+ Version: 0.7.4
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3
@@ -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
- pragma: no cover
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