hardpy 0.7.0__py3-none-any.whl → 0.9.0__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.
Files changed (32) hide show
  1. hardpy/__init__.py +27 -27
  2. hardpy/cli/cli.py +1 -2
  3. hardpy/common/config.py +8 -8
  4. hardpy/hardpy_panel/frontend/dist/asset-manifest.json +3 -3
  5. hardpy/hardpy_panel/frontend/dist/index.html +1 -1
  6. hardpy/hardpy_panel/frontend/dist/logo192.png +0 -0
  7. hardpy/hardpy_panel/frontend/dist/static/css/main.e8a862f1.css.map +1 -1
  8. hardpy/hardpy_panel/frontend/dist/static/js/main.403e9cd8.js +3 -0
  9. hardpy/hardpy_panel/frontend/dist/static/js/main.403e9cd8.js.map +1 -0
  10. hardpy/pytest_hardpy/db/__init__.py +1 -1
  11. hardpy/pytest_hardpy/db/base_connector.py +1 -1
  12. hardpy/pytest_hardpy/db/base_store.py +9 -0
  13. hardpy/pytest_hardpy/db/const.py +5 -0
  14. hardpy/pytest_hardpy/db/schema/v1.py +14 -7
  15. hardpy/pytest_hardpy/db/statestore.py +0 -11
  16. hardpy/pytest_hardpy/plugin.py +56 -64
  17. hardpy/pytest_hardpy/pytest_call.py +84 -44
  18. hardpy/pytest_hardpy/pytest_wrapper.py +4 -5
  19. hardpy/pytest_hardpy/reporter/__init__.py +1 -1
  20. hardpy/pytest_hardpy/reporter/hook_reporter.py +3 -2
  21. hardpy/pytest_hardpy/result/__init__.py +1 -1
  22. hardpy/pytest_hardpy/utils/__init__.py +16 -12
  23. hardpy/pytest_hardpy/utils/dialog_box.py +91 -54
  24. hardpy/pytest_hardpy/utils/exception.py +6 -0
  25. {hardpy-0.7.0.dist-info → hardpy-0.9.0.dist-info}/METADATA +11 -8
  26. {hardpy-0.7.0.dist-info → hardpy-0.9.0.dist-info}/RECORD +30 -29
  27. hardpy/hardpy_panel/frontend/dist/static/js/main.942e57d4.js +0 -3
  28. hardpy/hardpy_panel/frontend/dist/static/js/main.942e57d4.js.map +0 -1
  29. /hardpy/hardpy_panel/frontend/dist/static/js/{main.942e57d4.js.LICENSE.txt → main.403e9cd8.js.LICENSE.txt} +0 -0
  30. {hardpy-0.7.0.dist-info → hardpy-0.9.0.dist-info}/WHEEL +0 -0
  31. {hardpy-0.7.0.dist-info → hardpy-0.9.0.dist-info}/entry_points.txt +0 -0
  32. {hardpy-0.7.0.dist-info → hardpy-0.9.0.dist-info}/licenses/LICENSE +0 -0
hardpy/__init__.py CHANGED
@@ -2,6 +2,7 @@
2
2
  # GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
 
4
4
  from hardpy.pytest_hardpy.pytest_call import (
5
+ clear_operator_message,
5
6
  get_current_attempt,
6
7
  get_current_report,
7
8
  run_dialog_box,
@@ -21,13 +22,14 @@ from hardpy.pytest_hardpy.pytest_call import (
21
22
  from hardpy.pytest_hardpy.result import CouchdbLoader
22
23
  from hardpy.pytest_hardpy.result.couchdb_config import CouchdbConfig
23
24
  from hardpy.pytest_hardpy.utils import (
25
+ BaseWidget,
24
26
  CheckboxWidget,
25
27
  DialogBox,
26
28
  DuplicatePartNumberError,
27
29
  DuplicateSerialNumberError,
28
30
  DuplicateTestStandLocationError,
29
31
  DuplicateTestStandNameError,
30
- ImageWidget,
32
+ ImageComponent,
31
33
  MultistepWidget,
32
34
  NumericInputWidget,
33
35
  RadiobuttonWidget,
@@ -36,37 +38,35 @@ from hardpy.pytest_hardpy.utils import (
36
38
  )
37
39
 
38
40
  __all__ = [
39
- # CouchDB
40
- "CouchdbLoader",
41
+ "BaseWidget",
42
+ "CheckboxWidget",
41
43
  "CouchdbConfig",
42
- "get_current_report",
43
- # Errors
44
- "DuplicateSerialNumberError",
44
+ "CouchdbLoader",
45
+ "DialogBox",
45
46
  "DuplicatePartNumberError",
46
- "DuplicateTestStandNameError",
47
+ "DuplicateSerialNumberError",
47
48
  "DuplicateTestStandLocationError",
48
- # Database info
49
+ "DuplicateTestStandNameError",
50
+ "ImageComponent",
51
+ "MultistepWidget",
52
+ "NumericInputWidget",
53
+ "RadiobuttonWidget",
54
+ "StepWidget",
55
+ "TextInputWidget",
56
+ "clear_operator_message",
57
+ "get_current_attempt",
58
+ "get_current_report",
59
+ "run_dialog_box",
60
+ "set_case_artifact",
61
+ "set_driver_info",
49
62
  "set_dut_info",
50
- "set_dut_serial_number",
51
63
  "set_dut_part_number",
52
- "set_stand_name",
53
- "set_stand_info",
54
- "set_stand_location",
55
- "set_case_artifact",
56
- "set_module_artifact",
57
- "set_run_artifact",
64
+ "set_dut_serial_number",
58
65
  "set_message",
59
- "set_driver_info",
66
+ "set_module_artifact",
60
67
  "set_operator_message",
61
- "get_current_attempt",
62
- # Dialog boxes
63
- "run_dialog_box",
64
- "DialogBox",
65
- "TextInputWidget",
66
- "NumericInputWidget",
67
- "CheckboxWidget",
68
- "RadiobuttonWidget",
69
- "ImageWidget",
70
- "StepWidget",
71
- "MultistepWidget",
68
+ "set_run_artifact",
69
+ "set_stand_info",
70
+ "set_stand_location",
71
+ "set_stand_name",
72
72
  ]
hardpy/cli/cli.py CHANGED
@@ -4,10 +4,9 @@ from __future__ import annotations
4
4
 
5
5
  import sys
6
6
  from pathlib import Path
7
- from typing import Optional
7
+ from typing import Annotated, Optional
8
8
 
9
9
  import typer
10
- from typing_extensions import Annotated
11
10
  from uvicorn import run as uvicorn_run
12
11
 
13
12
  from hardpy.cli.template import TemplateGenerator
hardpy/common/config.py CHANGED
@@ -5,7 +5,8 @@ from __future__ import annotations
5
5
  from logging import getLogger
6
6
  from pathlib import Path
7
7
 
8
- import rtoml
8
+ import tomli
9
+ import tomli_w
9
10
  from pydantic import BaseModel, ConfigDict, ValidationError
10
11
 
11
12
  logger = getLogger(__name__)
@@ -111,8 +112,9 @@ class ConfigManager:
111
112
  Args:
112
113
  parent_dir (Path): Configuration file parent directory.
113
114
  """
115
+ config_str = tomli_w.dumps(cls.obj.model_dump())
114
116
  with Path.open(parent_dir / "hardpy.toml", "w") as file:
115
- file.write(rtoml.dumps(cls.obj.model_dump()))
117
+ file.write(config_str)
116
118
 
117
119
  @classmethod
118
120
  def read_config(cls, toml_path: Path) -> HardpyConfig | None:
@@ -127,15 +129,13 @@ class ConfigManager:
127
129
  cls.tests_path = toml_path
128
130
  toml_file = toml_path / "hardpy.toml"
129
131
  if not toml_file.exists():
130
- logger.error(f"File hardpy.toml not found at path: {toml_file}")
132
+ logger.error("File hardpy.toml not found at path: %s", toml_file)
131
133
  return None
132
134
  try:
133
- with Path.open(toml_path / "hardpy.toml", "r") as f:
134
- cls.obj = HardpyConfig(**rtoml.load(f))
135
+ with Path.open(toml_path / "hardpy.toml", "rb") as f:
136
+ cls.obj = HardpyConfig(**tomli.load(f))
135
137
  return cls.obj # noqa: TRY300
136
- except rtoml.TomlParsingError:
137
- logger.exception("Error parsing TOML")
138
- except rtoml.TomlSerializationError:
138
+ except tomli.TOMLDecodeError:
139
139
  logger.exception("Error parsing TOML")
140
140
  except ValidationError:
141
141
  logger.exception("Error parsing TOML")
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "/static/css/main.e8a862f1.css",
4
- "main.js": "/static/js/main.942e57d4.js",
4
+ "main.js": "/static/js/main.403e9cd8.js",
5
5
  "blueprint-icons-all-paths-loader.js": "/static/js/blueprint-icons-all-paths-loader.0aa89747.chunk.js",
6
6
  "blueprint-icons-split-paths-by-size-loader.js": "/static/js/blueprint-icons-split-paths-by-size-loader.52a072d3.chunk.js",
7
7
  "static/js/808.ce070002.chunk.js": "/static/js/808.ce070002.chunk.js",
@@ -21,7 +21,7 @@
21
21
  "static/media/logo_smol.png": "/static/media/logo_smol.5b16f92447a4a9e80331.png",
22
22
  "index.html": "/index.html",
23
23
  "main.e8a862f1.css.map": "/static/css/main.e8a862f1.css.map",
24
- "main.942e57d4.js.map": "/static/js/main.942e57d4.js.map",
24
+ "main.403e9cd8.js.map": "/static/js/main.403e9cd8.js.map",
25
25
  "blueprint-icons-all-paths-loader.0aa89747.chunk.js.map": "/static/js/blueprint-icons-all-paths-loader.0aa89747.chunk.js.map",
26
26
  "blueprint-icons-split-paths-by-size-loader.52a072d3.chunk.js.map": "/static/js/blueprint-icons-split-paths-by-size-loader.52a072d3.chunk.js.map",
27
27
  "808.ce070002.chunk.js.map": "/static/js/808.ce070002.chunk.js.map",
@@ -31,6 +31,6 @@
31
31
  },
32
32
  "entrypoints": [
33
33
  "static/css/main.e8a862f1.css",
34
- "static/js/main.942e57d4.js"
34
+ "static/js/main.403e9cd8.js"
35
35
  ]
36
36
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>HardPy Operator Panel</title><script defer="defer" src="/static/js/main.942e57d4.js"></script><link href="/static/css/main.e8a862f1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>HardPy Operator Panel</title><script defer="defer" src="/static/js/main.403e9cd8.js"></script><link href="/static/css/main.e8a862f1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>