fix: test break docs and on data compaction (2) (#902)
Some checks failed
Bump Version / Bump Version Workflow (push) Has been cancelled
docker-build / platform-excludes (push) Has been cancelled
docker-build / build (push) Has been cancelled
docker-build / merge (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Run Pytest on Pull Request / test (push) Has been cancelled
Close stale pull requests/issues / Find Stale issues and PRs (push) Has been cancelled

Ensure that the snapping sequence generated in the test fixture
is within the boundaries expected by the test.

Ensure we read the _version_date.py info as UTC datetime and do
no localtime conversion.

Prevent and guard test_version.py to modify the version date file.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
Bobby Noelte
2026-02-24 18:56:11 +01:00
committed by GitHub
parent 90e2e8af7e
commit 378377b1ce
11 changed files with 119 additions and 53 deletions

View File

@@ -1 +1 @@
VERSION_DATE = "2026-02-24T06:03:36Z"
VERSION_DATE = "2026-02-24T16:58:00Z"

View File

@@ -247,7 +247,10 @@ def newest_commit_or_dirty_datetime(files: list[Path]) -> datetime:
exec(VERSION_DATE_FILE.read_text(), {}, ns) # noqa: S102
date_str = ns.get("VERSION_DATE")
if date_str:
return datetime.fromisoformat(date_str).astimezone(timezone.utc)
dt = datetime.fromisoformat(date_str)
if dt.tzinfo is None:
dt = dt.replace(tzinfo=timezone.utc) # treat naive as UTC, don't convert
return dt.astimezone(timezone.utc)
except Exception: # noqa: S110
pass