encommon 0.7.0__tar.gz → 0.7.1__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.0/encommon.egg-info → encommon-0.7.1}/PKG-INFO +1 -1
  2. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/logger.py +10 -1
  3. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/test/test_logger.py +11 -7
  4. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/stdout.py +5 -2
  5. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/test/test_stdout.py +2 -2
  6. encommon-0.7.1/encommon/version.txt +1 -0
  7. {encommon-0.7.0 → encommon-0.7.1/encommon.egg-info}/PKG-INFO +1 -1
  8. encommon-0.7.0/encommon/version.txt +0 -1
  9. {encommon-0.7.0 → encommon-0.7.1}/LICENSE +0 -0
  10. {encommon-0.7.0 → encommon-0.7.1}/MANIFEST.in +0 -0
  11. {encommon-0.7.0 → encommon-0.7.1}/README.md +0 -0
  12. {encommon-0.7.0 → encommon-0.7.1}/encommon/__init__.py +0 -0
  13. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/__init__.py +0 -0
  14. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/common.py +0 -0
  15. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/config.py +0 -0
  16. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/files.py +0 -0
  17. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/params.py +0 -0
  18. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/paths.py +0 -0
  19. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/test/__init__.py +0 -0
  20. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/test/test_common.py +0 -0
  21. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/test/test_config.py +0 -0
  22. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/test/test_files.py +0 -0
  23. {encommon-0.7.0 → encommon-0.7.1}/encommon/config/test/test_paths.py +0 -0
  24. {encommon-0.7.0 → encommon-0.7.1}/encommon/conftest.py +0 -0
  25. {encommon-0.7.0 → encommon-0.7.1}/encommon/crypts/__init__.py +0 -0
  26. {encommon-0.7.0 → encommon-0.7.1}/encommon/crypts/crypts.py +0 -0
  27. {encommon-0.7.0 → encommon-0.7.1}/encommon/crypts/hashes.py +0 -0
  28. {encommon-0.7.0 → encommon-0.7.1}/encommon/crypts/params.py +0 -0
  29. {encommon-0.7.0 → encommon-0.7.1}/encommon/crypts/test/__init__.py +0 -0
  30. {encommon-0.7.0 → encommon-0.7.1}/encommon/crypts/test/test_crypts.py +0 -0
  31. {encommon-0.7.0 → encommon-0.7.1}/encommon/crypts/test/test_hashes.py +0 -0
  32. {encommon-0.7.0 → encommon-0.7.1}/encommon/py.typed +0 -0
  33. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/__init__.py +0 -0
  34. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/common.py +0 -0
  35. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/duration.py +0 -0
  36. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/parse.py +0 -0
  37. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/test/__init__.py +0 -0
  38. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/test/test_common.py +0 -0
  39. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/test/test_duration.py +0 -0
  40. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/test/test_parse.py +0 -0
  41. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/test/test_timers.py +0 -0
  42. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/test/test_times.py +0 -0
  43. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/test/test_window.py +0 -0
  44. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/timers.py +0 -0
  45. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/times.py +0 -0
  46. {encommon-0.7.0 → encommon-0.7.1}/encommon/times/window.py +0 -0
  47. {encommon-0.7.0 → encommon-0.7.1}/encommon/types/__init__.py +0 -0
  48. {encommon-0.7.0 → encommon-0.7.1}/encommon/types/dicts.py +0 -0
  49. {encommon-0.7.0 → encommon-0.7.1}/encommon/types/empty.py +0 -0
  50. {encommon-0.7.0 → encommon-0.7.1}/encommon/types/strings.py +0 -0
  51. {encommon-0.7.0 → encommon-0.7.1}/encommon/types/test/__init__.py +0 -0
  52. {encommon-0.7.0 → encommon-0.7.1}/encommon/types/test/test_dicts.py +0 -0
  53. {encommon-0.7.0 → encommon-0.7.1}/encommon/types/test/test_empty.py +0 -0
  54. {encommon-0.7.0 → encommon-0.7.1}/encommon/types/test/test_strings.py +0 -0
  55. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/__init__.py +0 -0
  56. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/common.py +0 -0
  57. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/match.py +0 -0
  58. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/paths.py +0 -0
  59. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/sample.py +0 -0
  60. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/test/__init__.py +0 -0
  61. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/test/test_match.py +0 -0
  62. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/test/test_paths.py +0 -0
  63. {encommon-0.7.0 → encommon-0.7.1}/encommon/utils/test/test_sample.py +0 -0
  64. {encommon-0.7.0 → encommon-0.7.1}/encommon.egg-info/SOURCES.txt +0 -0
  65. {encommon-0.7.0 → encommon-0.7.1}/encommon.egg-info/dependency_links.txt +0 -0
  66. {encommon-0.7.0 → encommon-0.7.1}/encommon.egg-info/requires.txt +0 -0
  67. {encommon-0.7.0 → encommon-0.7.1}/encommon.egg-info/top_level.txt +0 -0
  68. {encommon-0.7.0 → encommon-0.7.1}/pyproject.toml +0 -0
  69. {encommon-0.7.0 → encommon-0.7.1}/reqs-install.txt +0 -0
  70. {encommon-0.7.0 → encommon-0.7.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3
@@ -60,7 +60,7 @@ class Message:
60
60
  -------
61
61
  >>> message = Message('info', '1970-01-01', foo='bar')
62
62
  >>> strip_ansi(message.stdo_output)
63
- 'level="info" time="1970-01-01T00:00:00+0000" foo="bar"'
63
+ 'level="info" time="1970-01-01T00:00:00Z" foo="bar"'
64
64
 
65
65
  :param level: Severity which log message is classified.
66
66
  :param time: What time the log message actually occurred.
@@ -95,6 +95,10 @@ class Message:
95
95
  if value in [None, Empty]:
96
96
  continue
97
97
 
98
+ if (key == 'elapsed'
99
+ and isinstance(value, float)):
100
+ value = round(value, 2)
101
+
98
102
  value = str(value)
99
103
 
100
104
  self.__fields[key] = value
@@ -190,6 +194,11 @@ class Message:
190
194
  fields |= dict(self.__fields)
191
195
 
192
196
 
197
+ fields['time'] = (
198
+ fields['time']
199
+ .replace('+0000', 'Z'))
200
+
201
+
193
202
  output: list[str] = []
194
203
 
195
204
  for key, value in fields.items():
@@ -14,7 +14,6 @@ from _pytest.logging import LogCaptureFixture
14
14
 
15
15
  from ..logger import Logger
16
16
  from ..logger import Message
17
- from ...times.common import UNIXEPOCH
18
17
  from ...times.common import UNIXMPOCH
19
18
  from ...utils.stdout import strip_ansi
20
19
 
@@ -35,7 +34,8 @@ def test_Message() -> None:
35
34
  int=1,
36
35
  list=[1, '2', 3],
37
36
  none=None,
38
- string='foo')
37
+ string='foo',
38
+ elapsed=0.69420)
39
39
 
40
40
  attrs = list(message.__dict__)
41
41
 
@@ -60,7 +60,8 @@ def test_Message() -> None:
60
60
  'float="1.0", '
61
61
  'int="1", '
62
62
  'list="[1, \'2\', 3]", '
63
- 'string="foo")')
63
+ 'string="foo", '
64
+ 'elapsed="0.69")')
64
65
 
65
66
  assert str(message) == repr(message)
66
67
 
@@ -73,19 +74,21 @@ def test_Message() -> None:
73
74
  'float': '1.0',
74
75
  'int': '1',
75
76
  'list': "[1, '2', 3]",
76
- 'string': 'foo'}
77
+ 'string': 'foo',
78
+ 'elapsed': '0.69'}
77
79
 
78
80
 
79
81
  output = strip_ansi(message.stdo_output)
80
82
 
81
83
  assert output == (
82
84
  'level="info"'
83
- f' time="{UNIXEPOCH}"'
85
+ ' time="1970-01-01T00:00:00Z"'
84
86
  ' dict="{\'foo\': \'bar\'}"'
85
87
  ' float="1.0"'
86
88
  ' int="1"'
87
89
  ' list="[1, \'2\', 3]"'
88
- ' string="foo"')
90
+ ' string="foo"'
91
+ ' elapsed="0.69"')
89
92
 
90
93
 
91
94
  assert message.file_output == (
@@ -95,7 +98,8 @@ def test_Message() -> None:
95
98
  ' "float": "1.0",'
96
99
  ' "int": "1",'
97
100
  ' "list": "[1, \'2\', 3]",'
98
- ' "string": "foo"}')
101
+ ' "string": "foo",'
102
+ ' "elapsed": "0.69"}')
99
103
 
100
104
 
101
105
 
@@ -200,13 +200,16 @@ def array_ansi( # noqa: CFQ001, CFQ004
200
200
  return output.append(
201
201
  f'{prefix} {repeat}')
202
202
 
203
- refers.add(id(value))
203
+
204
+ if isinstance(value, list | tuple | dict):
205
+ refers.add(id(value))
204
206
 
205
207
 
206
208
  types = {
207
- 'dict': dict,
208
209
  'list': list,
209
210
  'tuple': tuple,
211
+ 'dict': dict,
212
+ 'frozenset': frozenset,
210
213
  'set': set}
211
214
 
212
215
  for name, _type in types.items():
@@ -223,9 +223,9 @@ def test_array_ansi() -> None: # noqa: CFQ001
223
223
  ' - 2\n'
224
224
  ' bool: False\n'
225
225
  ' dict: dict\n'
226
- ' str: REPEAT\n'
226
+ " str: 'value'\n"
227
227
  ' list: REPEAT\n'
228
- ' bool: REPEAT\n'
228
+ ' bool: False\n'
229
229
  'Empty: Empty\n'
230
230
  'Duration: 2d5h\n'
231
231
  f'Times: {UNIXMPOCH}')
@@ -0,0 +1 @@
1
+ 0.7.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: Enasis Network Common Library
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1 +0,0 @@
1
- 0.7.0
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