Update to 2015.4 (bug #1161236)
- Do not ship zoneinfo with python3 package (bug #1251554) - Run tests
This commit is contained in:
parent
9ffba5f4dd
commit
5eac851b8d
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
pytz-2010h.tar.gz
|
||||
/pytz-2012d.tar.gz
|
||||
/pytz-2015.4.tar.gz
|
||||
|
@ -1,6 +1,7 @@
|
||||
--- pytz/__init__.py.orig 2012-09-14 08:22:53.072928561 -0500
|
||||
+++ pytz/__init__.py 2012-09-14 08:28:48.981920622 -0500
|
||||
@@ -80,24 +80,19 @@
|
||||
diff -up pytz-2015.4/pytz/__init__.py.orig pytz-2015.4/pytz/__init__.py
|
||||
--- pytz-2015.4/pytz/__init__.py.orig 2015-05-13 04:50:26.000000000 -0600
|
||||
+++ pytz-2015.4/pytz/__init__.py 2015-08-30 14:56:56.837511078 -0600
|
||||
@@ -75,24 +75,19 @@ else: # Python 2.x
|
||||
"""
|
||||
return s.encode('US-ASCII')
|
||||
|
||||
@ -29,7 +30,7 @@
|
||||
return open(filename, 'rb')
|
||||
|
||||
|
||||
@@ -520,1018 +515,31 @@
|
||||
@@ -487,1025 +482,36 @@ def _test():
|
||||
if __name__ == '__main__':
|
||||
_test()
|
||||
|
||||
@ -262,6 +263,7 @@
|
||||
- 'Antarctica/Rothera',
|
||||
- 'Antarctica/South_Pole',
|
||||
- 'Antarctica/Syowa',
|
||||
- 'Antarctica/Troll',
|
||||
- 'Antarctica/Vostok',
|
||||
- 'Arctic/Longyearbyen',
|
||||
- 'Asia/Aden',
|
||||
@ -280,6 +282,7 @@
|
||||
- 'Asia/Bishkek',
|
||||
- 'Asia/Brunei',
|
||||
- 'Asia/Calcutta',
|
||||
- 'Asia/Chita',
|
||||
- 'Asia/Choibalsan',
|
||||
- 'Asia/Chongqing',
|
||||
- 'Asia/Chungking',
|
||||
@ -307,6 +310,7 @@
|
||||
- 'Asia/Kashgar',
|
||||
- 'Asia/Kathmandu',
|
||||
- 'Asia/Katmandu',
|
||||
- 'Asia/Khandyga',
|
||||
- 'Asia/Kolkata',
|
||||
- 'Asia/Krasnoyarsk',
|
||||
- 'Asia/Kuala_Lumpur',
|
||||
@ -336,6 +340,7 @@
|
||||
- 'Asia/Seoul',
|
||||
- 'Asia/Shanghai',
|
||||
- 'Asia/Singapore',
|
||||
- 'Asia/Srednekolymsk',
|
||||
- 'Asia/Taipei',
|
||||
- 'Asia/Tashkent',
|
||||
- 'Asia/Tbilisi',
|
||||
@ -348,6 +353,7 @@
|
||||
- 'Asia/Ulaanbaatar',
|
||||
- 'Asia/Ulan_Bator',
|
||||
- 'Asia/Urumqi',
|
||||
- 'Asia/Ust-Nera',
|
||||
- 'Asia/Vientiane',
|
||||
- 'Asia/Vladivostok',
|
||||
- 'Asia/Yakutsk',
|
||||
@ -456,6 +462,7 @@
|
||||
- 'Europe/Brussels',
|
||||
- 'Europe/Bucharest',
|
||||
- 'Europe/Budapest',
|
||||
- 'Europe/Busingen',
|
||||
- 'Europe/Chisinau',
|
||||
- 'Europe/Copenhagen',
|
||||
- 'Europe/Dublin',
|
||||
@ -544,6 +551,7 @@
|
||||
- 'PST8PDT',
|
||||
- 'Pacific/Apia',
|
||||
- 'Pacific/Auckland',
|
||||
- 'Pacific/Bougainville',
|
||||
- 'Pacific/Chatham',
|
||||
- 'Pacific/Chuuk',
|
||||
- 'Pacific/Easter',
|
||||
@ -609,21 +617,21 @@
|
||||
- 'W-SU',
|
||||
- 'WET',
|
||||
- 'Zulu']
|
||||
-all_timezones = [
|
||||
- tz for tz in all_timezones if resource_exists(tz)]
|
||||
+all_timezones = []
|
||||
+for root, dirs, files in os.walk(_tzinfo_dir):
|
||||
+ for exclude in "posix", "right":
|
||||
+ for exclude in 'posix', 'right':
|
||||
+ if exclude in dirs:
|
||||
+ del dirs[dirs.index(exclude)]
|
||||
+
|
||||
+ all_timezones.extend(os.path.join(root, file)[len(_tzinfo_dir)+1:]
|
||||
+ for file in files
|
||||
+ if file != "README" and file != "Theory"
|
||||
+ and "." not in file)
|
||||
+all_timezones.sort()
|
||||
+ all_timezones.extend(os.path.join(root, tz_file)[len(_tzinfo_dir)+1:]
|
||||
+ for tz_file in files
|
||||
+ if tz_file != 'README' and tz_file != 'Theory'
|
||||
+ and '.' not in tz_file)
|
||||
+
|
||||
all_timezones = LazyList(
|
||||
tz for tz in all_timezones if resource_exists(tz))
|
||||
|
||||
all_timezones_set = set(all_timezones)
|
||||
all_timezones_set = LazySet(all_timezones)
|
||||
-common_timezones = \
|
||||
-['Africa/Abidjan',
|
||||
- 'Africa/Accra',
|
||||
@ -774,7 +782,6 @@
|
||||
- 'America/Moncton',
|
||||
- 'America/Monterrey',
|
||||
- 'America/Montevideo',
|
||||
- 'America/Montreal',
|
||||
- 'America/Montserrat',
|
||||
- 'America/Nassau',
|
||||
- 'America/New_York',
|
||||
@ -805,7 +812,6 @@
|
||||
- 'America/Santo_Domingo',
|
||||
- 'America/Sao_Paulo',
|
||||
- 'America/Scoresbysund',
|
||||
- 'America/Shiprock',
|
||||
- 'America/Sitka',
|
||||
- 'America/St_Barthelemy',
|
||||
- 'America/St_Johns',
|
||||
@ -833,8 +839,8 @@
|
||||
- 'Antarctica/McMurdo',
|
||||
- 'Antarctica/Palmer',
|
||||
- 'Antarctica/Rothera',
|
||||
- 'Antarctica/South_Pole',
|
||||
- 'Antarctica/Syowa',
|
||||
- 'Antarctica/Troll',
|
||||
- 'Antarctica/Vostok',
|
||||
- 'Arctic/Longyearbyen',
|
||||
- 'Asia/Aden',
|
||||
@ -851,8 +857,8 @@
|
||||
- 'Asia/Beirut',
|
||||
- 'Asia/Bishkek',
|
||||
- 'Asia/Brunei',
|
||||
- 'Asia/Chita',
|
||||
- 'Asia/Choibalsan',
|
||||
- 'Asia/Chongqing',
|
||||
- 'Asia/Colombo',
|
||||
- 'Asia/Damascus',
|
||||
- 'Asia/Dhaka',
|
||||
@ -860,7 +866,6 @@
|
||||
- 'Asia/Dubai',
|
||||
- 'Asia/Dushanbe',
|
||||
- 'Asia/Gaza',
|
||||
- 'Asia/Harbin',
|
||||
- 'Asia/Hebron',
|
||||
- 'Asia/Ho_Chi_Minh',
|
||||
- 'Asia/Hong_Kong',
|
||||
@ -872,8 +877,8 @@
|
||||
- 'Asia/Kabul',
|
||||
- 'Asia/Kamchatka',
|
||||
- 'Asia/Karachi',
|
||||
- 'Asia/Kashgar',
|
||||
- 'Asia/Kathmandu',
|
||||
- 'Asia/Khandyga',
|
||||
- 'Asia/Kolkata',
|
||||
- 'Asia/Krasnoyarsk',
|
||||
- 'Asia/Kuala_Lumpur',
|
||||
@ -901,6 +906,7 @@
|
||||
- 'Asia/Seoul',
|
||||
- 'Asia/Shanghai',
|
||||
- 'Asia/Singapore',
|
||||
- 'Asia/Srednekolymsk',
|
||||
- 'Asia/Taipei',
|
||||
- 'Asia/Tashkent',
|
||||
- 'Asia/Tbilisi',
|
||||
@ -909,6 +915,7 @@
|
||||
- 'Asia/Tokyo',
|
||||
- 'Asia/Ulaanbaatar',
|
||||
- 'Asia/Urumqi',
|
||||
- 'Asia/Ust-Nera',
|
||||
- 'Asia/Vientiane',
|
||||
- 'Asia/Vladivostok',
|
||||
- 'Asia/Yakutsk',
|
||||
@ -951,6 +958,7 @@
|
||||
- 'Europe/Brussels',
|
||||
- 'Europe/Bucharest',
|
||||
- 'Europe/Budapest',
|
||||
- 'Europe/Busingen',
|
||||
- 'Europe/Chisinau',
|
||||
- 'Europe/Copenhagen',
|
||||
- 'Europe/Dublin',
|
||||
@ -1011,6 +1019,7 @@
|
||||
- 'Indian/Reunion',
|
||||
- 'Pacific/Apia',
|
||||
- 'Pacific/Auckland',
|
||||
- 'Pacific/Bougainville',
|
||||
- 'Pacific/Chatham',
|
||||
- 'Pacific/Chuuk',
|
||||
- 'Pacific/Easter',
|
||||
@ -1055,14 +1064,12 @@
|
||||
- 'US/Mountain',
|
||||
- 'US/Pacific',
|
||||
- 'UTC']
|
||||
-common_timezones = [
|
||||
- tz for tz in common_timezones if tz in all_timezones]
|
||||
-
|
||||
+
|
||||
+common_timezones = [l.split()[2]
|
||||
+ for l in open(os.path.join(_tzinfo_dir, "zone.tab"))
|
||||
+ if l != "" and l[0] != "#"]\
|
||||
+ + ['GMT',
|
||||
+ for l in open(os.path.join(_tzinfo_dir, 'zone.tab'))
|
||||
+ if l != '' and l[0] != '#']
|
||||
+common_timezones.extend(
|
||||
+ ['GMT',
|
||||
+ 'US/Alaska',
|
||||
+ 'US/Arizona',
|
||||
+ 'US/Central',
|
||||
@ -1070,6 +1077,8 @@
|
||||
+ 'US/Hawaii',
|
||||
+ 'US/Mountain',
|
||||
+ 'US/Pacific',
|
||||
+ 'UTC']
|
||||
+common_timezones.sort()
|
||||
common_timezones_set = set(common_timezones)
|
||||
+ 'UTC'])
|
||||
+
|
||||
common_timezones = LazyList(
|
||||
tz for tz in common_timezones if tz in all_timezones)
|
||||
|
53
pytz.spec
53
pytz.spec
@ -5,26 +5,23 @@
|
||||
%endif
|
||||
|
||||
Name: pytz
|
||||
Version: 2012d
|
||||
Release: 8%{?dist}
|
||||
Version: 2015.4
|
||||
Release: 1%{?dist}
|
||||
Summary: World Timezone Definitions for Python
|
||||
|
||||
Group: Development/Languages
|
||||
License: MIT
|
||||
URL: http://pytz.sourceforge.net/
|
||||
Source0: http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
|
||||
Patch0: pytz-2012d_zoneinfo.patch
|
||||
Patch0: pytz-zoneinfo.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python2-devel
|
||||
|
||||
%if 0%{?with_python3}
|
||||
BuildRequires: python3-devel
|
||||
%endif
|
||||
|
||||
Requires: tzdata
|
||||
BuildRequires: pytest
|
||||
Requires: tzdata
|
||||
Provides: python2-pytz = %{version}-%{release}
|
||||
|
||||
%description
|
||||
pytz brings the Olson tz database into Python. This library allows accurate
|
||||
@ -33,14 +30,17 @@ also solves the issue of ambiguous times at the end of daylight savings,
|
||||
which you can read more about in the Python Library Reference
|
||||
(datetime.tzinfo).
|
||||
|
||||
Amost all (over 540) of the Olson timezones are supported.
|
||||
Almost all (over 540) of the Olson timezones are supported.
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%package -n python3-%{name}
|
||||
Requires: python3
|
||||
Summary: World Timezone Definitions for Python
|
||||
Summary: World Timezone Definitions for Python
|
||||
Group: Development/Languages
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-pytest
|
||||
Requires: tzdata
|
||||
|
||||
Group: Development/Languages
|
||||
%description -n python3-%{name}
|
||||
pytz brings the Olson tz database into Python. This library allows accurate
|
||||
and cross platform timezone calculations using Python 2.3 or higher. It
|
||||
@ -48,39 +48,39 @@ also solves the issue of ambiguous times at the end of daylight savings,
|
||||
which you can read more about in the Python Library Reference
|
||||
(datetime.tzinfo).
|
||||
|
||||
Amost all (over 540) of the Olson timezones are supported.
|
||||
Almost all (over 540) of the Olson timezones are supported.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p0
|
||||
%patch0 -p1 -b .zonezinfo
|
||||
|
||||
%if 0%{?with_python3}
|
||||
cp -a . %{py3dir}
|
||||
%endif
|
||||
|
||||
%build
|
||||
%{__python} setup.py build
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py build
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
|
||||
|
||||
%install
|
||||
%{__python} setup.py install --skip-build --root %{buildroot}
|
||||
chmod +x %{buildroot}%{python2_sitelib}/pytz/*.py
|
||||
rm -rf %{buildroot}%{python2_sitelib}/pytz/zoneinfo
|
||||
rm -r %{buildroot}%{python2_sitelib}/pytz/zoneinfo
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py install --skip-build --root %{buildroot}
|
||||
popd
|
||||
rm -r %{buildroot}%{python3_sitelib}/pytz/zoneinfo
|
||||
%endif # with_python3
|
||||
|
||||
|
||||
%check
|
||||
PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-%{python2_version} -v
|
||||
%if 0%{?with_python3}
|
||||
PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-%{python3_version} -v
|
||||
%endif
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
@ -99,6 +99,11 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Aug 30 2015 Orion Poplawski <orion@cora.nwra.com> - 2015.4-1
|
||||
- Update to 2015.4 (bug #1161236)
|
||||
- Do not ship zoneinfo with python3 package (bug #1251554)
|
||||
- Run tests
|
||||
|
||||
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2012d-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user