From 514fda226a5167ed200b63f0e0bfab06901f4683 Mon Sep 17 00:00:00 2001 From: Shiny Brar Date: Wed, 30 Oct 2024 09:39:53 -0700 Subject: [PATCH 1/2] fix(models): added logging --- skaha/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/skaha/models.py b/skaha/models.py index cd5cf4b..901c66c 100644 --- a/skaha/models.py +++ b/skaha/models.py @@ -7,6 +7,10 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator from typing_extensions import Self +from skaha.utils import logs + +log = logs.get_logger(__name__) + KINDS = Literal["desktop", "notebook", "carta", "headless"] STATUS = Literal["Pending", "Running", "Terminating", "Succeeded", "Error"] VIEW = Literal["all"] @@ -161,7 +165,8 @@ def _check_secret(cls, value: str) -> str: str: Validated value. """ if not value: - environ.get("SKAHA_REGISTRY_SECRET", None) + value = environ.get("SKAHA_REGISTRY_SECRET", None) # type: ignore + log.info("Using SKAHA_REGISTRY_SECRET from environment") assert value, "secret is required" return value From 1e96c6879c9066ea0d1fd5ad53545b39e14e6597 Mon Sep 17 00:00:00 2001 From: Shiny Brar Date: Wed, 30 Oct 2024 09:41:18 -0700 Subject: [PATCH 2/2] style(lint): mistakes --- docs/index.md | 1 + skaha/models.py | 2 +- uv.lock | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/index.md b/docs/index.md index ba4b07d..77f6c10 100644 --- a/docs/index.md +++ b/docs/index.md @@ -22,6 +22,7 @@ ```python from skaha.models import ContainerRegistry + registry = ContainerRegistry() ``` diff --git a/skaha/models.py b/skaha/models.py index 901c66c..ab66cc7 100644 --- a/skaha/models.py +++ b/skaha/models.py @@ -165,7 +165,7 @@ def _check_secret(cls, value: str) -> str: str: Validated value. """ if not value: - value = environ.get("SKAHA_REGISTRY_SECRET", None) # type: ignore + value = environ.get("SKAHA_REGISTRY_SECRET", None) # type: ignore log.info("Using SKAHA_REGISTRY_SECRET from environment") assert value, "secret is required" return value diff --git a/uv.lock b/uv.lock index 695f21f..a2da75e 100644 --- a/uv.lock +++ b/uv.lock @@ -1532,7 +1532,7 @@ wheels = [ [[package]] name = "skaha" -version = "1.4.0" +version = "1.4.1" source = { virtual = "." } dependencies = [ { name = "click" },