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
This commit is contained in:
1 parent
ecacb1cc39
commit
298ae728e1
5 files changed
+18
-6
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user