Compare commits

..

No commits in common. "3fb02efa6dcddda364316d323ff67daed9268d71" and "caf859905e1ea8e16bcf6e407d77b09eec975562" have entirely different histories.

5 changed files with 41 additions and 43 deletions

BIN
pytz-2020.1.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
diff --git a/pytz/__init__.py b/pytz/__init__.py diff --git a/pytz/__init__.py b/pytz/__init__.py
index e2f49fa..65c1d11 100644 index d217c96..2b1ac03 100644
--- a/pytz/__init__.py --- a/pytz/__init__.py
+++ b/pytz/__init__.py +++ b/pytz/__init__.py
@@ -74,6 +74,9 @@ else: # Python 2.x @@ -74,6 +74,9 @@ else: # Python 2.x
@ -38,9 +38,9 @@ index e2f49fa..65c1d11 100644
return open(filename, 'rb') return open(filename, 'rb')
--- a/pytz/__init__.py~ 2021-10-04 09:16:08.981477792 -0500 --- pytz-2019.2/pytz/__init__.py~ 2019-07-31 12:32:00.000000000 -0500
+++ b/pytz/__init__.py 2021-10-04 11:29:19.283758542 -0500 +++ pytz-2019.2/pytz/__init__.py 2019-07-31 12:44:07.995969364 -0500
@@ -502,1045 +502,37 @@ @@ -495,1045 +495,37 @@
if __name__ == '__main__': if __name__ == '__main__':
_test() _test()
@ -588,7 +588,6 @@ index e2f49fa..65c1d11 100644
- 'Pacific/Guam', - 'Pacific/Guam',
- 'Pacific/Honolulu', - 'Pacific/Honolulu',
- 'Pacific/Johnston', - 'Pacific/Johnston',
- 'Pacific/Kanton',
- 'Pacific/Kiritimati', - 'Pacific/Kiritimati',
- 'Pacific/Kosrae', - 'Pacific/Kosrae',
- 'Pacific/Kwajalein', - 'Pacific/Kwajalein',
@ -639,6 +638,7 @@ index e2f49fa..65c1d11 100644
- 'W-SU', - 'W-SU',
- 'WET', - 'WET',
- 'Zulu'] - 'Zulu']
+
+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':
@ -962,6 +962,7 @@ index e2f49fa..65c1d11 100644
- 'Australia/Adelaide', - 'Australia/Adelaide',
- 'Australia/Brisbane', - 'Australia/Brisbane',
- 'Australia/Broken_Hill', - 'Australia/Broken_Hill',
- 'Australia/Currie',
- 'Australia/Darwin', - 'Australia/Darwin',
- 'Australia/Eucla', - 'Australia/Eucla',
- 'Australia/Hobart', - 'Australia/Hobart',
@ -1055,6 +1056,7 @@ index e2f49fa..65c1d11 100644
- 'Pacific/Chuuk', - 'Pacific/Chuuk',
- 'Pacific/Easter', - 'Pacific/Easter',
- 'Pacific/Efate', - 'Pacific/Efate',
- 'Pacific/Enderbury',
- 'Pacific/Fakaofo', - 'Pacific/Fakaofo',
- 'Pacific/Fiji', - 'Pacific/Fiji',
- 'Pacific/Funafuti', - 'Pacific/Funafuti',
@ -1063,7 +1065,6 @@ index e2f49fa..65c1d11 100644
- 'Pacific/Guadalcanal', - 'Pacific/Guadalcanal',
- 'Pacific/Guam', - 'Pacific/Guam',
- 'Pacific/Honolulu', - 'Pacific/Honolulu',
- 'Pacific/Kanton',
- 'Pacific/Kiritimati', - 'Pacific/Kiritimati',
- 'Pacific/Kosrae', - 'Pacific/Kosrae',
- 'Pacific/Kwajalein', - 'Pacific/Kwajalein',
@ -1095,10 +1096,9 @@ index e2f49fa..65c1d11 100644
- 'US/Pacific', - 'US/Pacific',
- 'UTC'] - 'UTC']
+ +
+with open(os.path.join(_tzinfo_dir, 'zone.tab')) as zonetab: +common_timezones = [l.split()[2]
+ common_timezones = [l.split()[2] + for l in open(os.path.join(_tzinfo_dir, 'zone.tab'))
+ for l in zonetab + if l != '' and l[0] != '#']
+ if l != '' and l[0] != '#']
+common_timezones.extend( +common_timezones.extend(
+ ['GMT', + ['GMT',
+ 'US/Alaska', + 'US/Alaska',

View File

@ -1,16 +1,14 @@
%bcond_with tests
Name: pytz Name: pytz
Version: 2021.3 Version: 2020.1
Release: 2 Release: 1
Summary: World Timezone Definitions for Python Summary: World Timezone Definitions for Python
License: MIT License: MIT
URL: http://pytz.sourceforge.net/ URL: http://pytz.sourceforge.net/
Source0: https://files.pythonhosted.org/packages/e3/8e/1cde9d002f48a940b9d9d38820aaf444b229450c0854bdf15305ce4a3d1a/pytz-2021.3.tar.gz Source0: https://files.pythonhosted.org/packages/f4/f6/94fee50f4d54f58637d4b9987a1b862aeb6cd969e73623e02c5c00755577/pytz-2020.1.tar.gz
Patch0: backport-pytz-zoneinfo.patch Patch0: pytz-zoneinfo.patch
Patch1: backport-remove_tzinfo_test.patch Patch1: remove_tzinfo_test.patch
Patch2: 0001-modify-timezone-from-Macau-to-Macao.patch Patch9000: 0001-modify-timezone-from-Macau-to-Macao.patch
BuildArch: noarch BuildArch: noarch
@ -21,9 +19,20 @@ or higher. It also solves the issue of ambiguous times at the end
of daylight saving time, which you can read more about in the of daylight saving time, which you can read more about in the
Python Library Reference (datetime.tzinfo). Python Library Reference (datetime.tzinfo).
%package -n python2-pytz
Summary: python2 for pytz
BuildRequires: python2-devel python2-pytest
Requires: tzdata
Provides: pytz = %{version}-%{release}
Obsoletes: pytz < %{version}-%{release}
%{?python_provide:%python_provide python2-%{name}}
%description -n python2-pytz
python2 for pytz
%package -n python3-pytz %package -n python3-pytz
Summary: python3 for pytz Summary: python3 for pytz
BuildRequires: python3-devel tzdata python3-pytest BuildRequires: python3-devel python3-pytest
Requires: tzdata Requires: tzdata
%{?python_provide:%python_provide python3-%{name}} %{?python_provide:%python_provide python3-%{name}}
@ -34,17 +43,30 @@ python3 for pytz
%autosetup -n %{name}-%{version} -p1 %autosetup -n %{name}-%{version} -p1
%build %build
%py2_build
%py3_build %py3_build
%install %install
%py2_install
rm -r %{buildroot}%{python2_sitelib}/pytz/zoneinfo
pathfix.py -pn -i %{__python2} %{buildroot}%{python2_sitelib}
sed -i '/pytz\/zoneinfo\/Asia\/Macau/d' %{buildroot}%{python2_sitelib}/*.egg-info/SOURCES.txt
%py3_install %py3_install
rm -r %{buildroot}%{python3_sitelib}/pytz/zoneinfo rm -r %{buildroot}%{python3_sitelib}/pytz/zoneinfo
pathfix.py -pn -i %{__python3} %{buildroot}%{python3_sitelib} pathfix.py -pn -i %{__python3} %{buildroot}%{python3_sitelib}
sed -i '/pytz\/zoneinfo\/Asia\/Macau/d' %{buildroot}%{python3_sitelib}/*.egg-info/SOURCES.txt sed -i '/pytz\/zoneinfo\/Asia\/Macau/d' %{buildroot}%{python3_sitelib}/*.egg-info/SOURCES.txt
%check %check
PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} -m pytest -v
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
%files -n python2-pytz
%defattr(-,root,root)
%doc README.rst
%license LICENSE.txt
%{python2_sitelib}/*
%files -n python3-pytz %files -n python3-pytz
%defattr(-,root,root) %defattr(-,root,root)
%doc README.rst %doc README.rst
@ -52,30 +74,6 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
%{python3_sitelib}/* %{python3_sitelib}/*
%changelog %changelog
* Tue Jun 21 2022 yanglu <yanglu72@h-partners.com> - 2021.3-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:remove useless patch
* Wed Dec 08 2021 yanglu <yanglu72@openeuler.org> - 2021.3-1
- Update version to 2021.3
* Mon Aug 09 2021 OpenStack_SIG <openstack@openeuler.org> - 2021.1-1
- Update version to 2021.1
* Fri Jan 29 2021 xihaochen <xihaochen@huawei.com> - 2020.5-1
- Type:requirements
- Id:NA
- SUG:NA
- DESC:update pytz to 2020.5
* Thu Oct 29 2020 gaihuiying <gaihuiying1@huawei.com> - 2020.1-2
- Type:requirement
- ID:NA
- SUG:NA
- DESC:remove python2
* Mon Jul 27 2020 lunankun <lunankun@huawei.com> - 2020.1-1 * Mon Jul 27 2020 lunankun <lunankun@huawei.com> - 2020.1-1
- Type:update - Type:update
- ID:NA - ID:NA