hardpy 0.1.0__py3-none-any.whl → 0.2.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.
- hardpy/__init__.py +0 -2
- hardpy/hardpy_panel/api.py +1 -1
- hardpy/hardpy_panel/runner.py +1 -1
- hardpy/pytest_hardpy/plugin.py +8 -0
- hardpy/pytest_hardpy/pytest_wrapper.py +3 -0
- {hardpy-0.1.0.dist-info → hardpy-0.2.0.dist-info}/METADATA +20 -15
- {hardpy-0.1.0.dist-info → hardpy-0.2.0.dist-info}/RECORD +10 -10
- {hardpy-0.1.0.dist-info → hardpy-0.2.0.dist-info}/WHEEL +0 -0
- {hardpy-0.1.0.dist-info → hardpy-0.2.0.dist-info}/entry_points.txt +0 -0
- {hardpy-0.1.0.dist-info → hardpy-0.2.0.dist-info}/licenses/LICENSE +0 -0
hardpy/__init__.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Copyright (c) 2024 Everypin
|
|
2
2
|
# GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
|
-
from hardpy.pytest_hardpy.plugin import HardpyPlugin
|
|
5
4
|
from hardpy.pytest_hardpy.result import CouchdbLoader
|
|
6
5
|
from hardpy.pytest_hardpy.utils import DuplicateSerialNumberError
|
|
7
6
|
from hardpy.pytest_hardpy.result.couchdb_config import CouchdbConfig
|
|
@@ -18,7 +17,6 @@ from hardpy.pytest_hardpy.pytest_call import (
|
|
|
18
17
|
)
|
|
19
18
|
|
|
20
19
|
__all__ = [
|
|
21
|
-
"HardpyPlugin",
|
|
22
20
|
"CouchdbLoader",
|
|
23
21
|
"CouchdbConfig",
|
|
24
22
|
"DuplicateSerialNumberError",
|
hardpy/hardpy_panel/api.py
CHANGED
hardpy/hardpy_panel/runner.py
CHANGED
|
@@ -15,7 +15,7 @@ def run():
|
|
|
15
15
|
config = ConfigData()
|
|
16
16
|
parser = ArgumentParser(description="Usage: hardpy-panel [OPTION]... [PATH]")
|
|
17
17
|
# fmt: off
|
|
18
|
-
parser.add_argument("-dbu", "--db_user", default=config.db_user, help="database user")
|
|
18
|
+
parser.add_argument("-dbu", "--db_user", default=config.db_user, help="database user") # noqa: E501
|
|
19
19
|
parser.add_argument("-dbpw", "--db_pswd", default=config.db_pswd, help="database user password") # noqa: E501
|
|
20
20
|
parser.add_argument("-dbp", "--db_port", type=int, default=config.db_port, help="database port number") # noqa: E501
|
|
21
21
|
parser.add_argument("-dbh", "--db_host", type=str, default=config.db_host, help="database hostname") # noqa: E501
|
hardpy/pytest_hardpy/plugin.py
CHANGED
|
@@ -37,8 +37,15 @@ def pytest_addoption(parser: Parser):
|
|
|
37
37
|
parser.addoption("--hardpy-dbpw", action="store", default=config_data.db_pswd, help="database user password") # noqa: E501
|
|
38
38
|
parser.addoption("--hardpy-dbp", action="store", default=config_data.db_port, help="database port number") # noqa: E501
|
|
39
39
|
parser.addoption("--hardpy-dbh", action="store", default=config_data.db_host, help="database hostname") # noqa: E501
|
|
40
|
+
parser.addoption("--hardpy-pt", action="store_true", default=False, help="enable pytest-hardpy plugin") # noqa: E501
|
|
40
41
|
# fmt: on
|
|
41
42
|
|
|
43
|
+
# Bootstrapping hooks
|
|
44
|
+
def pytest_load_initial_conftests(early_config, parser, args):
|
|
45
|
+
if "--hardpy-pt" in args:
|
|
46
|
+
plugin = HardpyPlugin()
|
|
47
|
+
early_config.pluginmanager.register(plugin)
|
|
48
|
+
|
|
42
49
|
|
|
43
50
|
class HardpyPlugin(object):
|
|
44
51
|
"""HardPy integration plugin for pytest.
|
|
@@ -57,6 +64,7 @@ class HardpyPlugin(object):
|
|
|
57
64
|
signal.signal(signal.SIGBREAK, self._stop_handler)
|
|
58
65
|
self._log = getLogger(__name__)
|
|
59
66
|
|
|
67
|
+
|
|
60
68
|
# Initialization hooks
|
|
61
69
|
|
|
62
70
|
def pytest_configure(self, config: Config):
|
|
@@ -46,6 +46,7 @@ class PyTestWrapper(object):
|
|
|
46
46
|
self.config.db_user,
|
|
47
47
|
"--hardpy-dbpw",
|
|
48
48
|
self.config.db_pswd,
|
|
49
|
+
"--hardpy-pt",
|
|
49
50
|
],
|
|
50
51
|
cwd=self.config.tests_dir.absolute(),
|
|
51
52
|
)
|
|
@@ -63,6 +64,7 @@ class PyTestWrapper(object):
|
|
|
63
64
|
self.config.db_user,
|
|
64
65
|
"--hardpy-dbpw",
|
|
65
66
|
self.config.db_pswd,
|
|
67
|
+
"--hardpy-pt",
|
|
66
68
|
],
|
|
67
69
|
cwd=self.config.tests_dir.absolute(),
|
|
68
70
|
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP,
|
|
@@ -107,6 +109,7 @@ class PyTestWrapper(object):
|
|
|
107
109
|
self.config.db_user,
|
|
108
110
|
"--hardpy-dbpw",
|
|
109
111
|
self.config.db_pswd,
|
|
112
|
+
"--hardpy-pt",
|
|
110
113
|
],
|
|
111
114
|
cwd=self.config.tests_dir.absolute(),
|
|
112
115
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hardpy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: HardPy library for device testing
|
|
5
5
|
Project-URL: repository, https://github.com/everypindevices/hardpy
|
|
6
6
|
Author: Everypin
|
|
@@ -36,7 +36,7 @@ Requires-Dist: wemake-python-styleguide; extra == 'dev'
|
|
|
36
36
|
Description-Content-Type: text/markdown
|
|
37
37
|
|
|
38
38
|
<h1 align="center">
|
|
39
|
-
<img src="
|
|
39
|
+
<img src="https://everypinio.github.io/hardpy/img/logo512.png" alt="HardPy" style="width:200px;">
|
|
40
40
|
</h1>
|
|
41
41
|
|
|
42
42
|
<h1 align="center">
|
|
@@ -47,6 +47,16 @@ Description-Content-Type: text/markdown
|
|
|
47
47
|
HardPy is a python library for creating a test bench for devices.
|
|
48
48
|
</p>
|
|
49
49
|
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
**Documentation**: <a href=https://everypinio.github.io/hardpy/ target="_blank">https://everypinio.github.io/hardpy/</a>
|
|
53
|
+
|
|
54
|
+
**Source Code**: <a href=https://github.com/everypinio/hardpy target="_blank">https://github.com/everypinio/hardpy</a>
|
|
55
|
+
|
|
56
|
+
**PyPi**: <a href=https://pypi.org/project/hardpy/ target="_blank">https://pypi.org/project/hardpy/</a>
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
50
60
|
## Overview
|
|
51
61
|
|
|
52
62
|
HardPy allows you to:
|
|
@@ -69,6 +79,10 @@ Find examples of using the **HardPy** in the `examples` folder.
|
|
|
69
79
|
|
|
70
80
|
#### CouchDB
|
|
71
81
|
|
|
82
|
+
This is a simple instruction for Linux.
|
|
83
|
+
For Windows, follow the instructions from the
|
|
84
|
+
[documentation](https://everypinio.github.io/hardpy/documentation/database/#couchdb-instance).
|
|
85
|
+
|
|
72
86
|
Launch CouchDB with Docker.
|
|
73
87
|
Create `couchdb.ini` file:
|
|
74
88
|
|
|
@@ -86,22 +100,13 @@ headers = accept, authorization, content-type, origin, referer, x-csrf-token
|
|
|
86
100
|
Run the Docker container from folder with couchdb.ini file:
|
|
87
101
|
|
|
88
102
|
```bash
|
|
89
|
-
docker run --name couchdb -p 5984:5984 -e COUCHDB_USER=dev -e COUCHDB_PASSWORD=dev -v ./couchdb.ini:/opt/couchdb/etc/local.ini couchdb:3.3
|
|
103
|
+
docker run --rm --name couchdb -p 5984:5984 -e COUCHDB_USER=dev -e COUCHDB_PASSWORD=dev -v ./couchdb.ini:/opt/couchdb/etc/local.ini couchdb:3.3
|
|
90
104
|
```
|
|
91
105
|
|
|
92
106
|
#### Test steps
|
|
93
107
|
|
|
94
108
|
Add simple test to `tests` folder
|
|
95
109
|
|
|
96
|
-
```python
|
|
97
|
-
# conftest.py
|
|
98
|
-
import pytest
|
|
99
|
-
import hardpy
|
|
100
|
-
|
|
101
|
-
def pytest_configure(config: pytest.Config):
|
|
102
|
-
config.pluginmanager.register(hardpy.HardpyPlugin())
|
|
103
|
-
```
|
|
104
|
-
|
|
105
110
|
```python
|
|
106
111
|
# test_1.py
|
|
107
112
|
import pytest
|
|
@@ -114,16 +119,16 @@ def test_one():
|
|
|
114
119
|
Launch `hardpy-panel` from tests folder or launch `hardpy-panel tests` and open page http://localhost:8000/ in browser.
|
|
115
120
|
|
|
116
121
|
<h1 align="center">
|
|
117
|
-
<img src="
|
|
122
|
+
<img src="https://everypinio.github.io/hardpy/img/hardpy_operator_panel_hello_hardpy.png"
|
|
118
123
|
alt="hardpy operator panel" style="width:600px;">
|
|
119
124
|
</h1>
|
|
120
125
|
|
|
121
126
|
#### Test report
|
|
122
127
|
|
|
123
128
|
The last test report is stored in **runstore** database, document - **current**.
|
|
124
|
-
You can view the CouchDB instance through Fauxton web interface: http://
|
|
129
|
+
You can view the CouchDB instance through Fauxton web interface: http://localhost:5984/_utils
|
|
125
130
|
|
|
126
131
|
<h1 align="center">
|
|
127
|
-
<img src="
|
|
132
|
+
<img src="https://everypinio.github.io/hardpy/img/runstore_hello_hardpy.png"
|
|
128
133
|
alt="hardpy runstore" style="width:600px;">
|
|
129
134
|
</h1>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
hardpy/__init__.py,sha256=
|
|
1
|
+
hardpy/__init__.py,sha256=RwEQwrdXAtjf2UKOTyXiOUvMKOpXCy7TrJR03V4HY98,864
|
|
2
2
|
hardpy/hardpy_panel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
hardpy/hardpy_panel/api.py,sha256=
|
|
4
|
-
hardpy/hardpy_panel/runner.py,sha256=
|
|
3
|
+
hardpy/hardpy_panel/api.py,sha256=ool8MvCH9SFGHooOloboListg1Mas4FciMQsyRjhWGE,1567
|
|
4
|
+
hardpy/hardpy_panel/runner.py,sha256=J8c2Pzemwr1Xzs0SOIqLqUNNf_4Jb5BJN_fo4pU3Za4,1866
|
|
5
5
|
hardpy/hardpy_panel/frontend/dist/asset-manifest.json,sha256=Z6KDx9WMNghh4d_7w52kTSdEec-lup56JR6JEP3WY94,2824
|
|
6
6
|
hardpy/hardpy_panel/frontend/dist/favicon.ico,sha256=sgIk5PKUKEKBDpkSrc8dJgjpObp0iF82Mec0GpfKId4,15406
|
|
7
7
|
hardpy/hardpy_panel/frontend/dist/index.html,sha256=u1IJG5LkBLmaPgL-dYJ4rIfmxzf0xNhmmOupezuobgg,656
|
|
@@ -36,9 +36,9 @@ hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-20.afbadb627d43b7
|
|
|
36
36
|
hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-20.e857f5a5132b8bfa71a1.woff,sha256=mQZTxE1PyyAL16VWuASOvXlZFwuI4aCPvbrhfgpdIdU,55356
|
|
37
37
|
hardpy/hardpy_panel/frontend/dist/static/media/logo_smol.5b16f92447a4a9e80331.png,sha256=E4K7drvhJCg9HcTpRihOXZhVJVBZ7-W97Se-3tDb46o,14485
|
|
38
38
|
hardpy/pytest_hardpy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
|
-
hardpy/pytest_hardpy/plugin.py,sha256=
|
|
39
|
+
hardpy/pytest_hardpy/plugin.py,sha256=_qVu3F54qikloIGhV6Enb0-m2Oy6h_VBOo4jwNzOLdc,8415
|
|
40
40
|
hardpy/pytest_hardpy/pytest_call.py,sha256=wyMDt4AwQC4qg6pYnevQv7FIhIvHNYreQdU1kEenqdY,5910
|
|
41
|
-
hardpy/pytest_hardpy/pytest_wrapper.py,sha256=
|
|
41
|
+
hardpy/pytest_hardpy/pytest_wrapper.py,sha256=bC8ROwAEjo3TpXpNtHXUS-C_fpIyeCPtgfGBSZ82aI8,3554
|
|
42
42
|
hardpy/pytest_hardpy/db/__init__.py,sha256=MxDufncz0zgRAxrndvPXXW4NrU7rRP7MzIrR7S5Cwwo,558
|
|
43
43
|
hardpy/pytest_hardpy/db/base_connector.py,sha256=7KUgPY-GmAo8MFN4OFpG5y3WH1xjohRnpeQ1gxQF1tg,751
|
|
44
44
|
hardpy/pytest_hardpy/db/base_server.py,sha256=uBnq5zGkzEIq_EGzLw0C8kfDEDvQyN52Y6L41KKL9FQ,397
|
|
@@ -64,8 +64,8 @@ hardpy/pytest_hardpy/utils/exception.py,sha256=5GnVkOchSPDEXaOXaruO0YzKXoY7b3Y5m
|
|
|
64
64
|
hardpy/pytest_hardpy/utils/node_info.py,sha256=9aK8X-lNrY3unjHAR-DBS6GFKyo7rEoDH-CTy_WGdFw,1437
|
|
65
65
|
hardpy/pytest_hardpy/utils/progress_calculator.py,sha256=r0qb3p6_yDIyLeCshF3Ceo5pCzd3BoTahL4rCD2oMNw,1041
|
|
66
66
|
hardpy/pytest_hardpy/utils/singleton.py,sha256=C8cgRDydnG2b5dcN1LCLw4aM-AUMAvJc1W39mTkNWlQ,614
|
|
67
|
-
hardpy-0.
|
|
68
|
-
hardpy-0.
|
|
69
|
-
hardpy-0.
|
|
70
|
-
hardpy-0.
|
|
71
|
-
hardpy-0.
|
|
67
|
+
hardpy-0.2.0.dist-info/METADATA,sha256=ZyxZaCBvj2QYXPcwWFvrEvZaOGPKeK1kY8VByYTEtCY,3870
|
|
68
|
+
hardpy-0.2.0.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
|
|
69
|
+
hardpy-0.2.0.dist-info/entry_points.txt,sha256=q73g5GfznSUpjkayi0SV4uaAtrf7D-7rmDoWoEZmZe0,120
|
|
70
|
+
hardpy-0.2.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
71
|
+
hardpy-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|