PySerials 0.0.0.dev6__tar.gz → 0.0.0.dev7__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 (23) hide show
  1. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/PKG-INFO +3 -4
  2. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/pyproject.toml +3 -4
  3. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/PySerials.egg-info/PKG-INFO +3 -4
  4. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/PySerials.egg-info/requires.txt +2 -3
  5. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/exception/read.py +8 -7
  6. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/exception/validate.py +5 -5
  7. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/README.md +0 -0
  8. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/setup.cfg +0 -0
  9. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/PySerials.egg-info/SOURCES.txt +0 -0
  10. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/PySerials.egg-info/dependency_links.txt +0 -0
  11. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/PySerials.egg-info/not-zip-safe +0 -0
  12. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/PySerials.egg-info/top_level.txt +0 -0
  13. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/__init__.py +0 -0
  14. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/compare.py +0 -0
  15. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/exception/__init__.py +0 -0
  16. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/exception/_base.py +0 -0
  17. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/exception/update.py +0 -0
  18. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/format.py +0 -0
  19. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/nested_dict.py +0 -0
  20. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/read.py +0 -0
  21. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/update.py +0 -0
  22. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/validate.py +0 -0
  23. {pyserials-0.0.0.dev6 → pyserials-0.0.0.dev7}/src/pyserials/write.py +0 -0
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySerials
3
- Version: 0.0.0.dev6
3
+ Version: 0.0.0.dev7
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: jsonschema<5,>=4.21.0
6
6
  Requires-Dist: ruamel.yaml<0.18,>=0.17.32
7
7
  Requires-Dist: ruamel.yaml.string<1,>=0.1.1
8
8
  Requires-Dist: tomlkit<0.12,>=0.11.8
9
- Requires-Dist: mdit
10
- Requires-Dist: ansi-sgr
11
- Requires-Dist: ExceptionMan
9
+ Requires-Dist: MDit==0.0.0.dev3
10
+ Requires-Dist: ExceptionMan==0.0.0.dev4
12
11
  Requires-Dist: jsonpath-ng<2,>=1.6.1
@@ -17,16 +17,15 @@ namespaces = true
17
17
  # ----------------------------------------- Project Metadata -------------------------------------
18
18
  #
19
19
  [project]
20
- version = "0.0.0.dev6"
20
+ version = "0.0.0.dev7"
21
21
  name = "PySerials"
22
22
  dependencies = [
23
23
  "jsonschema >= 4.21.0, < 5",
24
24
  "ruamel.yaml >= 0.17.32, < 0.18", # https://yaml.readthedocs.io/en/stable/
25
25
  "ruamel.yaml.string >= 0.1.1, < 1",
26
26
  "tomlkit >= 0.11.8, < 0.12", # https://tomlkit.readthedocs.io/en/stable/,
27
- "mdit",
28
- "ansi-sgr",
29
- "ExceptionMan",
27
+ "MDit == 0.0.0.dev3",
28
+ "ExceptionMan == 0.0.0.dev4",
30
29
  "jsonpath-ng >= 1.6.1, < 2",
31
30
  ]
32
31
  requires-python = ">=3.10"
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySerials
3
- Version: 0.0.0.dev6
3
+ Version: 0.0.0.dev7
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: jsonschema<5,>=4.21.0
6
6
  Requires-Dist: ruamel.yaml<0.18,>=0.17.32
7
7
  Requires-Dist: ruamel.yaml.string<1,>=0.1.1
8
8
  Requires-Dist: tomlkit<0.12,>=0.11.8
9
- Requires-Dist: mdit
10
- Requires-Dist: ansi-sgr
11
- Requires-Dist: ExceptionMan
9
+ Requires-Dist: MDit==0.0.0.dev3
10
+ Requires-Dist: ExceptionMan==0.0.0.dev4
12
11
  Requires-Dist: jsonpath-ng<2,>=1.6.1
@@ -2,7 +2,6 @@ jsonschema<5,>=4.21.0
2
2
  ruamel.yaml<0.18,>=0.17.32
3
3
  ruamel.yaml.string<1,>=0.1.1
4
4
  tomlkit<0.12,>=0.11.8
5
- mdit
6
- ansi-sgr
7
- ExceptionMan
5
+ MDit==0.0.0.dev3
6
+ ExceptionMan==0.0.0.dev4
8
7
  jsonpath-ng<2,>=1.6.1
@@ -35,12 +35,13 @@ class PySerialsReadException(_base.PySerialsException):
35
35
  filepath: _Path | None = None,
36
36
  ):
37
37
  intro = _mdit.inline_container(
38
- "Failed to read ",
39
- f"{data_type.upper()} data " if data_type else "data ",
40
- "from input ",
38
+ "Failed to read",
39
+ f"{data_type.upper()} data" if data_type else "data",
40
+ "from input",
41
41
  "string." if source_type == "string" else _mdit.inline_container(
42
42
  "file at ", _mdit.element.code_span(filepath), "."
43
43
  ),
44
+ separator=" ",
44
45
  )
45
46
  report = _mdit.document(
46
47
  heading="Data Read Error",
@@ -175,7 +176,7 @@ class PySerialsInvalidDataError(PySerialsReadException):
175
176
 
176
177
  def _report_content(self) -> dict:
177
178
 
178
- def make_tabel(problem, line, column, data_type):
179
+ def make_table(problem, line, column, data_type):
179
180
  items = [
180
181
  _mdit.element.field_list_item(title=title, description=value) for title, value in [
181
182
  ["Description", problem],
@@ -188,16 +189,16 @@ class PySerialsInvalidDataError(PySerialsReadException):
188
189
 
189
190
  content = {
190
191
  "problem_details": _mdit.element.admonition(
192
+ make_table(self.problem, self.problem_line, self.problem_column, self.problem_data_type),
191
193
  type="error",
192
194
  title="Problem",
193
- content=make_tabel(self.problem, self.problem_line, self.problem_column, self.problem_data_type)
194
195
  )
195
196
  }
196
197
  if self.context:
197
198
  content["context_details"] = _mdit.element.admonition(
199
+ make_table(self.context, self.context_line, self.context_column, self.context_data_type),
198
200
  type="note",
199
201
  title="Context",
200
- content=make_tabel(self.context, self.context_line, self.context_column, self.context_data_type)
201
202
  )
202
203
 
203
204
  code_block_full = _mdit.element.code_block(
@@ -235,6 +236,6 @@ class PySerialsInvalidDataError(PySerialsReadException):
235
236
  emphasize_lines=list({1, len(selected_lines)}),
236
237
  )
237
238
  content["data_short"] = (code_block_short, ("short", "console"))
238
- container = _mdit.block_container(**content)
239
+ container = _mdit.block_container(content)
239
240
  doc = _mdit.document(heading="Error Details", body=container)
240
241
  return {"details": doc}
@@ -26,7 +26,7 @@ class PySerialsValidateException(_base.PySerialsException):
26
26
 
27
27
  def __init__(
28
28
  self,
29
- problem: str,
29
+ problem,
30
30
  data: dict | list | str | int | float | bool,
31
31
  schema: dict,
32
32
  validator: _Any,
@@ -88,7 +88,7 @@ class PySerialsJsonSchemaValidationError(PySerialsValidateException):
88
88
  self.causes = causes
89
89
  super().__init__(
90
90
  problem=self._generate_problem_statement(),
91
- section={idx: self._generate_error_report(error) for idx, error in enumerate(self.causes)},
91
+ section={str(idx): self._generate_error_report(error) for idx, error in enumerate(self.causes)},
92
92
  data=data,
93
93
  schema=schema,
94
94
  validator=validator,
@@ -145,7 +145,7 @@ class PySerialsJsonSchemaValidationError(PySerialsValidateException):
145
145
  if error.context:
146
146
  context_paths = []
147
147
  for idx, sub_error in enumerate(sorted(error.context, key=lambda x: len(x.context))):
148
- section[idx] = self._generate_error_report(sub_error)
148
+ section[str(idx)] = self._generate_error_report(sub_error)
149
149
  context_paths.append(_mdit.element.code_span(sub_error.json_path))
150
150
  context_paths_joined = self._join_list(context_paths)
151
151
  short_ver_fieldlist_items.insert(
@@ -163,7 +163,7 @@ class PySerialsJsonSchemaValidationError(PySerialsValidateException):
163
163
  heading=_mdit.element.code_span(error.json_path),
164
164
  body={
165
165
  "short": (_mdit.element.field_list(short_ver_fieldlist_items), ("short", "console")),
166
- "full": (_mdit.element.field_list(full_ver_items), "full"),
166
+ "full": (_mdit.block_container(*full_ver_items), "full"),
167
167
  },
168
168
  section=section,
169
169
  )
@@ -176,9 +176,9 @@ class PySerialsJsonSchemaValidationError(PySerialsValidateException):
176
176
  language="yaml",
177
177
  )
178
178
  admo = _mdit.element.admonition(
179
+ code_block,
179
180
  type=admo_type,
180
181
  title=_mdit.inline_container(f"**{title}**: ", _mdit.element.code_span(title_details)),
181
- content=code_block,
182
182
  dropdown=True,
183
183
  )
184
184
  return admo
File without changes
File without changes