From 90ba78cdfc7ab58740dfb3dbad4d1e00b63964aa Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Wed, 11 Sep 2024 02:01:14 +0200 Subject: [PATCH] ci: no UTC on this python --- ci/nightly.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/nightly.py b/ci/nightly.py index 779a04d96..080d2f2c4 100644 --- a/ci/nightly.py +++ b/ci/nightly.py @@ -2,7 +2,7 @@ import os import sys from zipfile import ZipFile, ZIP_DEFLATED from b2sdk.v2 import InMemoryAccountInfo, B2Api -from datetime import datetime, UTC +from datetime import datetime, timezone import json UPLOAD_FOLDER = "nightly/" @@ -32,7 +32,7 @@ def remove_prefix(text: str, prefix: str) -> str: return text[text.startswith(prefix) and len(prefix):] def create_and_upload_artifact_zip(platform: str, artifact: str) -> int: - now = datetime.now(UTC).replace(hour=0, minute=0, second=0, microsecond=0) + now = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0) source_archive: str destination_name = f'odin-{platform}-nightly+{now.strftime("%Y-%m-%d")}' @@ -71,7 +71,7 @@ def prune_artifacts(): for file, _ in bucket.ls(UPLOAD_FOLDER, latest_only=False): # Timestamp is in milliseconds date = datetime.fromtimestamp(file.upload_timestamp / 1_000.0).replace(hour=0, minute=0, second=0, microsecond=0) - now = datetime.now(UTC).replace(hour=0, minute=0, second=0, microsecond=0) + now = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0) delta = now - date if delta.days > int(days_to_keep): @@ -105,7 +105,7 @@ def update_nightly_json(): 'sizeInBytes': size, }) - now = datetime.now(UTC).isoformat() + now = datetime.now(timezone.utc).isoformat() nightly = json.dumps({ 'last_updated' : now,