diff --git a/0001-Fix-tests-for-older-timezone-versions.patch b/0001-Fix-tests-for-older-timezone-versions.patch index 0ce3cd1..2afa761 100644 --- a/0001-Fix-tests-for-older-timezone-versions.patch +++ b/0001-Fix-tests-for-older-timezone-versions.patch @@ -12,18 +12,19 @@ diff --git a/src/pytz/tests/test_tzinfo.py b/src/pytz/tests/test_tzinfo.py index 3166322..0ecb8c0 100644 --- a/src/pytz/tests/test_tzinfo.py +++ b/src/pytz/tests/test_tzinfo.py -@@ -235,12 +235,14 @@ class USEasternDSTStartTestCase(unittest.TestCase): +@@ -249,13 +249,14 @@ class USEasternDSTStartTestCase(unittest.TestCase): def _test_tzname(self, utc_dt, wanted): tzname = wanted['tzname'] + if not isinstance(tzname, list): + tzname = [tzname] dt = utc_dt.astimezone(self.tzinfo) -- self.assertEqual(dt.tzname(), tzname, +- self.assertEqual( +- dt.tzname(), tzname, - 'Expected %s as tzname for %s. Got %s' % ( - tzname, str(utc_dt), dt.tzname() -- ) - ) +- ) + self.assertIn(dt.tzname(), tzname, + 'Expected %s as tzname for %s. Got %s' % ( + tzname, str(utc_dt), dt.tzname() @@ -32,16 +33,16 @@ index 3166322..0ecb8c0 100644 def _test_utcoffset(self, utc_dt, wanted): utcoffset = wanted['utcoffset'] -@@ -501,7 +503,7 @@ class NoumeaHistoryStartTestCase(USEasternDSTStartTestCase): +@@ -512,7 +514,7 @@ class NoumeaHistoryStartTestCase(USEasternDSTStartTestCase): 'dst': timedelta(0), - } + } after = { - 'tzname': '+11', # pre-2017a, NCT + 'tzname': ['+11', 'NCT'], # pre-2017a, NCT 'utcoffset': timedelta(hours=11), 'dst': timedelta(0), - } -@@ -512,12 +514,12 @@ class NoumeaDSTEndTestCase(USEasternDSTStartTestCase): + } +@@ -523,12 +525,12 @@ class NoumeaDSTEndTestCase(USEasternDSTStartTestCase): tzinfo = pytz.timezone('Pacific/Noumea') transition_time = datetime(1997, 3, 1, 15, 00, 00, tzinfo=UTC) before = { @@ -49,23 +50,23 @@ index 3166322..0ecb8c0 100644 + 'tzname': ['+12', 'NCST'], # pre-2017a, NCST 'utcoffset': timedelta(hours=12), 'dst': timedelta(hours=1), - } + } after = { - 'tzname': '+11', # pre-2017a, NCT + 'tzname': ['+11', 'NCT'], # pre-2017a, NCT 'utcoffset': timedelta(hours=11), 'dst': timedelta(0), - } -@@ -541,7 +543,7 @@ class TahitiTestCase(USEasternDSTStartTestCase): + } +@@ -552,7 +554,7 @@ class TahitiTestCase(USEasternDSTStartTestCase): 'dst': timedelta(0), - } + } after = { - 'tzname': '-10', # pre-2017a, TAHT + 'tzname': ['-10', 'TAHT'], # pre-2017a, TAHT 'utcoffset': timedelta(hours=-10), 'dst': timedelta(0), - } -@@ -554,12 +556,12 @@ class SamoaInternationalDateLineChange(USEasternDSTStartTestCase): + } +@@ -565,12 +567,12 @@ class SamoaInternationalDateLineChange(USEasternDSTStartTestCase): tzinfo = pytz.timezone('Pacific/Apia') transition_time = datetime(2011, 12, 30, 10, 0, 0, tzinfo=UTC) before = { @@ -73,14 +74,14 @@ index 3166322..0ecb8c0 100644 + 'tzname': ['-10', 'SDT'], # pre-2017a, SDT 'utcoffset': timedelta(hours=-10), 'dst': timedelta(hours=1), - } + } after = { - 'tzname': '+14', # pre-2017a, WSDT + 'tzname': ['+14', 'WSDT'], # pre-2017a, WSDT 'utcoffset': timedelta(hours=14), 'dst': timedelta(hours=1), - } -@@ -612,7 +614,7 @@ class LocalTestCase(unittest.TestCase): + } +@@ -620,7 +622,7 @@ class LocalTestCase(unittest.TestCase): loc_time = loc_tz.localize(datetime(1940, 5, 10, 0, 0, 0)) # pre-2017a, abbreviation was NCT diff --git a/fix-tests.patch b/fix-tests.patch index db1407b..d791636 100644 --- a/fix-tests.patch +++ b/fix-tests.patch @@ -1,17 +1,17 @@ --- a/pytz/tests/test_tzinfo.py +++ b/pytz/tests/test_tzinfo.py -@@ -694,15 +694,6 @@ - '1914-01-01 13:40:00 UTC+0000' - ) +@@ -728,15 +728,6 @@ + '1914-01-01 13:40:00 UTC+0000' + ) - def no_testCreateLocaltime(self): - # It would be nice if this worked, but it doesn't. - tz = pytz.timezone('Europe/Amsterdam') - dt = datetime(2004, 10, 31, 2, 0, 0, tzinfo=tz) - self.assertEqual( -- dt.strftime(fmt), -- '2004-10-31 02:00:00 CET+0100' -- ) +- dt.strftime(fmt), +- '2004-10-31 02:00:00 CET+0100' +- ) - class CommonTimezonesTestCase(unittest.TestCase): diff --git a/python-pytz.changes b/python-pytz.changes index 4f6c7cb..e8f8f51 100644 --- a/python-pytz.changes +++ b/python-pytz.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Sat Feb 17 18:35:20 UTC 2018 - arun@gmx.de + +- specfile: + * update copyright year + * move from zip to tar.gz + * updated line number in patches and fixed whitespace issues: + o 0001-Fix-tests-for-older-timezone-versions.patch + o fix-tests.patch + o system-zoneinfo.patch + +- update to version 2018.3: + * Test updates for Iana 2018c changes + * delint + * lint target & update iana build rule + * Bump version numbers to 2018.3/2018c + * Include license file in the generated wheel package + * Update travis config + ------------------------------------------------------------------- Thu Nov 2 03:10:52 UTC 2017 - arun@gmx.de diff --git a/python-pytz.spec b/python-pytz.spec index eba784b..3df9ef9 100644 --- a/python-pytz.spec +++ b/python-pytz.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytz # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,14 +19,14 @@ %define oldpython python %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pytz -Version: 2017.3 +Version: 2018.3 Release: 0 Summary: World timezone definitions, modern and historical License: MIT Group: Development/Languages/Python Url: http://pytz.sourceforge.net -Source: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.zip -Source2: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.zip.asc +Source: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.tar.gz +Source2: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.tar.gz.asc Source90: pytz.keyring # PATCH-FIX-UPSTREAM fix-tests.patch -- Remote tests which are known to be broken Patch0: fix-tests.patch @@ -37,7 +37,6 @@ Patch2: 0001-Fix-tests-for-older-timezone-versions.patch BuildRequires: %{python_module devel} BuildRequires: fdupes BuildRequires: python-rpm-macros -BuildRequires: unzip # Test requirements BuildRequires: %{python_module nose} BuildRequires: timezone diff --git a/pytz-2017.3.zip b/pytz-2017.3.zip deleted file mode 100644 index 298c3ca..0000000 --- a/pytz-2017.3.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fae4cffc040921b8a2d60c6cf0b5d662c1190fe54d718271db4eb17d44a185b7 -size 527977 diff --git a/pytz-2017.3.zip.asc b/pytz-2017.3.zip.asc deleted file mode 100644 index ebf3957..0000000 --- a/pytz-2017.3.zip.asc +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2 - -iEYEABECAAYFAln3MrQACgkQAfqZj7rGN0pzowCggUYhB+WYN2w6SPryflzhs1II -HxQAn1a0zf16Al5FA4ATvq4R26PDThut -=qZkB ------END PGP SIGNATURE----- diff --git a/pytz-2018.3.tar.gz b/pytz-2018.3.tar.gz new file mode 100644 index 0000000..867052d --- /dev/null +++ b/pytz-2018.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:410bcd1d6409026fbaa65d9ed33bf6dd8b1e94a499e32168acfc7b332e4095c0 +size 314214 diff --git a/pytz-2018.3.tar.gz.asc b/pytz-2018.3.tar.gz.asc new file mode 100644 index 0000000..fed34a3 --- /dev/null +++ b/pytz-2018.3.tar.gz.asc @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iEYEABECAAYFAlp9VJYACgkQAfqZj7rGN0pSTwCbBDpA5qZ5+WHLEnYlWWLeef6+ +qVEAoIIQFcOLP7M2bDT2ep6n6lSRdW21 +=aTry +-----END PGP SIGNATURE----- diff --git a/system_zoneinfo.patch b/system_zoneinfo.patch index 3ba3588..48bf1a7 100644 --- a/system_zoneinfo.patch +++ b/system_zoneinfo.patch @@ -2,12 +2,12 @@ Index: pytz-2016.10/pytz/__init__.py =================================================================== --- pytz-2016.10.orig/pytz/__init__.py +++ pytz-2016.10/pytz/__init__.py -@@ -87,23 +87,7 @@ def open_resource(name): +@@ -90,23 +90,7 @@ def open_resource(name): for part in name_parts: if part == os.path.pardir or os.path.sep in part: raise ValueError('Bad path segment: %r' % part) - zoneinfo_dir = os.environ.get('PYTZ_TZDATADIR', None) -- if zoneinfo_dir != None: +- if zoneinfo_dir is not None: - filename = os.path.join(zoneinfo_dir, *name_parts) - else: - filename = os.path.join(os.path.dirname(__file__), @@ -31,12 +31,12 @@ Index: pytz-2016.10/pytz/tzfile.py =================================================================== --- pytz-2016.10.orig/pytz/tzfile.py +++ pytz-2016.10/pytz/tzfile.py -@@ -127,7 +127,7 @@ def build_tzinfo(zone, fp): +@@ -126,7 +126,7 @@ def build_tzinfo(zone, fp): if __name__ == '__main__': import os.path from pprint import pprint - base = os.path.join(os.path.dirname(__file__), 'zoneinfo') + base = '/usr/share/zoneinfo' tz = build_tzinfo('Australia/Melbourne', - open(os.path.join(base,'Australia','Melbourne'), 'rb')) + open(os.path.join(base, 'Australia', 'Melbourne'), 'rb')) tz = build_tzinfo('US/Eastern',