From 9ea0bc825b1394989ccc899fb7f8a83c8a019e28 Mon Sep 17 00:00:00 2001 From: Omer Cohen <639682+omercnet@users.noreply.github.com> Date: Sat, 5 Dec 2026 20:07:26 +0000 Subject: [PATCH] feat: support python 3.15 - Add 3.15 classifier and CI matrix entry - Replace datetime.utcfromtimestamp (deprecated, scheduled for removal) with an equivalent naive UTC conversion --- .github/workflows/ci.yml | 1 + descope/management/_audit_base.py | 4 ++-- pyproject.toml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffbe06a0b..565154537 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,7 @@ jobs: fail-fast: false matrix: py: + - "3.15" - "3.14" - "3.13" - "3.12" diff --git a/descope/management/_audit_base.py b/descope/management/_audit_base.py index eefa67109..112a1795e 100644 --- a/descope/management/_audit_base.py +++ b/descope/management/_audit_base.py @@ -1,7 +1,7 @@ # This is not part of the public API but a code helper from __future__ import annotations -from datetime import datetime +from datetime import datetime, timezone class AuditBase: @@ -20,7 +20,7 @@ def _convert_audit_record(a: dict) -> dict: "projectId": a.get("projectId", ""), "userId": a.get("userId", ""), "action": a.get("action", ""), - "occurred": datetime.utcfromtimestamp(float(a.get("occurred", "0")) / 1000), + "occurred": datetime.fromtimestamp(float(a.get("occurred", "0")) / 1000, timezone.utc).replace(tzinfo=None), "device": a.get("device", ""), "method": a.get("method", ""), "geo": a.get("geo", ""), diff --git a/pyproject.toml b/pyproject.toml index f50db9e49..7260d2ac6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Typing :: Typed", "Topic :: Software Development :: Libraries :: Python Modules", ]