diff options
author | Chih-Hsuan Yen | 2024-01-21 14:01:34 +0800 |
---|---|---|
committer | Chih-Hsuan Yen | 2024-01-21 14:01:34 +0800 |
commit | 033c3454f37b51d8d2d01cc6d2035588d03fd627 (patch) | |
tree | 090f1bc0e1b2025ab2af2773118169a722df4517 | |
parent | 1c136ab5186d9feae67001c81afc42a1c74ce53b (diff) | |
download | aur-033c3454f37b51d8d2d01cc6d2035588d03fd627.tar.gz |
Fix FTBFS
Similar to 236221433f00d0853b482dddb322c026ce9922b1, the patch from
GitHub has changed
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | aws-cli-v2-tz-fix.patch | 42 |
2 files changed, 43 insertions, 1 deletions
@@ -22,7 +22,7 @@ install=aws-cli-v2.install source=("https://awscli.amazonaws.com/awscli-$pkgver.tar.gz"{,.sig} build-ac.index-in-tmp.diff fix-env.diff - "$pkgname-tz-fix.patch::https://github.com/aws/aws-cli/commit/95aa5ccc7bfaeafc0373e8472c8459030ac18920.patch" + "$pkgname-tz-fix.patch" "${pkgname}-ruamel-yaml-v4.patch") sha256sums=('a76984fe18376791a838f012a2cd1b6344d4b6d4e89e4140c00b4e9902f2bcf0' 'SKIP' diff --git a/aws-cli-v2-tz-fix.patch b/aws-cli-v2-tz-fix.patch new file mode 100644 index 000000000000..a9db045ce2c2 --- /dev/null +++ b/aws-cli-v2-tz-fix.patch @@ -0,0 +1,42 @@ +From 95aa5ccc7bfaeafc0373e8472c8459030ac18920 Mon Sep 17 00:00:00 2001 +From: Avimitin <dev@avimit.in> +Date: Tue, 21 Mar 2023 12:36:48 +0800 +Subject: [PATCH] Force timezone info to fix possible test failure + +This commit will affects the test +`test_credentials.py::SSOSessionTest::test_token_chosen_from_provider`. +This test will throw a `RuntimeError: Credentials were refreshed, but +the refreshed credentials are still expired` because the timestamp call +uses system local time, which is different from UTC time. And this will +cause an unexpected failure if the test is not run in a system configured +with `TZ=UTC`. + +Signed-off-by: Avimitin <dev@avimit.in> +--- + tests/functional/botocore/test_credentials.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/functional/botocore/test_credentials.py b/tests/functional/botocore/test_credentials.py +index 843be90e484..9da9bf2b443 100644 +--- a/tests/functional/botocore/test_credentials.py ++++ b/tests/functional/botocore/test_credentials.py +@@ -19,7 +19,7 @@ + import mock + import tempfile + import shutil +-from datetime import datetime, timedelta ++from datetime import datetime, timedelta, timezone + import sys + + import pytest +@@ -47,8 +47,8 @@ + from botocore.tokens import SSOTokenProvider + from botocore.utils import datetime2timestamp + +-TIME_IN_ONE_HOUR = datetime.utcnow() + timedelta(hours=1) +-TIME_IN_SIX_MONTHS = datetime.utcnow() + timedelta(hours=4320) ++TIME_IN_ONE_HOUR = datetime.now(tz=timezone.utc) + timedelta(hours=1) ++TIME_IN_SIX_MONTHS = datetime.now(tz=timezone.utc) + timedelta(hours=4320) + + + class TestCredentialRefreshRaces(unittest.TestCase): |