]>
Commit | Line | Data |
---|---|---|
3bd4f362 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
15ddfab5 | 5 | %bcond_without tests # unit tests |
3bd4f362 | 6 | |
4c88eeb4 | 7 | %define module dateutil |
3a7a3074 | 8 | %define tzdata_ver 2018e |
3bd4f362 | 9 | Summary: Extensions to the standard Python datetime module |
4edbeb34 | 10 | Summary(pl.UTF-8): Rozszerzenia modułu datetime języka Python |
925dc3fc | 11 | Name: python-dateutil |
cf0b94f0 | 12 | Version: 2.8.1 |
572fcda1 | 13 | Release: 2 |
3a7a3074 | 14 | License: Apache v2.0 or BSD |
925dc3fc | 15 | Group: Libraries/Python |
3a7a3074 | 16 | # Source0Download: https://pypi.org/simple/python-dateutil/ |
cf0b94f0 JB |
17 | Source0: https://files.pythonhosted.org/packages/source/p/python-dateutil/%{name}-%{version}.tar.gz |
18 | # Source0-md5: f2a1d4b680b297b367a974664ca3a4f6 | |
56230308 | 19 | URL: https://dateutil.readthedocs.org/ |
cf0b94f0 JB |
20 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) |
21 | BuildRequires: glibc-localedb-all | |
22 | %endif | |
3bd4f362 | 23 | %if %{with python2} |
3a7a3074 | 24 | BuildRequires: python-modules >= 1:2.7 |
cf0b94f0 | 25 | BuildRequires: python-setuptools >= 24.3 |
3a7a3074 | 26 | BuildRequires: python-setuptools_scm |
15ddfab5 | 27 | %if %{with tests} |
3a7a3074 JB |
28 | BuildRequires: python-freezegun |
29 | BuildRequires: python-hypothesis >= 3.30 | |
30 | BuildRequires: python-mock | |
31 | BuildRequires: python-pytest >= 3.0 | |
15ddfab5 JB |
32 | BuildRequires: python-six >= 1.5 |
33 | %if "%{py_ver}" < "2.7" | |
34 | BuildRequires: python-unittest2 | |
35 | %endif | |
36 | %endif | |
3bd4f362 JB |
37 | %endif |
38 | %if %{with python3} | |
3a7a3074 | 39 | BuildRequires: python3-modules >= 1:3.3 |
cf0b94f0 | 40 | BuildRequires: python3-setuptools >= 24.3 |
3a7a3074 | 41 | BuildRequires: python3-setuptools_scm |
15ddfab5 | 42 | %if %{with tests} |
3a7a3074 JB |
43 | BuildRequires: python3-freezegun |
44 | BuildRequires: python3-hypothesis >= 3.30 | |
45 | BuildRequires: python3-pytest >= 3.0 | |
15ddfab5 | 46 | BuildRequires: python3-six >= 1.5 |
3bd4f362 | 47 | %endif |
15ddfab5 JB |
48 | %endif |
49 | BuildRequires: rpm-pythonprov | |
50 | BuildRequires: rpmbuild(macros) >= 1.714 | |
b3539404 | 51 | Requires: tzdata >= %{tzdata_ver} |
fbb08368 | 52 | BuildArch: noarch |
925dc3fc MK |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
54 | ||
55 | %description | |
88fadcb5 JB |
56 | The dateutil module provides powerful extensions to the standard |
57 | datetime module, available in Python 2.3+. Allows: | |
58 | - computing of relative deltas (next month, next year, next monday, | |
59 | last week of month, etc), | |
60 | - computing of dates based on very flexible recurrence rules, using a | |
61 | superset of the [WWW] iCalendar specification, | |
925dc3fc MK |
62 | - parsing of RFC strings, |
63 | - peneric parsing of dates in almost any string format. | |
64 | ||
3bd4f362 JB |
65 | This package contains Python 2.x module. |
66 | ||
fc872035 JR |
67 | %description -l pl.UTF-8 |
68 | Moduł dateutil jest potężnym rozszerzeniem standardowego modułu | |
69 | datetime, dostępnego w Pythonie 2.3+. Pozwala na: | |
70 | - obliczanie relatywnych różnic (następny miesiąc, rok, poniedziałek, | |
71 | ostatni tydzień miesiąca itp.), | |
88fadcb5 | 72 | - obliczanie dat w oparciu o bardzo elastyczne rekurencyjne zasady, z |
fc872035 JR |
73 | użyciem nadzbioru specyfikacji [WWW] iCalendar, |
74 | - analizę łańcuchow znakowych RFC, | |
75 | - analizę dat w prawie każdym formacie. | |
925dc3fc | 76 | |
3bd4f362 JB |
77 | Ten pakiet zawiera moduł Pythona 2.x. |
78 | ||
56230308 JB |
79 | %package zoneinfo |
80 | Summary: Internal zoneinfo implementation for Python 2 dateutil module | |
81 | Summary(pl.UTF-8): Wewnętrzna implementacja zoneinfo dla modułu Pythona 2 dateutil | |
82 | Group: Libraries/Python | |
83 | Requires: %{name} = %{version}-%{release} | |
84 | ||
85 | %description zoneinfo | |
86 | Internal zoneinfo implementation for Python 2 dateutil module. | |
87 | ||
88 | Note: it contains own timezone database, which might not be up to date | |
89 | with system zoneinfo data. | |
90 | ||
91 | %description zoneinfo -l pl.UTF-8 | |
92 | Wewnętrzna implementacja zoneinfo dla modułu Pythona 2 dateutil. | |
93 | ||
94 | Uwaga: zawiera własną bazę danych stref czasowych, która nie musi być | |
95 | aktualna w stosunku do systemowych danych zoneinfo. | |
96 | ||
3bd4f362 JB |
97 | %package -n python3-dateutil |
98 | Summary: Extensions to the standard Python datetime module | |
99 | Summary(pl.UTF-8): Rozszerzenia modułu datetime języka Python | |
100 | Group: Libraries/Python | |
b3539404 | 101 | Requires: tzdata >= %{tzdata_ver} |
3bd4f362 JB |
102 | |
103 | %description -n python3-dateutil | |
104 | The dateutil module provides powerful extensions to the standard | |
105 | datetime module, available in Python 2.3+. Allows: | |
106 | - computing of relative deltas (next month, next year, next monday, | |
107 | last week of month, etc), | |
108 | - computing of dates based on very flexible recurrence rules, using a | |
109 | superset of the [WWW] iCalendar specification, | |
110 | - parsing of RFC strings, | |
111 | - peneric parsing of dates in almost any string format. | |
112 | ||
113 | This package contains Python 3.x module. | |
114 | ||
115 | %description -n python3-dateutil -l pl.UTF-8 | |
116 | Moduł dateutil jest potężnym rozszerzeniem standardowego modułu | |
117 | datetime, dostępnego w Pythonie 2.3+. Pozwala na: | |
118 | - obliczanie relatywnych różnic (następny miesiąc, rok, poniedziałek, | |
119 | ostatni tydzień miesiąca itp.), | |
120 | - obliczanie dat w oparciu o bardzo elastyczne rekurencyjne zasady, z | |
121 | użyciem nadzbioru specyfikacji [WWW] iCalendar, | |
122 | - analizę łańcuchow znakowych RFC, | |
123 | - analizę dat w prawie każdym formacie. | |
124 | ||
125 | Ten pakiet zawiera moduł Pythona 3.x. | |
126 | ||
56230308 | 127 | %package -n python3-dateutil-zoneinfo |
52e044dc JB |
128 | Summary: Internal zoneinfo implementation for Python 3 dateutil module |
129 | Summary(pl.UTF-8): Wewnętrzna implementacja zoneinfo dla modułu Pythona 3 dateutil | |
56230308 JB |
130 | Group: Libraries/Python |
131 | Requires: python3-dateutil = %{version}-%{release} | |
132 | ||
133 | %description -n python3-dateutil-zoneinfo | |
52e044dc | 134 | Internal zoneinfo implementation for Python 3 dateutil module. |
56230308 JB |
135 | |
136 | Note: it contains own timezone database, which might not be up to date | |
137 | with system zoneinfo data. | |
138 | ||
139 | %description -n python3-dateutil-zoneinfo -l pl.UTF-8 | |
52e044dc | 140 | Wewnętrzna implementacja zoneinfo dla modułu Pythona 3 dateutil. |
56230308 JB |
141 | |
142 | Uwaga: zawiera własną bazę danych stref czasowych, która nie musi być | |
143 | aktualna w stosunku do systemowych danych zoneinfo. | |
144 | ||
925dc3fc MK |
145 | %prep |
146 | %setup -q | |
147 | ||
148 | %build | |
3bd4f362 | 149 | %if %{with python2} |
3a7a3074 JB |
150 | %py_build |
151 | ||
152 | %if %{with tests} | |
d734fdcb | 153 | # python 2 pytest on builders seem to fail when passing exception containing non-ascii characters |
61fb8016 | 154 | LC_ALL=C.UTF-8 PYTHONIOENCODING=utf8 \ |
3a7a3074 | 155 | PYTHONPATH=$(pwd) \ |
d734fdcb | 156 | %{__python} -m pytest --deselect=dateutil/test/test_isoparser.py::test_iso_raises dateutil/test |
3a7a3074 | 157 | %endif |
3bd4f362 JB |
158 | %endif |
159 | ||
160 | %if %{with python3} | |
3a7a3074 JB |
161 | %py3_build |
162 | ||
163 | %if %{with tests} | |
164 | PYTHONPATH=$(pwd) \ | |
165 | %{__python3} -m pytest dateutil/test | |
166 | %endif | |
3bd4f362 | 167 | %endif |
925dc3fc MK |
168 | |
169 | %install | |
170 | rm -rf $RPM_BUILD_ROOT | |
3bd4f362 JB |
171 | |
172 | %if %{with python2} | |
4dcd62fb | 173 | %py_install |
925dc3fc | 174 | |
fbb08368 | 175 | %py_postclean |
3bd4f362 JB |
176 | %endif |
177 | ||
178 | %if %{with python3} | |
4dcd62fb | 179 | %py3_install |
3bd4f362 | 180 | %endif |
4c88eeb4 | 181 | |
925dc3fc MK |
182 | %clean |
183 | rm -rf $RPM_BUILD_ROOT | |
184 | ||
3bd4f362 | 185 | %if %{with python2} |
925dc3fc MK |
186 | %files |
187 | %defattr(644,root,root,755) | |
56230308 JB |
188 | %doc LICENSE NEWS README.rst |
189 | %dir %{py_sitescriptdir}/dateutil | |
190 | %{py_sitescriptdir}/dateutil/*.py[co] | |
3a7a3074 | 191 | %{py_sitescriptdir}/dateutil/parser |
56230308 | 192 | %{py_sitescriptdir}/dateutil/tz |
3bd4f362 | 193 | %{py_sitescriptdir}/python_dateutil-%{version}-py*.egg-info |
56230308 JB |
194 | |
195 | %files zoneinfo | |
196 | %defattr(644,root,root,755) | |
197 | %{py_sitescriptdir}/dateutil/zoneinfo | |
3bd4f362 JB |
198 | %endif |
199 | ||
200 | %if %{with python3} | |
201 | %files -n python3-dateutil | |
202 | %defattr(644,root,root,755) | |
56230308 JB |
203 | %doc LICENSE NEWS README.rst |
204 | %dir %{py3_sitescriptdir}/dateutil | |
205 | %{py3_sitescriptdir}/dateutil/*.py | |
206 | %{py3_sitescriptdir}/dateutil/__pycache__ | |
3a7a3074 | 207 | %{py3_sitescriptdir}/dateutil/parser |
56230308 | 208 | %{py3_sitescriptdir}/dateutil/tz |
3bd4f362 | 209 | %{py3_sitescriptdir}/python_dateutil-%{version}-py*.egg-info |
56230308 JB |
210 | |
211 | %files -n python3-dateutil-zoneinfo | |
212 | %defattr(644,root,root,755) | |
213 | %{py3_sitescriptdir}/dateutil/zoneinfo | |
3bd4f362 | 214 | %endif |