From 479c4d1c4319cf4b7d1d5c175780faa2cb24c862 Mon Sep 17 00:00:00 2001 From: Daniel Sotirhos Date: Mon, 12 Feb 2024 18:27:08 -0800 Subject: [PATCH] Ignore DeprecationWarning from datetime, add FIXME (#5953) --- scripts/sell_unused_slots.py | 2 ++ src/azul/dss.py | 2 ++ test/azul_test_case.py | 7 ++++++- test/service/test_manifest.py | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/sell_unused_slots.py b/scripts/sell_unused_slots.py index 5cd68f2849..e583ed398f 100644 --- a/scripts/sell_unused_slots.py +++ b/scripts/sell_unused_slots.py @@ -76,6 +76,8 @@ def _list_contribution_lambda_functions(cls) -> list[Lambda]: ] def _lambda_invocation_counts(self) -> dict[Lambda, int]: + # FIXME: DeprecationWarning for datetime methods in Python 3.12 + # https://github.com/DataBiosphere/azul/issues/5953 end = datetime.utcnow() start = end - timedelta(minutes=self.interval) lambdas_by_name = { diff --git a/src/azul/dss.py b/src/azul/dss.py index 08b67f3fde..bf1ca6baf5 100644 --- a/src/azul/dss.py +++ b/src/azul/dss.py @@ -9,6 +9,8 @@ def new_version(): + # FIXME: DeprecationWarning for datetime methods in Python 3.12 + # https://github.com/DataBiosphere/azul/issues/5953 return datetime.utcnow().strftime(version_format) diff --git a/test/azul_test_case.py b/test/azul_test_case.py index 76919b1033..8ac098078e 100644 --- a/test/azul_test_case.py +++ b/test/azul_test_case.py @@ -146,7 +146,12 @@ class RE(str): RE( 'The \'body\' parameter is deprecated for the \'.*\' API ' 'and will be removed in .*. Instead use .*' - ) + ), + + # FIXME: DeprecationWarning for datetime methods in Python 3.12 + # https://github.com/DataBiosphere/azul/issues/5953 + 'datetime.datetime.utcnow() is deprecated', + 'datetime.datetime.utcfromtimestamp() is deprecated', }, UserWarning: { 'https://github.com/DataBiosphere/azul/issues/2114', diff --git a/test/service/test_manifest.py b/test/service/test_manifest.py index a83a6cecda..19126756bd 100644 --- a/test/service/test_manifest.py +++ b/test/service/test_manifest.py @@ -1172,6 +1172,8 @@ def test_bdbag_manifest_remove_redundant_entries(self): Test BDBagManifestGenerator._remove_redundant_entries() directly with a large set of sample data """ + # FIXME: DeprecationWarning for datetime methods in Python 3.12 + # https://github.com/DataBiosphere/azul/issues/5953 now = datetime.utcnow() def v(i):