hardpy 0.5.1__py3-none-any.whl → 0.6.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 (41) hide show
  1. hardpy/__init__.py +10 -0
  2. hardpy/cli/__init__.py +0 -0
  3. hardpy/cli/cli.py +145 -0
  4. hardpy/cli/template.py +210 -0
  5. hardpy/common/__init__.py +0 -0
  6. hardpy/common/config.py +159 -0
  7. hardpy/hardpy_panel/api.py +49 -6
  8. hardpy/hardpy_panel/frontend/dist/asset-manifest.json +3 -3
  9. hardpy/hardpy_panel/frontend/dist/index.html +1 -1
  10. hardpy/hardpy_panel/frontend/dist/static/js/main.7c954faf.js +3 -0
  11. hardpy/hardpy_panel/frontend/dist/static/js/main.7c954faf.js.map +1 -0
  12. hardpy/pytest_hardpy/db/base_server.py +4 -4
  13. hardpy/pytest_hardpy/db/base_store.py +13 -3
  14. hardpy/pytest_hardpy/db/const.py +3 -0
  15. hardpy/pytest_hardpy/db/schema.py +47 -11
  16. hardpy/pytest_hardpy/db/statestore.py +11 -0
  17. hardpy/pytest_hardpy/plugin.py +90 -33
  18. hardpy/pytest_hardpy/pytest_call.py +65 -5
  19. hardpy/pytest_hardpy/pytest_wrapper.py +62 -60
  20. hardpy/pytest_hardpy/reporter/base.py +1 -1
  21. hardpy/pytest_hardpy/reporter/hook_reporter.py +7 -3
  22. hardpy/pytest_hardpy/result/report_loader/couchdb_loader.py +3 -2
  23. hardpy/pytest_hardpy/result/report_reader/couchdb_reader.py +2 -2
  24. hardpy/pytest_hardpy/utils/__init__.py +7 -4
  25. hardpy/pytest_hardpy/utils/connection_data.py +17 -0
  26. hardpy/pytest_hardpy/utils/const.py +4 -14
  27. hardpy/pytest_hardpy/utils/dialog_box.py +1 -1
  28. hardpy/pytest_hardpy/utils/exception.py +14 -0
  29. hardpy/pytest_hardpy/utils/node_info.py +1 -1
  30. hardpy/pytest_hardpy/utils/progress_calculator.py +1 -1
  31. hardpy/pytest_hardpy/utils/singleton.py +1 -1
  32. {hardpy-0.5.1.dist-info → hardpy-0.6.0.dist-info}/METADATA +25 -57
  33. {hardpy-0.5.1.dist-info → hardpy-0.6.0.dist-info}/RECORD +37 -33
  34. {hardpy-0.5.1.dist-info → hardpy-0.6.0.dist-info}/entry_points.txt +1 -1
  35. hardpy/hardpy_panel/frontend/dist/static/js/main.da686f40.js +0 -3
  36. hardpy/hardpy_panel/frontend/dist/static/js/main.da686f40.js.map +0 -1
  37. hardpy/hardpy_panel/runner.py +0 -54
  38. hardpy/pytest_hardpy/utils/config_data.py +0 -35
  39. /hardpy/hardpy_panel/frontend/dist/static/js/{main.da686f40.js.LICENSE.txt → main.7c954faf.js.LICENSE.txt} +0 -0
  40. {hardpy-0.5.1.dist-info → hardpy-0.6.0.dist-info}/WHEEL +0 -0
  41. {hardpy-0.5.1.dist-info → hardpy-0.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,54 +0,0 @@
1
- # Copyright (c) 2024 Everypin
2
- # GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
3
-
4
- import sys
5
- from argparse import ArgumentParser
6
- from pathlib import Path
7
-
8
- from uvicorn import run as uvicorn_run
9
-
10
- from hardpy.pytest_hardpy.utils import ConfigData
11
-
12
-
13
- def run():
14
- """Start server for frontend."""
15
- config = ConfigData()
16
- parser = ArgumentParser(description="Usage: hardpy-panel [OPTION]... [PATH]")
17
- # fmt: off
18
- parser.add_argument("-dbu", "--db_user", default=config.db_user, help="database user") # noqa: E501
19
- parser.add_argument("-dbpw", "--db_pswd", default=config.db_pswd, help="database user password") # noqa: E501
20
- parser.add_argument("-dbp", "--db_port", type=int, default=config.db_port, help="database port number") # noqa: E501
21
- parser.add_argument("-dbh", "--db_host", type=str, default=config.db_host, help="database hostname") # noqa: E501
22
- parser.add_argument("-wh", "--web_host", type=str, default=config.web_host, help="web operator panel hostname") # noqa: E501
23
- parser.add_argument("-wp", "--web_port", type=str, default=config.web_port, help="web operator panel port") # noqa: E501
24
- parser.add_argument("-sp", "--sck_port", type=int, default=config.socket_port, help="internal socket port") # noqa: E501
25
- parser.add_argument("-sa", "--sck_addr", type=int, default=config.socket_port, help="internal socket address") # noqa: E501
26
- parser.add_argument("path", type=str, nargs='?', help="path to test directory")
27
- # fmt: on
28
-
29
- args = parser.parse_args()
30
-
31
- config.db_user = args.db_user
32
- config.db_pswd = args.db_pswd
33
- config.db_port = args.db_port
34
- config.db_host = args.db_host
35
- config.web_host = args.web_host
36
- config.web_port = args.web_port
37
-
38
- path = Path(args.path) if args.path else Path.cwd()
39
-
40
- config.tests_dir = path
41
-
42
- if not config.tests_dir.exists():
43
- print(f"Directory not found: {path}")
44
- sys.exit()
45
-
46
- uvicorn_run(
47
- "hardpy.hardpy_panel.api:app",
48
- host=config.web_host,
49
- port=config.web_port,
50
- log_level="critical",
51
- )
52
-
53
-
54
- run()
@@ -1,35 +0,0 @@
1
- # Copyright (c) 2024 Everypin
2
- # GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
3
-
4
- from socket import gethostname
5
- from pathlib import Path
6
-
7
- from hardpy.pytest_hardpy.utils.singleton import Singleton
8
-
9
-
10
- class ConfigData(Singleton):
11
- """Web connection data storage."""
12
-
13
- def __init__(self):
14
- if not self._initialized:
15
- self.db_host: str = "localhost"
16
- self.db_user: str = "dev"
17
- self.db_pswd: str = "dev"
18
- self.db_port: int = 5984
19
- self.web_host: str = "0.0.0.0"
20
- self.web_port: int = 8000
21
- self.tests_dir = Path.cwd()
22
- self.socket_port: int = 6525
23
- self.socket_addr: str = gethostname()
24
- self._initialized = True
25
-
26
- @property
27
- def connection_string(self) -> str:
28
- """Get couchdb connection string.
29
-
30
- Returns:
31
- str: couchdb connection string
32
- """
33
- credentials = f"{self.db_user}:{self.db_pswd}"
34
- uri = f"{self.db_host}:{str(self.db_port)}" # noqa: WPS237
35
- return f"http://{credentials}@{uri}/"
File without changes