oe-python-template
Advanced tools
+1
-1
| Metadata-Version: 2.4 | ||
| Name: oe-python-template | ||
| Version: 0.17.0 | ||
| Version: 0.17.2 | ||
| Summary: 🧠 Copier template to scaffold Python projects compliant with best practices and modern tooling. | ||
@@ -5,0 +5,0 @@ Project-URL: Homepage, https://oe-python-template.readthedocs.io/en/latest/ |
+2
-2
| [project] | ||
| name = "oe-python-template" | ||
| version = "0.17.0" | ||
| version = "0.17.2" | ||
| description = "🧠 Copier template to scaffold Python projects compliant with best practices and modern tooling." | ||
@@ -291,3 +291,3 @@ readme = "README.md" | ||
| [tool.bumpversion] | ||
| current_version = "0.17.0" | ||
| current_version = "0.17.2" | ||
| parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)" | ||
@@ -294,0 +294,0 @@ serialize = ["{major}.{minor}.{patch}"] |
@@ -10,12 +10,18 @@ """Homepage (index) of GUI.""" | ||
| def register_pages() -> None: | ||
| from nicegui import ui # noqa: PLC0415 | ||
| from nicegui import run, ui # noqa: PLC0415 | ||
| @ui.page("/info") | ||
| def page_info() -> None: | ||
| async def page_info() -> None: | ||
| """Homepage of GUI.""" | ||
| ui.label(f"{__project_name__} v{__version__}").mark("LABEL_VERSION") | ||
| ui.json_editor({ | ||
| "content": {"json": Service().info(True, True)}, | ||
| spinner = ui.spinner("dots", size="lg", color="red") | ||
| properties = { | ||
| "content": {"json": "Loading ..."}, | ||
| "readOnly": True, | ||
| }).mark("JSON_EDITOR_INFO") | ||
| } | ||
| editor = ui.json_editor(properties).mark("JSON_EDITOR_INFO") | ||
| ui.link("Home", "/").mark("LINK_HOME") | ||
| info = await run.cpu_bound(Service().info, True, True) | ||
| properties["content"] = {"json": info} | ||
| editor.update() | ||
| spinner.delete() |
@@ -34,3 +34,7 @@ """System service.""" | ||
| # Note: There is multiple measurements and network calls | ||
| MEASURE_INTERVAL_SECONDS = 5 | ||
| NETWORK_TIMEOUT = 5 | ||
| class RuntimeDict(TypedDict, total=False): | ||
@@ -107,3 +111,3 @@ """Type for runtime information dictionary.""" | ||
| @staticmethod | ||
| def _get_public_ipv4(timeout: int = 5) -> str | None: | ||
| def _get_public_ipv4(timeout: int = NETWORK_TIMEOUT) -> str | None: | ||
| """Get the public IPv4 address of the system. | ||
@@ -156,4 +160,4 @@ | ||
| """ | ||
| import psutil # noqa: PLC0415 | ||
| from uptime import boottime, uptime # noqa: PLC0415 | ||
| import psutil # noqa: PLC0415 | ||
@@ -163,4 +167,4 @@ bootdatetime = boottime() | ||
| swap = psutil.swap_memory() | ||
| cpu_percent = psutil.cpu_percent(interval=2) | ||
| cpu_times_percent = psutil.cpu_times_percent(interval=2) | ||
| cpu_percent = psutil.cpu_percent(interval=MEASURE_INTERVAL_SECONDS) | ||
| cpu_times_percent = psutil.cpu_times_percent(interval=MEASURE_INTERVAL_SECONDS) | ||
@@ -167,0 +171,0 @@ rtn: InfoDict = { |
@@ -5,3 +5,2 @@ """Process related utilities.""" | ||
| import psutil | ||
| from pydantic import BaseModel | ||
@@ -32,2 +31,4 @@ | ||
| """ | ||
| import psutil # noqa: PLC0415 | ||
| current_process = psutil.Process() | ||
@@ -34,0 +35,0 @@ parent = current_process.parent() |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
344636
0.14%5933
0.15%