oe-python-template 0.17.0__tar.gz → 0.17.2__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.
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/PKG-INFO +1 -1
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/pyproject.toml +2 -2
- oe_python_template-0.17.2/src/oe_python_template/system/_gui.py +26 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/system/_service.py +8 -4
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_process.py +2 -1
- oe_python_template-0.17.0/src/oe_python_template/system/_gui.py +0 -20
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/.gitignore +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/LICENSE +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/README.md +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/__init__.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/api.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/cli.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/constants.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/__init__.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_api.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_cli.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_constants.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_gui.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_models.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_service.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_settings.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/system/__init__.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/system/_api.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/system/_cli.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/system/_settings.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/.vendored/bottle.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/__init__.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_api.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_cli.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_console.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_constants.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_di.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_gui.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_health.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_log.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_logfire.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_notebook.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_sentry.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_service.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_settings.py +0 -0
- {oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/boot.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: oe-python-template
|
3
|
-
Version: 0.17.
|
3
|
+
Version: 0.17.2
|
4
4
|
Summary: 🧠 Copier template to scaffold Python projects compliant with best practices and modern tooling.
|
5
5
|
Project-URL: Homepage, https://oe-python-template.readthedocs.io/en/latest/
|
6
6
|
Project-URL: Documentation, https://oe-python-template.readthedocs.io/en/latest/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "oe-python-template"
|
3
|
-
version = "0.17.
|
3
|
+
version = "0.17.2"
|
4
4
|
description = "🧠 Copier template to scaffold Python projects compliant with best practices and modern tooling."
|
5
5
|
readme = "README.md"
|
6
6
|
authors = [{ name = "Helmut Hoffer von Ankershoffen", email = "helmuthva@gmail.com" }]
|
@@ -288,7 +288,7 @@ source = ["src/"]
|
|
288
288
|
|
289
289
|
|
290
290
|
[tool.bumpversion]
|
291
|
-
current_version = "0.17.
|
291
|
+
current_version = "0.17.2"
|
292
292
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
293
293
|
serialize = ["{major}.{minor}.{patch}"]
|
294
294
|
search = "{current_version}"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"""Homepage (index) of GUI."""
|
2
|
+
|
3
|
+
from ..utils import BasePageBuilder, __project_name__, __version__ # noqa: TID252
|
4
|
+
from ._service import Service
|
5
|
+
|
6
|
+
|
7
|
+
class PageBuilder(BasePageBuilder):
|
8
|
+
@staticmethod
|
9
|
+
def register_pages() -> None:
|
10
|
+
from nicegui import run, ui # noqa: PLC0415
|
11
|
+
|
12
|
+
@ui.page("/info")
|
13
|
+
async def page_info() -> None:
|
14
|
+
"""Homepage of GUI."""
|
15
|
+
ui.label(f"{__project_name__} v{__version__}").mark("LABEL_VERSION")
|
16
|
+
spinner = ui.spinner("dots", size="lg", color="red")
|
17
|
+
properties = {
|
18
|
+
"content": {"json": "Loading ..."},
|
19
|
+
"readOnly": True,
|
20
|
+
}
|
21
|
+
editor = ui.json_editor(properties).mark("JSON_EDITOR_INFO")
|
22
|
+
ui.link("Home", "/").mark("LINK_HOME")
|
23
|
+
info = await run.cpu_bound(Service().info, True, True)
|
24
|
+
properties["content"] = {"json": info}
|
25
|
+
editor.update()
|
26
|
+
spinner.delete()
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/system/_service.py
RENAMED
@@ -31,6 +31,10 @@ from ._settings import Settings
|
|
31
31
|
|
32
32
|
log = get_logger(__name__)
|
33
33
|
|
34
|
+
# Note: There is multiple measurements and network calls
|
35
|
+
MEASURE_INTERVAL_SECONDS = 5
|
36
|
+
NETWORK_TIMEOUT = 5
|
37
|
+
|
34
38
|
|
35
39
|
class RuntimeDict(TypedDict, total=False):
|
36
40
|
"""Type for runtime information dictionary."""
|
@@ -103,7 +107,7 @@ class Service(BaseService):
|
|
103
107
|
return token == self._settings.token.get_secret_value()
|
104
108
|
|
105
109
|
@staticmethod
|
106
|
-
def _get_public_ipv4(timeout: int =
|
110
|
+
def _get_public_ipv4(timeout: int = NETWORK_TIMEOUT) -> str | None:
|
107
111
|
"""Get the public IPv4 address of the system.
|
108
112
|
|
109
113
|
Args:
|
@@ -151,14 +155,14 @@ class Service(BaseService):
|
|
151
155
|
Returns:
|
152
156
|
dict[str, Any]: Service configuration.
|
153
157
|
"""
|
154
|
-
from uptime import boottime, uptime # noqa: PLC0415
|
155
158
|
import psutil # noqa: PLC0415
|
159
|
+
from uptime import boottime, uptime # noqa: PLC0415
|
156
160
|
|
157
161
|
bootdatetime = boottime()
|
158
162
|
vmem = psutil.virtual_memory()
|
159
163
|
swap = psutil.swap_memory()
|
160
|
-
cpu_percent = psutil.cpu_percent(interval=
|
161
|
-
cpu_times_percent = psutil.cpu_times_percent(interval=
|
164
|
+
cpu_percent = psutil.cpu_percent(interval=MEASURE_INTERVAL_SECONDS)
|
165
|
+
cpu_times_percent = psutil.cpu_times_percent(interval=MEASURE_INTERVAL_SECONDS)
|
162
166
|
|
163
167
|
rtn: InfoDict = {
|
164
168
|
"package": {
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_process.py
RENAMED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
from pathlib import Path
|
4
4
|
|
5
|
-
import psutil
|
6
5
|
from pydantic import BaseModel
|
7
6
|
|
8
7
|
|
@@ -28,6 +27,8 @@ def get_process_info() -> ProcessInfo:
|
|
28
27
|
Returns:
|
29
28
|
ProcessInfo: Object containing process information.
|
30
29
|
"""
|
30
|
+
import psutil # noqa: PLC0415
|
31
|
+
|
31
32
|
current_process = psutil.Process()
|
32
33
|
parent = current_process.parent()
|
33
34
|
|
@@ -1,20 +0,0 @@
|
|
1
|
-
"""Homepage (index) of GUI."""
|
2
|
-
|
3
|
-
from ..utils import BasePageBuilder, __project_name__, __version__ # noqa: TID252
|
4
|
-
from ._service import Service
|
5
|
-
|
6
|
-
|
7
|
-
class PageBuilder(BasePageBuilder):
|
8
|
-
@staticmethod
|
9
|
-
def register_pages() -> None:
|
10
|
-
from nicegui import ui # noqa: PLC0415
|
11
|
-
|
12
|
-
@ui.page("/info")
|
13
|
-
def page_info() -> None:
|
14
|
-
"""Homepage of GUI."""
|
15
|
-
ui.label(f"{__project_name__} v{__version__}").mark("LABEL_VERSION")
|
16
|
-
ui.json_editor({
|
17
|
-
"content": {"json": Service().info(True, True)},
|
18
|
-
"readOnly": True,
|
19
|
-
}).mark("JSON_EDITOR_INFO")
|
20
|
-
ui.link("Home", "/").mark("LINK_HOME")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/__init__.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_api.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_cli.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_constants.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_gui.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_models.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_service.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/hello/_settings.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/system/__init__.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/system/_api.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/system/_cli.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/system/_settings.py
RENAMED
File without changes
|
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/__init__.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_api.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_cli.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_console.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_constants.py
RENAMED
File without changes
|
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_gui.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_health.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_log.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_logfire.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_notebook.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_sentry.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_service.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/_settings.py
RENAMED
File without changes
|
{oe_python_template-0.17.0 → oe_python_template-0.17.2}/src/oe_python_template/utils/boot.py
RENAMED
File without changes
|