From f039855e6fdb49fc6936ca907c115ddddce7a9c7 Mon Sep 17 00:00:00 2001 From: Test Date: Wed, 14 Oct 2026 12:03:04 -0500 Subject: [PATCH] chore(tooling): enforce python >=3.13 requirement and align uv lockfile - Declare project.requires-python = ">=3.13" in pyproject.toml - Lock dependencies and virtual package in uv.lock - Update datetime.timezone.utc usages to datetime.UTC across scripts --- nixos/scripts/monitor.py | 4 ++-- pyproject.toml | 7 +++++++ scripts/appctl_engine.py | 4 ++-- scripts/gitops_dispatcher.py | 4 ++-- uv.lock | 5 +++++ 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/nixos/scripts/monitor.py b/nixos/scripts/monitor.py index e396ef2..cd141ad 100644 --- a/nixos/scripts/monitor.py +++ b/nixos/scripts/monitor.py @@ -17,7 +17,7 @@ import subprocess import sys import urllib.error import urllib.request -from datetime import datetime, timezone +from datetime import UTC, datetime # History file location storing the transition log of public IP states. # Defaults to a state directory managed securely by the systemd service unit. @@ -133,7 +133,7 @@ def record_ip(ip, status, details=None): """ os.makedirs(os.path.dirname(HISTORY_FILE), exist_ok=True) entry = { - "timestamp": datetime.now(tz=timezone.utc).isoformat(), + "timestamp": datetime.now(tz=UTC).isoformat(), "ip": ip, "status": status } diff --git a/pyproject.toml b/pyproject.toml index 2915980..00976f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,10 @@ +[project] +name = "homelab-core" +version = "0.1.0" +description = "Homelab Core platform and orchestration" +requires-python = ">=3.13" +dependencies = [] + [tool.pyright] extraPaths = ["scripts"] exclude = [ diff --git a/scripts/appctl_engine.py b/scripts/appctl_engine.py index 631bd36..97f1511 100755 --- a/scripts/appctl_engine.py +++ b/scripts/appctl_engine.py @@ -520,9 +520,9 @@ def check_ssl_cert(domain: str, port: int = 443, timeout: float = 3.0) -> dict[s formatted_expiry = "-" if not_after_str: expiry_dt = datetime.datetime.strptime(not_after_str, "%b %d %H:%M:%S %Y %Z").replace( - tzinfo=datetime.timezone.utc + tzinfo=datetime.UTC ) - now_dt = datetime.datetime.now(datetime.timezone.utc) + now_dt = datetime.datetime.now(datetime.UTC) days_remaining = (expiry_dt - now_dt).days formatted_expiry = expiry_dt.strftime("%Y-%m-%d") diff --git a/scripts/gitops_dispatcher.py b/scripts/gitops_dispatcher.py index 26f69bd..8af2ff1 100755 --- a/scripts/gitops_dispatcher.py +++ b/scripts/gitops_dispatcher.py @@ -652,7 +652,7 @@ def enqueue_deployment( "deployment_config": deployment_config, "branch": branch, "commit_sha": commit_sha, - "queued_at": datetime.datetime.now(datetime.timezone.utc).isoformat(), + "queued_at": datetime.datetime.now(datetime.UTC).isoformat(), } temp_file.write_text(json.dumps(data), encoding="utf-8") @@ -706,7 +706,7 @@ def run_target_worker(target_name: str) -> bool: "branch": branch, "commit_sha": commit_sha, "success": success, - "timestamp": datetime.datetime.now(datetime.timezone.utc).isoformat(), + "timestamp": datetime.datetime.now(datetime.UTC).isoformat(), } status_file.write_text(json.dumps(status_data, indent=2), encoding="utf-8") except OSError as e: diff --git a/uv.lock b/uv.lock index 5cf3c1e..738ee06 100644 --- a/uv.lock +++ b/uv.lock @@ -1,3 +1,8 @@ version = 1 revision = 5 requires-python = ">=3.13" + +[[package]] +name = "homelab-core" +version = "0.1.0" +source = { virtual = "." }