Accepting request 481643 from devel:languages:python
bsc#1027705 OBS-URL: https://build.opensuse.org/request/show/481643 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytz?expand=0&rev=23
This commit is contained in:
commit
da377c4397
@ -1,3 +1,22 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 20 19:55:27 UTC 2017 - dimstar@opensuse.org
|
||||
|
||||
- Apply pytz-2016.10-fix-tests-with-2017a.patch for Tumbleweed
|
||||
buildin.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 16 02:58:11 UTC 2017 - toddrme2178@gmail.com
|
||||
|
||||
- Implement single-spec version
|
||||
|
||||
-------------------------------------------------------------------
|
||||
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
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-pytz
|
||||
#
|
||||
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2017 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
|
||||
@ -16,35 +16,35 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-pytz
|
||||
Version: 2016.4
|
||||
Version: 2016.10
|
||||
Release: 0
|
||||
Summary: World timezone definitions, modern and historical
|
||||
License: MIT
|
||||
Group: Development/Languages/Python
|
||||
Url: http://pytz.sourceforge.net
|
||||
Source: https://pypi.python.org/packages/f4/7d/7c0c85e9c64a75dde11bc9d3e1adc4e09a42ce7cdb873baffa1598118709/pytz-2016.4.tar.bz2
|
||||
Source2: https://pypi.python.org/packages/f4/7d/7c0c85e9c64a75dde11bc9d3e1adc4e09a42ce7cdb873baffa1598118709/pytz-2016.4.tar.bz2.asc
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.tar.bz2
|
||||
Source2: https://files.pythonhosted.org/packages/source/p/pytz/pytz-%{version}.tar.bz2.asc
|
||||
Source90: pytz.keyring
|
||||
# PATCH-FIX-UPSTREAM fix-tests.patch -- Remote tests which are known to be broken
|
||||
Patch0: fix-tests.patch
|
||||
# PATCH-FEATURE-OPENSUSE -- Use system tz database (Olson database)
|
||||
Patch1: system_zoneinfo.patch
|
||||
Requires: timezone
|
||||
Patch2: pytz-2016.10-fix-tests-with-2017a.patch
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-nose
|
||||
# Tests will use this package
|
||||
BuildRequires: python-rpm-macros
|
||||
# Test requirements
|
||||
BuildRequires: %{python_module nose}
|
||||
BuildRequires: timezone
|
||||
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()")}
|
||||
%else
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
|
||||
Requires: timezone
|
||||
Provides: python-tz = 2014b
|
||||
Obsoletes: python-tz < 2014b
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildArch: noarch
|
||||
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
pytz - World Timezone Definitions for Python
|
||||
@ -60,28 +60,27 @@ Amost all of the Olson timezones are supported.
|
||||
%setup -q -n pytz-%{version}
|
||||
# Disable test which is not working (and documented so)
|
||||
%patch0 -p1
|
||||
%if 0%{?suse_version} >= 1310
|
||||
# Use system tz database
|
||||
%patch1 -p1
|
||||
# timezone 2017 a is currently only available in Leap 42.1 and Tumbleweed
|
||||
%if 0%{?sle_version} == 120100 && 0%{?is_opensuse} || 0%{?suse_version} > 1320
|
||||
%patch2 -p2
|
||||
%endif
|
||||
|
||||
# For rpmlint warning: remove shebang from python library:
|
||||
sed -i '/^#!/d' ./pytz/tzfile.py
|
||||
|
||||
%build
|
||||
python setup.py build
|
||||
%python_build
|
||||
|
||||
%install
|
||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||
# Remove the pytz zoneinfo only if we use the system tz database
|
||||
%if 0%{?suse_version} >= 1310
|
||||
rm -fr %{buildroot}%{python_sitelib}/pytz/zoneinfo
|
||||
%endif
|
||||
%fdupes %{buildroot}%{python_sitelib}
|
||||
%python_install
|
||||
%python_expand rm -fr %{buildroot}%{$python_sitelib}/pytz/zoneinfo
|
||||
|
||||
%check
|
||||
nosetests
|
||||
%python_expand nosetests-%{$python_bin_suffix}
|
||||
|
||||
%files
|
||||
%files %{python_files}
|
||||
%defattr(-,root,root,-)
|
||||
%doc LICENSE.txt README.txt
|
||||
%{python_sitelib}/*
|
||||
|
75
pytz-2016.10-fix-tests-with-2017a.patch
Normal file
75
pytz-2016.10-fix-tests-with-2017a.patch
Normal file
@ -0,0 +1,75 @@
|
||||
From 838d7f06908c14352b0d4f3c5b656d0d95abaf9e Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Stieger <astieger@suse.com>
|
||||
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
|
||||
|
3
pytz-2016.10.tar.bz2
Normal file
3
pytz-2016.10.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7016b2c4fa075c564b81c37a252a5fccf60d8964aa31b7f5eae59aeb594ae02b
|
||||
size 172920
|
7
pytz-2016.10.tar.bz2.asc
Normal file
7
pytz-2016.10.tar.bz2.asc
Normal file
@ -0,0 +1,7 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v2
|
||||
|
||||
iEYEABECAAYFAlhGjDcACgkQAfqZj7rGN0qkzACdHUgHv+qfjc6+vHuInFZQD5od
|
||||
DVwAniNLVslM9oeAXOWa9oQge2gbJuws
|
||||
=4xm3
|
||||
-----END PGP SIGNATURE-----
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ee7c751544e35a7b7fb5e3fb25a49dade37d51e70a93e5107f10575d7102c311
|
||||
size 171959
|
@ -1,7 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1
|
||||
|
||||
iEYEABECAAYFAlcaIxIACgkQAfqZj7rGN0pJ2ACfbHdK2WdyrymaAVFBBnSC7OAI
|
||||
bd8AoIX2+ga13T2KGW3HPwj1fjtJLNUL
|
||||
=ZpuM
|
||||
-----END PGP SIGNATURE-----
|
@ -1,38 +1,32 @@
|
||||
Index: pytz-2014.9/pytz/__init__.py
|
||||
Index: pytz-2016.10/pytz/__init__.py
|
||||
===================================================================
|
||||
--- pytz-2014.9.orig/pytz/__init__.py
|
||||
+++ pytz-2014.9/pytz/__init__.py
|
||||
@@ -25,11 +25,6 @@ __all__ = [
|
||||
|
||||
import sys, datetime, os.path, gettext
|
||||
|
||||
-try:
|
||||
- from pkg_resources import resource_stream
|
||||
-except ImportError:
|
||||
- resource_stream = None
|
||||
-
|
||||
from pytz.exceptions import AmbiguousTimeError
|
||||
from pytz.exceptions import InvalidTimeError
|
||||
from pytz.exceptions import NonExistentTimeError
|
||||
@@ -86,13 +81,7 @@ def open_resource(name):
|
||||
--- pytz-2016.10.orig/pytz/__init__.py
|
||||
+++ pytz-2016.10/pytz/__init__.py
|
||||
@@ -81,19 +81,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)
|
||||
- filename = os.path.join(os.path.dirname(__file__),
|
||||
- 'zoneinfo', *name_parts)
|
||||
- if not os.path.exists(filename) and resource_stream is not None:
|
||||
- if not os.path.exists(filename):
|
||||
- # http://bugs.launchpad.net/bugs/383171 - we avoid using this
|
||||
- # unless absolutely necessary to help when a broken version of
|
||||
- # pkg_resources is installed.
|
||||
- return resource_stream(__name__, 'zoneinfo/' + name)
|
||||
- try:
|
||||
- from pkg_resources import resource_stream
|
||||
- except ImportError:
|
||||
- resource_stream = None
|
||||
-
|
||||
- if resource_stream is not None:
|
||||
- return resource_stream(__name__, 'zoneinfo/' + name)
|
||||
+ filename = os.path.join('/usr/share/zoneinfo', *name_parts)
|
||||
return open(filename, 'rb')
|
||||
|
||||
|
||||
Index: pytz-2014.9/pytz/tzfile.py
|
||||
Index: pytz-2016.10/pytz/tzfile.py
|
||||
===================================================================
|
||||
--- pytz-2014.9.orig/pytz/tzfile.py
|
||||
+++ pytz-2014.9/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):
|
||||
if __name__ == '__main__':
|
||||
import os.path
|
||||
|
Loading…
Reference in New Issue
Block a user