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