mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-27 07:52:03 +00:00
Fix Python 3.10 compatibility for UTC timezone usage
This commit is contained in:
1 parent
c25d1df78d
commit
882cd060fa
3 files changed
+9
-4
No files matched your search
@@ -104,3 +104,8 @@
|
||||
## CI Black Check Failure Fix (2026-02-26)
|
||||
- `tests.yml` failed at `poetry run black --check .` on 9 files (SeedPass tests/core file plus TORCH script/backups).
|
||||
- Applied Black formatting to all reported files and verified `poetry run black --check .` passes locally.
|
||||
|
||||
## Python 3.10 datetime.UTC Compatibility Fix (2026-02-26)
|
||||
- CI `test (ubuntu-latest, 3.10)` failed during test collection because `datetime.UTC` is unavailable on Python 3.10.
|
||||
- Replaced `datetime.UTC` usage with `timezone.utc` in `src/seedpass/cli/agent.py` and `scripts/ai_tui_agent_test.py`.
|
||||
- Verified with targeted tests: `src/tests/test_cli_agent_mode.py` and `src/tests/test_ai_tui_agent_harness.py`.
|
||||
@@ -27,7 +27,7 @@ import sys
|
||||
import tempfile
|
||||
import time
|
||||
from dataclasses import dataclass, asdict
|
||||
from datetime import datetime, UTC
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from typing import Pattern
|
||||
|
||||
@@ -860,7 +860,7 @@ def main() -> int:
|
||||
print(f"Error: cannot find {src_main}", file=sys.stderr)
|
||||
return 2
|
||||
|
||||
timestamp = datetime.now(UTC).strftime("%Y%m%dT%H%M%SZ")
|
||||
timestamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
|
||||
artifact_dir = args.output_dir.resolve() / timestamp
|
||||
artifact_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
from datetime import UTC, datetime, timedelta
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
@@ -365,7 +365,7 @@ def agent_get(
|
||||
)
|
||||
raise typer.Exit(1)
|
||||
|
||||
now = datetime.now(UTC)
|
||||
now = datetime.now(timezone.utc)
|
||||
payload = {
|
||||
"status": "ok",
|
||||
"fingerprint": fingerprint,
|
||||
|
||||
Reference in new issue
Block a user