diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6e14306e..7440d5f0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,21 +17,21 @@ repos: - id: check-added-large-files - id: end-of-file-fixer - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.20 + rev: v0.16.10 hooks: - id: ruff args: ["--fix"] - id: ruff-format - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.11.0.1 + rev: v0.11.0.1-1 hooks: - id: shellcheck args: ["--severity=warning"] - repo: https://github.com/rapidsai/pre-commit-hooks - rev: v1.6.0 + rev: v1.7.0 hooks: - id: verify-copyright - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: v1.26.1 + rev: v1.30.1 hooks: - id: zizmor diff --git a/ci/check_conda_nightly_env.py b/ci/check_conda_nightly_env.py index 21ed7070..75875867 100644 --- a/ci/check_conda_nightly_env.py +++ b/ci/check_conda_nightly_env.py @@ -2,7 +2,7 @@ import json import re import sys -from datetime import datetime, timedelta +from datetime import datetime, timedelta, timezone OLD_PACKAGE_THRESHOLD_DAYS = 3 @@ -38,7 +38,9 @@ def get_package_date(package): if match: # Convert the date-time string to a datetime object datetime_string = match.group(1) - date_object = datetime.strptime(datetime_string, "%y%m%d%H%M%S") + date_object = datetime.strptime(datetime_string, "%y%m%d%H%M%S").replace( + tzinfo=timezone.utc + ) return date_object print( @@ -82,7 +84,9 @@ def check_env(json_path): } # If there are old packages, show an error - today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0) + today = datetime.now(tz=timezone.utc).replace( + hour=0, minute=0, second=0, microsecond=0 + ) old_threshold = today - timedelta(days=OLD_PACKAGE_THRESHOLD_DAYS) old_packages = { package: date