From 82c4dd80ee2270de5a67995f2c9aabd97fd07cc1f10c67730c50d79696419522 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Wed, 15 Mar 2017 21:41:50 +0000 Subject: [PATCH] add pytz-2016.10-fix-tests-with-2017a.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pytz?expand=0&rev=55 --- python-pytz.changes | 3 +- python-pytz.spec | 4 +- pytz-2016.10-fix-tests-with-2017a.patch | 75 +++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 pytz-2016.10-fix-tests-with-2017a.patch diff --git a/python-pytz.changes b/python-pytz.changes index 57e279f..d597a6e 100644 --- a/python-pytz.changes +++ b/python-pytz.changes @@ -1,9 +1,10 @@ ------------------------------------------------------------------- -Thu Mar 2 16:39:42 UTC 2017 - astieger@suse.com +Wed Mar 15 21:33:50 UTC 2017 - astieger@suse.com - update to 2016.10: * includes IANA 2016j * No longer fails with timezone-2017a bsc#1027705 + add pytz-2016.10-fix-tests-with-2017a.patch ------------------------------------------------------------------- Mon Apr 25 08:10:27 UTC 2016 - astieger@suse.com diff --git a/python-pytz.spec b/python-pytz.spec index 753ccd5..6a80dc1 100644 --- a/python-pytz.spec +++ b/python-pytz.spec @@ -30,12 +30,13 @@ Source90: pytz.keyring Patch0: fix-tests.patch # PATCH-FEATURE-OPENSUSE -- Use system tz database (Olson database) Patch1: system_zoneinfo.patch +Patch2: pytz-2016.10-fix-tests-with-2017a.patch Requires: timezone BuildRequires: fdupes BuildRequires: python-devel BuildRequires: python-nose # Tests will use this package -BuildRequires: timezone +BuildRequires: timezone >= 2017a BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} && 0%{?suse_version} <= 1110 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} @@ -63,6 +64,7 @@ Amost all of the Olson timezones are supported. %if 0%{?suse_version} >= 1310 # Use system tz database %patch1 -p1 +%patch2 -p2 %endif # For rpmlint warning: remove shebang from python library: sed -i '/^#!/d' ./pytz/tzfile.py diff --git a/pytz-2016.10-fix-tests-with-2017a.patch b/pytz-2016.10-fix-tests-with-2017a.patch new file mode 100644 index 0000000..d31277d --- /dev/null +++ b/pytz-2016.10-fix-tests-with-2017a.patch @@ -0,0 +1,75 @@ +From 838d7f06908c14352b0d4f3c5b656d0d95abaf9e Mon Sep 17 00:00:00 2001 +From: Andreas Stieger +Date: Wed, 15 Mar 2017 22:23:14 +0100 +Subject: [PATCH] test fixes for 2017a numeric zone name changes +References: boo#1027705 https://github.com/stub42/pytz/pull/1 + https://github.com/stub42/pytz/pull/1/commits/838d7f06908c14352b0d4f3c5b656d0d95abaf9e + +--- + src/pytz/tests/test_tzinfo.py | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/pytz/tests/test_tzinfo.py b/src/pytz/tests/test_tzinfo.py +index 4d26d9ff..21812f6b 100644 +--- a/src/pytz/tests/test_tzinfo.py ++++ b/src/pytz/tests/test_tzinfo.py +@@ -501,7 +501,7 @@ class NoumeaHistoryStartTestCase(USEasternDSTStartTestCase): + 'dst': timedelta(0), + } + after = { +- 'tzname': 'NCT', ++ 'tzname': '+11', + 'utcoffset': timedelta(hours=11), + 'dst': timedelta(0), + } +@@ -512,12 +512,12 @@ class NoumeaDSTEndTestCase(USEasternDSTStartTestCase): + tzinfo = pytz.timezone('Pacific/Noumea') + transition_time = datetime(1997, 3, 1, 15, 00, 00, tzinfo=UTC) + before = { +- 'tzname': 'NCST', ++ 'tzname': '+12', + 'utcoffset': timedelta(hours=12), + 'dst': timedelta(hours=1), + } + after = { +- 'tzname': 'NCT', ++ 'tzname': '+11', + 'utcoffset': timedelta(hours=11), + 'dst': timedelta(0), + } +@@ -541,7 +541,7 @@ class TahitiTestCase(USEasternDSTStartTestCase): + 'dst': timedelta(0), + } + after = { +- 'tzname': 'TAHT', ++ 'tzname': '-10', + 'utcoffset': timedelta(hours=-10), + 'dst': timedelta(0), + } +@@ -554,12 +554,12 @@ class SamoaInternationalDateLineChange(USEasternDSTStartTestCase): + tzinfo = pytz.timezone('Pacific/Apia') + transition_time = datetime(2011, 12, 30, 10, 0, 0, tzinfo=UTC) + before = { +- 'tzname': 'SDT', ++ 'tzname': '-10', + 'utcoffset': timedelta(hours=-10), + 'dst': timedelta(hours=1), + } + after = { +- 'tzname': 'WSDT', ++ 'tzname': '+14', + 'utcoffset': timedelta(hours=14), + 'dst': timedelta(hours=1), + } +@@ -611,7 +611,7 @@ class LocalTestCase(unittest.TestCase): + self.assertEqual(loc_time.strftime('%Z%z'), 'NST+0120') + + loc_time = loc_tz.localize(datetime(1940, 5, 10, 0, 0, 0)) +- self.assertEqual(loc_time.strftime('%Z%z'), 'NET+0020') ++ self.assertEqual(loc_time.strftime('%Z%z'), '+0020+0020') + + loc_time = loc_tz.localize(datetime(1940, 5, 20, 0, 0, 0)) + self.assertEqual(loc_time.strftime('%Z%z'), 'CEST+0200') +-- +2.12.0 +