From 4986504f04680788b6c2904a1acc71135388d0dd Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 26 Apr 2022 19:13:59 +0200 Subject: [PATCH] python38Packages.backports-zoneinfo: test data for zoneinfo 2022a Unfortunately test data needs to be continuously updated to match zoneinfo or the tests will fail. This was relatively annoying and I'd recommend just disabling the tests if this happens again. --- .../backports-zoneinfo/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pkgs/development/python-modules/backports-zoneinfo/default.nix b/pkgs/development/python-modules/backports-zoneinfo/default.nix index d2b6d06c4cdb..5fa4c6323169 100644 --- a/pkgs/development/python-modules/backports-zoneinfo/default.nix +++ b/pkgs/development/python-modules/backports-zoneinfo/default.nix @@ -7,6 +7,7 @@ , tzdata , hypothesis , pytestCheckHook +, fetchpatch }: buildPythonPackage rec { @@ -22,7 +23,25 @@ buildPythonPackage rec { sha256 = "sha256-00xdDOVdDanfsjQTd3yjMN2RFGel4cWRrAA3CvSnl24="; }; + # Make sure test data update patch applies + prePatch = '' + substituteInPlace tests/data/zoneinfo_data.json --replace \"2020a\" \"2021a\" + ''; + patches = [ + # Update test suite's test data to zoneinfo 2022a + # https://github.com/pganssle/zoneinfo/pull/115 + (fetchpatch { + name = "backports-zoneinfo-2022a-update-test-data1.patch"; + url = "https://github.com/pganssle/zoneinfo/pull/115/commits/837e2a0f9f1a1332e4233f83e3648fa564a9ec9e.patch"; + sha256 = "196knwa212mr0b7zsh8papzr3f5mii87gcjjjx1r9zzvmk3g3ri0"; + }) + (fetchpatch { + name = "backports-zoneinfo-2022a-update-test-data2.patch"; + url = "https://github.com/pganssle/zoneinfo/pull/115/commits/9fd330265b177916d6182249439bb40d5691eb58.patch"; + sha256 = "1zxa5bkwi8hbnh4c0qv72wv6vdp5jlxqizfjsc05ymzvwa99cf75"; + }) + (substituteAll { name = "zoneinfo-path"; src = ./zoneinfo.patch;