hardpy 0.5.0__tar.gz → 0.5.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.
- {hardpy-0.5.0 → hardpy-0.5.1}/PKG-INFO +1 -1
- hardpy-0.5.1/hardpy/pytest_hardpy/result/couchdb_config.py +96 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/pyproject.toml +1 -1
- hardpy-0.5.0/hardpy/pytest_hardpy/result/couchdb_config.py +0 -22
- {hardpy-0.5.0 → hardpy-0.5.1}/.gitignore +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/LICENSE +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/README.md +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/__init__.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/__init__.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/api.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/asset-manifest.json +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/favicon.ico +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/index.html +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/logo512.png +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/manifest.json +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/css/main.e8a862f1.css +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/css/main.e8a862f1.css.map +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/808.ce070002.chunk.js +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/808.ce070002.chunk.js.map +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/blueprint-icons-16px-paths.d605910e.chunk.js +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/blueprint-icons-16px-paths.d605910e.chunk.js.map +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/blueprint-icons-20px-paths.7ee05cc8.chunk.js +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/blueprint-icons-20px-paths.7ee05cc8.chunk.js.map +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/blueprint-icons-all-paths-loader.0aa89747.chunk.js +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/blueprint-icons-all-paths-loader.0aa89747.chunk.js.map +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/blueprint-icons-all-paths.f63155c9.chunk.js +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/blueprint-icons-all-paths.f63155c9.chunk.js.map +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/blueprint-icons-split-paths-by-size-loader.52a072d3.chunk.js +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/blueprint-icons-split-paths-by-size-loader.52a072d3.chunk.js.map +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/main.da686f40.js +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/main.da686f40.js.LICENSE.txt +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/main.da686f40.js.map +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-16.520846c6beb41df528c8.eot +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-16.5c52b39c697f2323ce8b.svg +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-16.84db1772f4bfb529f64f.woff +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-16.b67ee1736e20e37a3225.woff2 +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-16.e02ecf515378db143652.ttf +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-20.429cacb8accf72488451.ttf +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-20.6ae3791ee2d86fc228a6.svg +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-20.8cecf62de42997e4d82f.woff2 +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-20.afbadb627d43b7857223.eot +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/blueprint-icons-20.e857f5a5132b8bfa71a1.woff +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/media/logo_smol.5b16f92447a4a9e80331.png +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/runner.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/__init__.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/db/__init__.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/db/base_connector.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/db/base_server.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/db/base_store.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/db/const.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/db/runstore.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/db/schema.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/db/statestore.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/plugin.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/pytest_call.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/pytest_wrapper.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/reporter/__init__.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/reporter/base.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/reporter/hook_reporter.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/reporter/runner_reporter.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/result/__init__.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/result/report_loader/__init__.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/result/report_loader/couchdb_loader.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/result/report_reader/__init__.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/result/report_reader/couchdb_reader.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/utils/__init__.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/utils/config_data.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/utils/const.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/utils/dialog_box.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/utils/exception.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/utils/node_info.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/utils/progress_calculator.py +0 -0
- {hardpy-0.5.0 → hardpy-0.5.1}/hardpy/pytest_hardpy/utils/singleton.py +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
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 ast
|
|
5
|
+
import requests
|
|
6
|
+
import socket
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from urllib3 import disable_warnings
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class CouchdbConfig: # noqa: WPS306
|
|
14
|
+
"""CouchDB loader config.
|
|
15
|
+
|
|
16
|
+
If `connection_str` arg is not set, it will be created from other args.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
db_name: str = "report"
|
|
20
|
+
user: str = "dev"
|
|
21
|
+
password: str = "dev"
|
|
22
|
+
host: str = "localhost"
|
|
23
|
+
port: int = 5984
|
|
24
|
+
connection_str: str | None = None
|
|
25
|
+
|
|
26
|
+
def __post_init__(self):
|
|
27
|
+
"""Disable urllib3 warnings.
|
|
28
|
+
|
|
29
|
+
More info: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
|
|
30
|
+
"""
|
|
31
|
+
disable_warnings()
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def connection_string(self) -> str:
|
|
35
|
+
"""Get couchdb connection string.
|
|
36
|
+
|
|
37
|
+
Raises:
|
|
38
|
+
RuntimeError: CouchDB server is not available
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
str: Database connection string.
|
|
42
|
+
"""
|
|
43
|
+
if self.connection_str:
|
|
44
|
+
return self.connection_str
|
|
45
|
+
|
|
46
|
+
# TODO: Modify connection string creating based on protocol.
|
|
47
|
+
# Some problems with http and https, different ports, local
|
|
48
|
+
# and cloud databases.
|
|
49
|
+
protocol = self._get_protocol()
|
|
50
|
+
|
|
51
|
+
if protocol == "http":
|
|
52
|
+
host_url = f"http://{self.host}:{self.port}"
|
|
53
|
+
uri = f"{self.host}:{str(self.port)}" # noqa: WPS237
|
|
54
|
+
elif protocol == "https":
|
|
55
|
+
host_url = f"https://{self.host}"
|
|
56
|
+
uri = f"{self.host}"
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
response = requests.get(host_url, timeout=5)
|
|
60
|
+
except requests.exceptions.RequestException:
|
|
61
|
+
raise RuntimeError(f"Error CouchDB connecting to {host_url}.")
|
|
62
|
+
|
|
63
|
+
# fmt: off
|
|
64
|
+
try:
|
|
65
|
+
couchdb_dict = ast.literal_eval(response._content.decode("utf-8")) # noqa: WPS437,E501
|
|
66
|
+
couchdb_dict.get("couchdb", False)
|
|
67
|
+
except Exception:
|
|
68
|
+
raise RuntimeError(f"Address {host_url} does not provide CouchDB attributes.")
|
|
69
|
+
# fmt: on
|
|
70
|
+
|
|
71
|
+
credentials = f"{self.user}:{self.password}"
|
|
72
|
+
return f"{protocol}://{credentials}@{uri}/"
|
|
73
|
+
|
|
74
|
+
def _get_protocol(self) -> str: # noqa: WPS231
|
|
75
|
+
success = 200
|
|
76
|
+
try:
|
|
77
|
+
# HTTPS attempt
|
|
78
|
+
sock = socket.create_connection((self.host, self.port))
|
|
79
|
+
sock.close()
|
|
80
|
+
request = f"https://{self.host}"
|
|
81
|
+
if requests.get(request, timeout=5).status_code == success:
|
|
82
|
+
return "https"
|
|
83
|
+
raise OSError
|
|
84
|
+
except OSError:
|
|
85
|
+
try: # noqa: WPS505
|
|
86
|
+
# HTTP attempt
|
|
87
|
+
sock = socket.create_connection((self.host, self.port))
|
|
88
|
+
sock.close()
|
|
89
|
+
request = f"http://{self.host}:{self.port}"
|
|
90
|
+
if requests.get(request, timeout=5).status_code == success:
|
|
91
|
+
return "http"
|
|
92
|
+
raise OSError
|
|
93
|
+
except OSError:
|
|
94
|
+
raise RuntimeError(
|
|
95
|
+
f"Error connecting to couchdb server {self.host}:{self.port}."
|
|
96
|
+
)
|
|
@@ -1,22 +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 dataclasses import dataclass
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@dataclass
|
|
8
|
-
class CouchdbConfig: # noqa: WPS306
|
|
9
|
-
"""CouchDB loader config."""
|
|
10
|
-
|
|
11
|
-
db_name: str = "report"
|
|
12
|
-
user: str = "dev"
|
|
13
|
-
password: str = "dev"
|
|
14
|
-
host: str = "localhost"
|
|
15
|
-
port: int = 5984
|
|
16
|
-
|
|
17
|
-
@property
|
|
18
|
-
def connection_string(self) -> str:
|
|
19
|
-
"""Get couchdb connection string."""
|
|
20
|
-
credentials = f"{self.user}:{self.password}"
|
|
21
|
-
uri = f"{self.host}:{str(self.port)}"
|
|
22
|
-
return f"http://{credentials}@{uri}/"
|
|
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
|
|
File without changes
|
|
File without changes
|
{hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/css/main.e8a862f1.css
RENAMED
|
File without changes
|
{hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/css/main.e8a862f1.css.map
RENAMED
|
File without changes
|
{hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/808.ce070002.chunk.js
RENAMED
|
File without changes
|
{hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/808.ce070002.chunk.js.map
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hardpy-0.5.0 → hardpy-0.5.1}/hardpy/hardpy_panel/frontend/dist/static/js/main.da686f40.js.map
RENAMED
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|