]> git.pld-linux.org Git - packages/python-dateutil.git/blob - python-dateutil.spec
rebuild with python 3.10
[packages/python-dateutil.git] / python-dateutil.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  tests   # unit tests
6
7 %define         module dateutil
8 %define         tzdata_ver      2018e
9 Summary:        Extensions to the standard Python datetime module
10 Summary(pl.UTF-8):      Rozszerzenia modułu datetime języka Python
11 Name:           python-dateutil
12 Version:        2.8.2
13 Release:        3
14 License:        Apache v2.0 or BSD
15 Group:          Libraries/Python
16 # Source0Download: https://pypi.org/simple/python-dateutil/
17 Source0:        https://files.pythonhosted.org/packages/source/p/python-dateutil/%{name}-%{version}.tar.gz
18 # Source0-md5:  5970010bb72452344df3d76a10281b65
19 URL:            https://dateutil.readthedocs.org/
20 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
21 BuildRequires:  glibc-localedb-all
22 %endif
23 %if %{with python2}
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-setuptools >= 1:24.3
26 BuildRequires:  python-setuptools_scm
27 %if %{with tests}
28 BuildRequires:  python-attrs >= 21.2.0
29 BuildRequires:  python-freezegun
30 BuildRequires:  python-hypothesis >= 3.30
31 BuildRequires:  python-mock
32 BuildRequires:  python-pytest >= 3.0
33 BuildRequires:  python-pytest-cov >= 2.0.0
34 BuildRequires:  python-six >= 1.5
35 %if "%{py_ver}" < "2.7"
36 BuildRequires:  python-unittest2
37 %endif
38 %endif
39 %endif
40 %if %{with python3}
41 BuildRequires:  python3-modules >= 1:3.3
42 BuildRequires:  python3-setuptools >= 1:24.3
43 BuildRequires:  python3-setuptools_scm
44 %if %{with tests}
45 BuildRequires:  python3-attrs >= 21.2.0
46 BuildRequires:  python3-freezegun
47 BuildRequires:  python3-hypothesis >= 3.30
48 BuildRequires:  python3-pytest >= 3.0
49 BuildRequires:  python3-pytest-cov >= 2.0.0
50 BuildRequires:  python3-six >= 1.5
51 %endif
52 %endif
53 BuildRequires:  rpm-pythonprov
54 BuildRequires:  rpmbuild(macros) >= 1.714
55 Requires:       tzdata >= %{tzdata_ver}
56 BuildArch:      noarch
57 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
59 %description
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,
66 - parsing of RFC strings,
67 - peneric parsing of dates in almost any string format.
68
69 This package contains Python 2.x module.
70
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.),
76 - obliczanie dat w oparciu o bardzo elastyczne rekurencyjne zasady, z
77   użyciem nadzbioru specyfikacji [WWW] iCalendar,
78 - analizę łańcuchow znakowych RFC,
79 - analizę dat w prawie każdym formacie.
80
81 Ten pakiet zawiera moduł Pythona 2.x.
82
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
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
105 Requires:       tzdata >= %{tzdata_ver}
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
131 %package -n python3-dateutil-zoneinfo
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
134 Group:          Libraries/Python
135 Requires:       python3-dateutil = %{version}-%{release}
136
137 %description -n python3-dateutil-zoneinfo
138 Internal zoneinfo implementation for Python 3 dateutil module.
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
144 Wewnętrzna implementacja zoneinfo dla modułu Pythona 3 dateutil.
145
146 Uwaga: zawiera własną bazę danych stref czasowych, która nie musi być
147 aktualna w stosunku do systemowych danych zoneinfo.
148
149 %prep
150 %setup -q
151
152 %build
153 %if %{with python2}
154 %py_build
155
156 %if %{with tests}
157 # python 2 pytest on builders seem to fail when passing exception containing non-ascii characters
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 \
163 PYTHONPATH=$(pwd) \
164 TZ=UTC \
165 %{__python} -m pytest --deselect=dateutil/test/test_isoparser.py::test_iso_raises dateutil/test
166 %endif
167 %endif
168
169 %if %{with python3}
170 %py3_build
171
172 %if %{with tests}
173 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
174 PYTEST_PLUGINS=pytest_cov.plugin \
175 PYTHONPATH=$(pwd) \
176 TZ=UTC \
177 %{__python3} -m pytest dateutil/test
178 %endif
179 %endif
180
181 %install
182 rm -rf $RPM_BUILD_ROOT
183
184 %if %{with python2}
185 %py_install
186
187 %py_postclean
188 %endif
189
190 %if %{with python3}
191 %py3_install
192 %endif
193
194 %clean
195 rm -rf $RPM_BUILD_ROOT
196
197 %if %{with python2}
198 %files
199 %defattr(644,root,root,755)
200 %doc LICENSE NEWS README.rst
201 %dir %{py_sitescriptdir}/dateutil
202 %{py_sitescriptdir}/dateutil/*.py[co]
203 %{py_sitescriptdir}/dateutil/parser
204 %{py_sitescriptdir}/dateutil/tz
205 %{py_sitescriptdir}/python_dateutil-%{version}-py*.egg-info
206
207 %files zoneinfo
208 %defattr(644,root,root,755)
209 %{py_sitescriptdir}/dateutil/zoneinfo
210 %endif
211
212 %if %{with python3}
213 %files -n python3-dateutil
214 %defattr(644,root,root,755)
215 %doc LICENSE NEWS README.rst
216 %dir %{py3_sitescriptdir}/dateutil
217 %{py3_sitescriptdir}/dateutil/*.py
218 %{py3_sitescriptdir}/dateutil/__pycache__
219 %{py3_sitescriptdir}/dateutil/parser
220 %{py3_sitescriptdir}/dateutil/tz
221 %{py3_sitescriptdir}/python_dateutil-%{version}-py*.egg-info
222
223 %files -n python3-dateutil-zoneinfo
224 %defattr(644,root,root,755)
225 %{py3_sitescriptdir}/dateutil/zoneinfo
226 %endif
This page took 0.455845 seconds and 4 git commands to generate.