From e8caaf4137fa9a064c5dc2eb6526f97139dd1ca1 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 18 Jun 2025 19:39:10 +0200 Subject: [PATCH] scripts: Bump Python target version for ruff Now that Python 3.12 is the minimum required version for Zephyr, ruff should target that instead of 3.10. Signed-off-by: Pieter De Gendt --- .ruff.toml | 2 +- scripts/footprint/pack_as_twister.py | 6 +++--- scripts/pylib/twister/twisterlib/environment.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index c9be3b43104..5858ae9e84a 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -4,7 +4,7 @@ extend = ".ruff-excludes.toml" line-length = 100 -target-version = "py310" +target-version = "py312" [lint] select = [ diff --git a/scripts/footprint/pack_as_twister.py b/scripts/footprint/pack_as_twister.py index bd8490a11ba..2383eb7b89a 100755 --- a/scripts/footprint/pack_as_twister.py +++ b/scripts/footprint/pack_as_twister.py @@ -33,7 +33,7 @@ test suite name ('dot separated' format). from __future__ import annotations -from datetime import datetime, timezone +from datetime import datetime, UTC import argparse import os import sys @@ -163,7 +163,7 @@ def main(): skipped = 0 filtered = 0 - run_date = datetime.now(timezone.utc).isoformat(timespec='seconds') + run_date = datetime.now(UTC).isoformat(timespec='seconds') init_logs() @@ -251,7 +251,7 @@ def main(): res['environment'] = { 'zephyr_version': data_id['version'], 'commit_date': - git_commit.committed_datetime.astimezone(timezone.utc).isoformat(timespec='seconds'), + git_commit.committed_datetime.astimezone(UTC).isoformat(timespec='seconds'), 'run_date': run_date, 'options': { 'testsuite_root': [ plan[r_plan]['application'] ], diff --git a/scripts/pylib/twister/twisterlib/environment.py b/scripts/pylib/twister/twisterlib/environment.py index ba0c9737a8c..4fb0fbb8ffe 100644 --- a/scripts/pylib/twister/twisterlib/environment.py +++ b/scripts/pylib/twister/twisterlib/environment.py @@ -16,7 +16,7 @@ import shutil import subprocess import sys from collections.abc import Generator -from datetime import datetime, timezone +from datetime import UTC, datetime from importlib import metadata from pathlib import Path @@ -1107,7 +1107,7 @@ class TwisterEnv: def discover(self): self.check_zephyr_version() self.get_toolchain() - self.run_date = datetime.now(timezone.utc).isoformat(timespec='seconds') + self.run_date = datetime.now(UTC).isoformat(timespec='seconds') def check_zephyr_version(self): try: