Accepting request 1165557 from devel:languages:python:aws

OBS-URL: https://build.opensuse.org/request/show/1165557
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-aws-sam-translator?expand=0&rev=27
This commit is contained in:
Ana Guerrero 2024-04-07 20:10:34 +00:00 committed by Git OBS Bridge
commit 0e83caa545
5 changed files with 33 additions and 44 deletions

View File

@ -1,38 +0,0 @@
From aca3d4dca40b8d6b48c0a0f3b4bab5b0406f9865 Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Thu, 8 Feb 2024 12:58:06 +1100
Subject: [PATCH] Use datetime.now(utc) in MetricDatum
datetime.utcnow() is deprecated as of Python 3.12, and its use will
raise a DeprecationWarning. Since warnings are treated as errors, this
results in test failures under Python 3.12. Switch to using
datetime.now() with a timezone.utc parameter.
---
samtranslator/metrics/metrics.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/samtranslator/metrics/metrics.py b/samtranslator/metrics/metrics.py
index d026e9c13..72da530b7 100644
--- a/samtranslator/metrics/metrics.py
+++ b/samtranslator/metrics/metrics.py
@@ -1,9 +1,10 @@
"""
Helper classes to publish metrics
"""
+
import logging
from abc import ABC, abstractmethod
-from datetime import datetime
+from datetime import datetime, timezone
from typing import Any, Dict, List, Optional, TypedDict, Union
from samtranslator.internal.deprecation_control import deprecated
@@ -114,7 +115,7 @@ def __init__(
self.value = value
self.unit = unit
self.dimensions = dimensions if dimensions else []
- self.timestamp = timestamp if timestamp else datetime.utcnow()
+ self.timestamp = timestamp if timestamp else datetime.now(timezone.utc)
def get_metric_data(self) -> Dict[str, Any]:
return {

View File

@ -1,3 +1,32 @@
-------------------------------------------------------------------
Fri Apr 5 09:04:00 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 1.87.0
* Merge main to develop by @gracelu0 in #3544
* chore(schema): update by @github-actions in #3546
* fix: normalize the open api version by @xazhao in #3551
* chore(schema): update by @github-actions in #3557
* Merge main to develop by @xazhao in #3562
* chore: add new partition by @aaythapa in #3564
* Revert "fix: normalize the open api version" by @aaythapa in #3565
- from version 1.86.0
* chore: a more polite closed issue message by @kellertk in #3509
* chore: Update managed policies list for more policy support by @GavinZZ in #3510
* chore(schema): update by @github-actions in #3512
* chore: Allow dependabot to upgrade other GHAs by @jfuss in #3513
* chore(deps): bump github/codeql-action from 2 to 3 by @dependabot in #3516
* chore(deps): bump actions/setup-python from 4 to 5 by @dependabot in #3515
* chore(deps): bump actions/checkout from 3 to 4 by @dependabot in #3514
* Merge main to develop by @ssenchenko in #3519
* chore: Fix KeyError when accessing PolicyDocument by @jfuss in #3522
* fix: add check for CodeUri property type by @paulhcsun in #3531
* Use datetime.now(utc) in MetricDatum by @s-t-e-v-e-n-k in #3538
* [chore] switch to timezone.utc instead of utcnow() since the last
one is deprecated in Python 12 by @ssenchenko in #3539
* chore(schema): update by @github-actions in #3542
- Drop patches for issues fixed upstream
* no-more-utcnow-in-metrics.patch
-------------------------------------------------------------------
Tue Mar 5 10:16:31 UTC 2024 - Markéta Machová <mmachova@suse.com>

View File

@ -27,14 +27,12 @@
%define skip_python2 1
%endif
Name: python-aws-sam-translator
Version: 1.85.0
Version: 1.87.0
Release: 0
Summary: AWS SAM template to AWS CloudFormation template translator
License: Apache-2.0
URL: https://github.com/awslabs/serverless-application-model
Source: https://github.com/awslabs/serverless-application-model/archive/v%{version}.tar.gz#/serverless-application-model-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh#aws/serverless-application-model#3538
Patch0: no-more-utcnow-in-metrics.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:85bae0b4e1c99427319a57c70ede78cff3b1cff9f5244409ecd17539b48404bf
size 5472842

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b9e1209839e0a3a0c73a7bb75b953bc576bb0505e11b12613e3160e0b42b948
size 5497979