Package init
This commit is contained in:
commit
d597cfb180
BIN
pytz-2019.2.tar.gz
Normal file
BIN
pytz-2019.2.tar.gz
Normal file
Binary file not shown.
1114
pytz-zoneinfo.patch
Normal file
1114
pytz-zoneinfo.patch
Normal file
File diff suppressed because it is too large
Load Diff
75
pytz.spec
Normal file
75
pytz.spec
Normal file
@ -0,0 +1,75 @@
|
||||
Name: pytz
|
||||
Version: 2019.2
|
||||
Release: 1
|
||||
Summary: World Timezone Definitions for Python
|
||||
License: MIT
|
||||
URL: http://pytz.sourceforge.net/
|
||||
Source0: https://github.com/stub42/pytz/archive/pytz-2019.2.tar.gz
|
||||
|
||||
Patch0: pytz-zoneinfo.patch
|
||||
Patch1: remove_tzinfo_test.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
pytz brings the Olson tz database into Python. This library allows
|
||||
accurate and cross platform timezone calculations using Python 2.4
|
||||
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
|
||||
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
|
||||
Summary: python3 for pytz
|
||||
BuildRequires: python3-devel python3-pytest
|
||||
Requires: tzdata
|
||||
%{?python_provide:%python_provide python3-%{name}}
|
||||
|
||||
%description -n python3-pytz
|
||||
python3 for pytz
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
|
||||
%build
|
||||
%py2_build
|
||||
%py3_build
|
||||
|
||||
%install
|
||||
%py2_install
|
||||
rm -r %{buildroot}%{python2_sitelib}/pytz/zoneinfo
|
||||
pathfix.py -pn -i %{__python2} %{buildroot}%{python2_sitelib}
|
||||
|
||||
%py3_install
|
||||
rm -r %{buildroot}%{python3_sitelib}/pytz/zoneinfo
|
||||
pathfix.py -pn -i %{__python3} %{buildroot}%{python3_sitelib}
|
||||
|
||||
%check
|
||||
PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} -m pytest -v
|
||||
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
|
||||
|
||||
%files -n python2-pytz
|
||||
%defattr(-,root,root)
|
||||
%doc README.txt
|
||||
%license LICENSE.txt
|
||||
%{python2_sitelib}/*
|
||||
|
||||
%files -n python3-pytz
|
||||
%defattr(-,root,root)
|
||||
%doc README.txt
|
||||
%license LICENSE.txt
|
||||
%{python3_sitelib}/*
|
||||
|
||||
%changelog
|
||||
* Thu Sep 12 2019 openEuler Buildteam <buildteam@openeuler.org> - 2019.2-1
|
||||
- Package init
|
||||
12
remove_tzinfo_test.patch
Normal file
12
remove_tzinfo_test.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/pytz/tests/test_tzinfo.py b/pytz/tests/test_tzinfo.py
|
||||
index b2640a8..4f5322b 100644
|
||||
--- a/pytz/tests/test_tzinfo.py
|
||||
+++ b/pytz/tests/test_tzinfo.py
|
||||
@@ -155,6 +155,7 @@ class PicklingTest(unittest.TestCase):
|
||||
self._roundtrip_tzinfo(localized_tz)
|
||||
self._roundtrip_datetime(dt.replace(tzinfo=localized_tz))
|
||||
|
||||
+ @unittest.skip('Fails with system-wide timezone database')
|
||||
def testRoundtrip(self):
|
||||
for zone in pytz.all_timezones:
|
||||
tz = pytz.timezone(zone)
|
||||
Loading…
x
Reference in New Issue
Block a user