Update to 2015.4 (bug #1161236)

- Do not ship zoneinfo with python3 package (bug #1251554)
- Run tests
This commit is contained in:
Orion Poplawski 2015-08-30 15:50:28 -06:00
parent 9ffba5f4dd
commit 5eac851b8d
4 changed files with 68 additions and 53 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
pytz-2010h.tar.gz pytz-2010h.tar.gz
/pytz-2012d.tar.gz /pytz-2012d.tar.gz
/pytz-2015.4.tar.gz

View File

@ -1,6 +1,7 @@
--- pytz/__init__.py.orig 2012-09-14 08:22:53.072928561 -0500 diff -up pytz-2015.4/pytz/__init__.py.orig pytz-2015.4/pytz/__init__.py
+++ pytz/__init__.py 2012-09-14 08:28:48.981920622 -0500 --- pytz-2015.4/pytz/__init__.py.orig 2015-05-13 04:50:26.000000000 -0600
@@ -80,24 +80,19 @@ +++ 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') return s.encode('US-ASCII')
@ -29,7 +30,7 @@
return open(filename, 'rb') return open(filename, 'rb')
@@ -520,1018 +515,31 @@ @@ -487,1025 +482,36 @@ def _test():
if __name__ == '__main__': if __name__ == '__main__':
_test() _test()
@ -262,6 +263,7 @@
- 'Antarctica/Rothera', - 'Antarctica/Rothera',
- 'Antarctica/South_Pole', - 'Antarctica/South_Pole',
- 'Antarctica/Syowa', - 'Antarctica/Syowa',
- 'Antarctica/Troll',
- 'Antarctica/Vostok', - 'Antarctica/Vostok',
- 'Arctic/Longyearbyen', - 'Arctic/Longyearbyen',
- 'Asia/Aden', - 'Asia/Aden',
@ -280,6 +282,7 @@
- 'Asia/Bishkek', - 'Asia/Bishkek',
- 'Asia/Brunei', - 'Asia/Brunei',
- 'Asia/Calcutta', - 'Asia/Calcutta',
- 'Asia/Chita',
- 'Asia/Choibalsan', - 'Asia/Choibalsan',
- 'Asia/Chongqing', - 'Asia/Chongqing',
- 'Asia/Chungking', - 'Asia/Chungking',
@ -307,6 +310,7 @@
- 'Asia/Kashgar', - 'Asia/Kashgar',
- 'Asia/Kathmandu', - 'Asia/Kathmandu',
- 'Asia/Katmandu', - 'Asia/Katmandu',
- 'Asia/Khandyga',
- 'Asia/Kolkata', - 'Asia/Kolkata',
- 'Asia/Krasnoyarsk', - 'Asia/Krasnoyarsk',
- 'Asia/Kuala_Lumpur', - 'Asia/Kuala_Lumpur',
@ -336,6 +340,7 @@
- 'Asia/Seoul', - 'Asia/Seoul',
- 'Asia/Shanghai', - 'Asia/Shanghai',
- 'Asia/Singapore', - 'Asia/Singapore',
- 'Asia/Srednekolymsk',
- 'Asia/Taipei', - 'Asia/Taipei',
- 'Asia/Tashkent', - 'Asia/Tashkent',
- 'Asia/Tbilisi', - 'Asia/Tbilisi',
@ -348,6 +353,7 @@
- 'Asia/Ulaanbaatar', - 'Asia/Ulaanbaatar',
- 'Asia/Ulan_Bator', - 'Asia/Ulan_Bator',
- 'Asia/Urumqi', - 'Asia/Urumqi',
- 'Asia/Ust-Nera',
- 'Asia/Vientiane', - 'Asia/Vientiane',
- 'Asia/Vladivostok', - 'Asia/Vladivostok',
- 'Asia/Yakutsk', - 'Asia/Yakutsk',
@ -456,6 +462,7 @@
- 'Europe/Brussels', - 'Europe/Brussels',
- 'Europe/Bucharest', - 'Europe/Bucharest',
- 'Europe/Budapest', - 'Europe/Budapest',
- 'Europe/Busingen',
- 'Europe/Chisinau', - 'Europe/Chisinau',
- 'Europe/Copenhagen', - 'Europe/Copenhagen',
- 'Europe/Dublin', - 'Europe/Dublin',
@ -544,6 +551,7 @@
- 'PST8PDT', - 'PST8PDT',
- 'Pacific/Apia', - 'Pacific/Apia',
- 'Pacific/Auckland', - 'Pacific/Auckland',
- 'Pacific/Bougainville',
- 'Pacific/Chatham', - 'Pacific/Chatham',
- 'Pacific/Chuuk', - 'Pacific/Chuuk',
- 'Pacific/Easter', - 'Pacific/Easter',
@ -609,21 +617,21 @@
- 'W-SU', - 'W-SU',
- 'WET', - 'WET',
- 'Zulu'] - 'Zulu']
-all_timezones = [
- tz for tz in all_timezones if resource_exists(tz)]
+all_timezones = [] +all_timezones = []
+for root, dirs, files in os.walk(_tzinfo_dir): +for root, dirs, files in os.walk(_tzinfo_dir):
+ for exclude in "posix", "right": + for exclude in 'posix', 'right':
+ if exclude in dirs: + if exclude in dirs:
+ del dirs[dirs.index(exclude)] + del dirs[dirs.index(exclude)]
+ +
+ all_timezones.extend(os.path.join(root, file)[len(_tzinfo_dir)+1:] + all_timezones.extend(os.path.join(root, tz_file)[len(_tzinfo_dir)+1:]
+ for file in files + for tz_file in files
+ if file != "README" and file != "Theory" + if tz_file != 'README' and tz_file != 'Theory'
+ and "." not in file) + and '.' not in tz_file)
+all_timezones.sort() +
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 = \ -common_timezones = \
-['Africa/Abidjan', -['Africa/Abidjan',
- 'Africa/Accra', - 'Africa/Accra',
@ -774,7 +782,6 @@
- 'America/Moncton', - 'America/Moncton',
- 'America/Monterrey', - 'America/Monterrey',
- 'America/Montevideo', - 'America/Montevideo',
- 'America/Montreal',
- 'America/Montserrat', - 'America/Montserrat',
- 'America/Nassau', - 'America/Nassau',
- 'America/New_York', - 'America/New_York',
@ -805,7 +812,6 @@
- 'America/Santo_Domingo', - 'America/Santo_Domingo',
- 'America/Sao_Paulo', - 'America/Sao_Paulo',
- 'America/Scoresbysund', - 'America/Scoresbysund',
- 'America/Shiprock',
- 'America/Sitka', - 'America/Sitka',
- 'America/St_Barthelemy', - 'America/St_Barthelemy',
- 'America/St_Johns', - 'America/St_Johns',
@ -833,8 +839,8 @@
- 'Antarctica/McMurdo', - 'Antarctica/McMurdo',
- 'Antarctica/Palmer', - 'Antarctica/Palmer',
- 'Antarctica/Rothera', - 'Antarctica/Rothera',
- 'Antarctica/South_Pole',
- 'Antarctica/Syowa', - 'Antarctica/Syowa',
- 'Antarctica/Troll',
- 'Antarctica/Vostok', - 'Antarctica/Vostok',
- 'Arctic/Longyearbyen', - 'Arctic/Longyearbyen',
- 'Asia/Aden', - 'Asia/Aden',
@ -851,8 +857,8 @@
- 'Asia/Beirut', - 'Asia/Beirut',
- 'Asia/Bishkek', - 'Asia/Bishkek',
- 'Asia/Brunei', - 'Asia/Brunei',
- 'Asia/Chita',
- 'Asia/Choibalsan', - 'Asia/Choibalsan',
- 'Asia/Chongqing',
- 'Asia/Colombo', - 'Asia/Colombo',
- 'Asia/Damascus', - 'Asia/Damascus',
- 'Asia/Dhaka', - 'Asia/Dhaka',
@ -860,7 +866,6 @@
- 'Asia/Dubai', - 'Asia/Dubai',
- 'Asia/Dushanbe', - 'Asia/Dushanbe',
- 'Asia/Gaza', - 'Asia/Gaza',
- 'Asia/Harbin',
- 'Asia/Hebron', - 'Asia/Hebron',
- 'Asia/Ho_Chi_Minh', - 'Asia/Ho_Chi_Minh',
- 'Asia/Hong_Kong', - 'Asia/Hong_Kong',
@ -872,8 +877,8 @@
- 'Asia/Kabul', - 'Asia/Kabul',
- 'Asia/Kamchatka', - 'Asia/Kamchatka',
- 'Asia/Karachi', - 'Asia/Karachi',
- 'Asia/Kashgar',
- 'Asia/Kathmandu', - 'Asia/Kathmandu',
- 'Asia/Khandyga',
- 'Asia/Kolkata', - 'Asia/Kolkata',
- 'Asia/Krasnoyarsk', - 'Asia/Krasnoyarsk',
- 'Asia/Kuala_Lumpur', - 'Asia/Kuala_Lumpur',
@ -901,6 +906,7 @@
- 'Asia/Seoul', - 'Asia/Seoul',
- 'Asia/Shanghai', - 'Asia/Shanghai',
- 'Asia/Singapore', - 'Asia/Singapore',
- 'Asia/Srednekolymsk',
- 'Asia/Taipei', - 'Asia/Taipei',
- 'Asia/Tashkent', - 'Asia/Tashkent',
- 'Asia/Tbilisi', - 'Asia/Tbilisi',
@ -909,6 +915,7 @@
- 'Asia/Tokyo', - 'Asia/Tokyo',
- 'Asia/Ulaanbaatar', - 'Asia/Ulaanbaatar',
- 'Asia/Urumqi', - 'Asia/Urumqi',
- 'Asia/Ust-Nera',
- 'Asia/Vientiane', - 'Asia/Vientiane',
- 'Asia/Vladivostok', - 'Asia/Vladivostok',
- 'Asia/Yakutsk', - 'Asia/Yakutsk',
@ -951,6 +958,7 @@
- 'Europe/Brussels', - 'Europe/Brussels',
- 'Europe/Bucharest', - 'Europe/Bucharest',
- 'Europe/Budapest', - 'Europe/Budapest',
- 'Europe/Busingen',
- 'Europe/Chisinau', - 'Europe/Chisinau',
- 'Europe/Copenhagen', - 'Europe/Copenhagen',
- 'Europe/Dublin', - 'Europe/Dublin',
@ -1011,6 +1019,7 @@
- 'Indian/Reunion', - 'Indian/Reunion',
- 'Pacific/Apia', - 'Pacific/Apia',
- 'Pacific/Auckland', - 'Pacific/Auckland',
- 'Pacific/Bougainville',
- 'Pacific/Chatham', - 'Pacific/Chatham',
- 'Pacific/Chuuk', - 'Pacific/Chuuk',
- 'Pacific/Easter', - 'Pacific/Easter',
@ -1055,14 +1064,12 @@
- 'US/Mountain', - 'US/Mountain',
- 'US/Pacific', - 'US/Pacific',
- 'UTC'] - 'UTC']
-common_timezones = [
- tz for tz in common_timezones if tz in all_timezones]
-
+ +
+common_timezones = [l.split()[2] +common_timezones = [l.split()[2]
+ for l in open(os.path.join(_tzinfo_dir, "zone.tab")) + for l in open(os.path.join(_tzinfo_dir, 'zone.tab'))
+ if l != "" and l[0] != "#"]\ + if l != '' and l[0] != '#']
+ + ['GMT', +common_timezones.extend(
+ ['GMT',
+ 'US/Alaska', + 'US/Alaska',
+ 'US/Arizona', + 'US/Arizona',
+ 'US/Central', + 'US/Central',
@ -1070,6 +1077,8 @@
+ 'US/Hawaii', + 'US/Hawaii',
+ 'US/Mountain', + 'US/Mountain',
+ 'US/Pacific', + 'US/Pacific',
+ 'UTC'] + 'UTC'])
+common_timezones.sort() +
common_timezones_set = set(common_timezones) common_timezones = LazyList(
tz for tz in common_timezones if tz in all_timezones)

View File

@ -5,26 +5,23 @@
%endif %endif
Name: pytz Name: pytz
Version: 2012d Version: 2015.4
Release: 8%{?dist} Release: 1%{?dist}
Summary: World Timezone Definitions for Python Summary: World Timezone Definitions for Python
Group: Development/Languages Group: Development/Languages
License: MIT License: MIT
URL: http://pytz.sourceforge.net/ URL: http://pytz.sourceforge.net/
Source0: http://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz 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) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: pytest
%if 0%{?with_python3} Requires: tzdata
BuildRequires: python3-devel Provides: python2-pytz = %{version}-%{release}
%endif
Requires: tzdata
%description %description
pytz brings the Olson tz database into Python. This library allows accurate 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 which you can read more about in the Python Library Reference
(datetime.tzinfo). (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} %if 0%{?with_python3}
%package -n python3-%{name} %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} %description -n python3-%{name}
pytz brings the Olson tz database into Python. This library allows accurate pytz brings the Olson tz database into Python. This library allows accurate
and cross platform timezone calculations using Python 2.3 or higher. It 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 which you can read more about in the Python Library Reference
(datetime.tzinfo). (datetime.tzinfo).
Amost all (over 540) of the Olson timezones are supported. Almost all (over 540) of the Olson timezones are supported.
%endif %endif
%prep %prep
%setup -q %setup -q
%patch0 -p0 %patch0 -p1 -b .zonezinfo
%if 0%{?with_python3}
cp -a . %{py3dir}
%endif
%build %build
%{__python} setup.py build %{__python} setup.py build
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build %{__python3} setup.py build
popd
%endif # with_python3 %endif # with_python3
%install %install
%{__python} setup.py install --skip-build --root %{buildroot} %{__python} setup.py install --skip-build --root %{buildroot}
chmod +x %{buildroot}%{python2_sitelib}/pytz/*.py 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} %if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot} %{__python3} setup.py install --skip-build --root %{buildroot}
popd rm -r %{buildroot}%{python3_sitelib}/pytz/zoneinfo
%endif # with_python3 %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 %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -99,6 +99,11 @@ rm -rf $RPM_BUILD_ROOT
%changelog %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 * Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2012d-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

View File

@ -1 +1 @@
bf01c4fc9b64b164c3e2bb9c5477a544 pytz-2012d.tar.gz 417a47b1c432d90333e42084a605d3d8 pytz-2015.4.tar.gz