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