]> git.pld-linux.org Git - packages/python-pytest.git/blob - python-pytest.spec
- up to 4.6.9 (latest for python 2); some tests fail, saving work
[packages/python-pytest.git] / python-pytest.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # HTML documentation build
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6 %bcond_without  tests   # unit tests
7
8 %define         pylib_version   1.5.0
9 %define         module  pytest
10 Summary:        Simple and popular testing tool for Python
11 Summary(pl.UTF-8):      Proste i popularne narzędzie testujące dla Pythona
12 Name:           python-%{module}
13 Version:        4.6.9
14 Release:        1
15 License:        MIT
16 Group:          Development/Languages/Python
17 #Source0Download: https://pypi.org/simple/pytest/
18 Source0:        https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
19 # Source0-md5:  d0457c5ddd0438e3b68b7939339d915f
20 Patch0:         %{name}-tests.patch
21 URL:            http://pytest.org/
22 %if %{with python2}
23 BuildRequires:  python-devel >= 1:2.7
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-py >= %{pylib_version}
26 BuildRequires:  python-setuptools >= 1:40.0
27 BuildRequires:  python-setuptools_scm
28 %if %{with tests}
29 BuildRequires:  pydoc >= 1:2.7
30 BuildRequires:  python-argcomplete
31 BuildRequires:  python-atomicwrites >= 1.0
32 BuildRequires:  python-attrs >= 17.4.0
33 BuildRequires:  python-funcsigs >= 1.0
34 BuildRequires:  python-hypothesis >= 3.56
35 BuildRequires:  python-importlib_metadata >= 0.12
36 BuildRequires:  python-mock
37 BuildRequires:  python-more_itertools >= 4.0.0
38 BuildRequires:  python-nose
39 BuildRequires:  python-pathlib2 >= 2.2.0
40 BuildRequires:  python-pluggy >= 0.12
41 BuildRequires:  python-requests
42 BuildRequires:  python-six >= 1.10.0
43 BuildRequires:  python-wcwidth
44 BuildConflicts: python-backports.unittest_mock
45 BuildConflicts: python-pyfakefs
46 BuildConflicts: python-pytest-benchmark < 3.2.1
47 BuildConflicts: python-pytest-catchlog
48 # with xdist requires various modules source
49 BuildConflicts: python-pytest-xdist
50 %endif
51 %endif
52 %if %{with python3}
53 BuildRequires:  python3-devel >= 1:3.4
54 BuildRequires:  python3-modules >= 1:3.4
55 BuildRequires:  python3-py >= %{pylib_version}
56 BuildRequires:  python3-setuptools >= 1:40.0
57 BuildRequires:  python3-setuptools_scm
58 %if %{with tests}
59 BuildRequires:  pydoc3 >= 1:3.4
60 BuildRequires:  python3-argcomplete
61 BuildRequires:  python3-atomicwrites >= 1.0
62 BuildRequires:  python3-attrs >= 17.4.0
63 BuildRequires:  python3-hypothesis >= 3.56
64 %if "%{py3_ver}" < "3.8"
65 BuildRequires:  python3-importlib_metadata >= 0.12
66 %endif
67 BuildRequires:  python3-more_itertools >= 4.0.0
68 BuildRequires:  python3-nose
69 %if "%{py3_ver}" < "3.6"
70 BuildRequires:  python3-pathlib2 >= 2.2.0
71 %endif
72 BuildRequires:  python3-pluggy >= 0.12
73 BuildRequires:  python3-requests
74 BuildRequires:  python3-six >= 1.10.0
75 BuildRequires:  python3-wcwidth
76 BuildConflicts: python3-pyfakefs
77 BuildConflicts: python3-pytest-benchmark < 3.2.1
78 BuildConflicts: python3-pytest-catchlog
79 BuildConflicts: python3-pytest-xdist
80 %endif
81 %endif
82 BuildRequires:  rpm-pythonprov
83 BuildRequires:  rpmbuild(macros) >= 1.714
84 BuildRequires:  sed >= 4.0
85 %if %{with doc}
86 BuildRequires:  python3-sphinxcontrib-trio
87 BuildRequires:  sphinx-pdg-3 >= 1.0
88 %endif
89 Requires:       python-modules >= 1:2.7
90 Requires:       python-setuptools
91 Obsoletes:      python-pytest-cache
92 Obsoletes:      python-pytest-catchlog
93 BuildArch:      noarch
94 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
95
96 %description
97 py.test is a simple and popular testing tool for Python.
98
99 %description -l pl.UTF-8
100 py.test to proste i popularne narzędzie testujące dla Pythona.
101
102 %package -n python3-pytest
103 Summary:        Simple powerful testing with Python
104 Summary(pl.UTF-8):      Proste, ale funkcjonalne narzędzie testujące dla Pythona
105 Group:          Development/Languages
106 Requires:       python3-devel-tools >= 1:3.4
107 Requires:       python3-setuptools
108 Obsoletes:      python3-pytest-cache
109 Obsoletes:      python3-pytest-catchlog
110
111 %description -n python3-pytest
112 py.test provides simple, yet powerful testing for Python.
113
114 %description -n python3-pytest -l pl.UTF-8
115 py.test to proste, ale bardzo funkcjonalne narzędzie testujące dla
116 Pythona.
117
118 %package apidocs
119 Summary:        Documentation for py.test Pythona package
120 Summary(pl.UTF-8):      Dokumentacja pakietu Pythona py.test
121 Group:          Documentation
122
123 %description apidocs
124 Documentation for py.test Pythona package.
125
126 %description apidocs -l pl.UTF-8
127 Dokumentacja pakietu Pythona py.test.
128
129 %prep
130 %setup -q -n %{module}-%{version}
131 %patch0 -p1
132
133 %build
134 %if %{with python2}
135 %py_build
136
137 %if %{with tests}
138 # FIXME: 25 failed;
139 # - some because of warnings
140 # - ValueError: no option named u'--tb' (why? it's provided by _pytest/terminal.py)
141 # test_pdb_custom_cls_with_settrace fails without preinstalled pytest
142 PYTHONPATH=$(pwd)/src \
143 %{__python} -m pytest -k 'not test_pdb and not TestTerminal and not test_request_garbage' testing
144 %endif
145 %endif
146
147 %if %{with python3}
148 %py3_build
149
150 %if %{with tests}
151 # test_pdb_custom_cls_with_settrace fails without preinstalled pytest
152 # test_pdb_* which spawn pdb hang under some unclear conditions
153 # test_request_garbage fails sometimes
154 PYTHONPATH=$(pwd)/src \
155 %{__python3} -m pytest -k 'not test_pdb and not TestTerminal and not test_request_garbage' testing
156 %endif
157 %endif
158
159 %if %{with doc}
160 for l in doc/*; do
161         PYTHONPATH=$(pwd)/src \
162         %{__make} -C $l html \
163                 SPHINXBUILD=sphinx-build-3
164 done
165 %endif
166
167 %install
168 rm -rf $RPM_BUILD_ROOT
169
170 %if %{with python3}
171 %py3_install
172
173 %{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3}
174 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3}
175 %endif
176
177 %if %{with python2}
178 %py_install
179
180 ln $RPM_BUILD_ROOT%{_bindir}/py.test{,-2}
181 ln $RPM_BUILD_ROOT%{_bindir}/pytest{,-2}
182
183 # pytest.py source seems required for "monkeypatching" tests
184 %py_postclean -x pytest.py
185 %endif
186
187 %clean
188 rm -rf $RPM_BUILD_ROOT
189
190 %if %{with python2}
191 %files
192 %defattr(644,root,root,755)
193 %doc AUTHORS CHANGELOG.rst LICENSE README.rst
194 %attr(755,root,root) %{_bindir}/py.test
195 %attr(755,root,root) %{_bindir}/py.test-2
196 %attr(755,root,root) %{_bindir}/pytest
197 %attr(755,root,root) %{_bindir}/pytest-2
198 %{py_sitescriptdir}/pytest.py*
199 %{py_sitescriptdir}/_pytest
200 %{py_sitescriptdir}/pytest-%{version}-py*.egg-info
201 %endif
202
203 %if %{with python3}
204 %files -n python3-pytest
205 %defattr(644,root,root,755)
206 %doc AUTHORS CHANGELOG.rst LICENSE README.rst
207 %attr(755,root,root) %{_bindir}/py.test-3
208 %attr(755,root,root) %{_bindir}/pytest-3
209 %{py3_sitescriptdir}/pytest.py
210 %{py3_sitescriptdir}/_pytest
211 %{py3_sitescriptdir}/__pycache__/pytest.*.py[co]
212 %{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
213 %endif
214
215 %if %{with doc}
216 %files apidocs
217 %defattr(644,root,root,755)
218 %doc doc/en/_build/html/{_images,_modules,_static,announce,example,proposals,*.html,*.js}
219 %endif
This page took 0.078744 seconds and 3 git commands to generate.