diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-09-11 02:01:14 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-09-11 02:01:14 +0200 |
| commit | 90ba78cdfc7ab58740dfb3dbad4d1e00b63964aa (patch) | |
| tree | a809e14b76601f25d5d7efcf4dead84ac9611792 /ci | |
| parent | a66524b0b297a9d58075ab91a95d55022579a91b (diff) | |
ci: no UTC on this python
Diffstat (limited to 'ci')
| -rw-r--r-- | ci/nightly.py | 8 |
1 files 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, |