Skip to content

Commit fef06c4

Browse files
author
TNFR AI Agent
committed
fix(ci): timezone.utc for Python 3.10 + restrict pytest to tests/ [skip release]
- telemetry.py used datetime.UTC (3.11+), breaking import on Python 3.10 across all modules that import telemetry; use timezone.utc (universal). - Add testpaths=[tests] so the bare pytest in CI no longer collects the factorization-lab/ and primality-test/ companion projects (which have their own setup).
1 parent 02a9acc commit fef06c4

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ exclude = [
290290

291291
[tool.pytest.ini_options]
292292
pythonpath = ["src"]
293+
testpaths = ["tests"]
293294
addopts = "-m 'not slow'"
294295
markers = [
295296
"slow: marks tests as slow (deselect with '-m \"not slow\"')",

‎src/tnfr/metrics/telemetry.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
import json
5656
import time
5757
from dataclasses import asdict, dataclass
58-
from datetime import UTC, datetime
58+
from datetime import datetime, timezone
5959
from pathlib import Path
6060
from typing import Any, Iterable, Mapping, MutableMapping
6161

@@ -333,7 +333,7 @@ def _compute() -> None:
333333

334334
# Use timezone-aware UTC to avoid deprecation of datetime.utcnow()
335335
event = TelemetryEvent(
336-
t_iso=datetime.now(UTC).isoformat(timespec="seconds"),
336+
t_iso=datetime.now(timezone.utc).isoformat(timespec="seconds"),
337337
t_epoch=time.time(),
338338
step=step,
339339
operator=operator,

0 commit comments

Comments
 (0)