]> git.pld-linux.org Git - packages/python-pytest.git/blob - python-pytest.spec
a86eb42fdca9f26aa84aaedbe02bab5fe70381ac
[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.11
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:  26cf20887076ad8a7beccfb5e9c44d04
20 Patch0:         %{name}-tests.patch
21 URL:            https://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-more_itertools < 6.0.0
39 BuildRequires:  python-nose
40 BuildRequires:  python-packaging
41 BuildRequires:  python-pathlib2 >= 2.2.0
42 BuildRequires:  python-pluggy >= 0.12
43 BuildRequires:  python-pluggy < 1.0
44 BuildRequires:  python-requests
45 BuildRequires:  python-six >= 1.10.0
46 BuildRequires:  python-wcwidth
47 BuildConflicts: python-pytest-benchmark < 3.2.1
48 # outdated
49 BuildConflicts: python-pytest-catchlog
50 # with xdist requires various modules source and breaks other things
51 BuildConflicts: python-pytest-xdist
52 %endif
53 %endif
54 %if %{with python3}
55 BuildRequires:  python3-devel >= 1:3.4
56 BuildRequires:  python3-modules >= 1:3.4
57 BuildRequires:  python3-py >= %{pylib_version}
58 BuildRequires:  python3-setuptools >= 1:40.0
59 BuildRequires:  python3-setuptools_scm
60 %if %{with tests}
61 BuildRequires:  pydoc3 >= 1:3.4
62 BuildRequires:  python3-argcomplete
63 BuildRequires:  python3-atomicwrites >= 1.0
64 BuildRequires:  python3-attrs >= 17.4.0
65 BuildRequires:  python3-hypothesis >= 3.56
66 %if "%{py3_ver}" < "3.8"
67 BuildRequires:  python3-importlib_metadata >= 0.12
68 %endif
69 BuildRequires:  python3-more_itertools >= 4.0.0
70 BuildRequires:  python3-nose
71 BuildRequires:  python3-packaging
72 %if "%{py3_ver}" < "3.6"
73 BuildRequires:  python3-pathlib2 >= 2.2.0
74 %endif
75 BuildRequires:  python3-pluggy >= 0.12
76 BuildRequires:  python3-pluggy < 1.0
77 BuildRequires:  python3-requests
78 BuildRequires:  python3-six >= 1.10.0
79 BuildRequires:  python3-wcwidth
80 BuildConflicts: python3-pytest-benchmark < 3.2.1
81 # outdated
82 BuildConflicts: python3-pytest-catchlog
83 # seems to break things
84 BuildConflicts: python3-pytest-xdist
85 %endif
86 %endif
87 BuildRequires:  rpm-pythonprov
88 BuildRequires:  rpmbuild(macros) >= 1.714
89 BuildRequires:  sed >= 4.0
90 %if %{with doc}
91 BuildRequires:  python3-pygments_pytest
92 BuildRequires:  python3-sphinx_removed_in >= 0.2.0
93 BuildRequires:  python3-sphinxcontrib-trio
94 BuildRequires:  sphinx-pdg-3 >= 1.8.2
95 %endif
96 Requires:       python-modules >= 1:2.7
97 Requires:       python-setuptools
98 Obsoletes:      python-pytest-cache < 1.1
99 Obsoletes:      python-pytest-catchlog < 1.2.3
100 BuildArch:      noarch
101 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
102
103 %description
104 py.test is a simple and popular testing tool for Python.
105
106 %description -l pl.UTF-8
107 py.test to proste i popularne narzędzie testujące dla Pythona.
108
109 %package -n python3-pytest
110 Summary:        Simple powerful testing with Python
111 Summary(pl.UTF-8):      Proste, ale funkcjonalne narzędzie testujące dla Pythona
112 Group:          Development/Languages
113 Requires:       python3-devel-tools >= 1:3.4
114 Requires:       python3-setuptools
115 Obsoletes:      python3-pytest-cache < 1.1
116 Obsoletes:      python3-pytest-catchlog < 1.2.3
117
118 %description -n python3-pytest
119 py.test provides simple, yet powerful testing for Python.
120
121 %description -n python3-pytest -l pl.UTF-8
122 py.test to proste, ale bardzo funkcjonalne narzędzie testujące dla
123 Pythona.
124
125 %package apidocs
126 Summary:        Documentation for py.test Pythona package
127 Summary(pl.UTF-8):      Dokumentacja pakietu Pythona py.test
128 Group:          Documentation
129
130 %description apidocs
131 Documentation for py.test Pythona package.
132
133 %description apidocs -l pl.UTF-8
134 Dokumentacja pakietu Pythona py.test.
135
136 %prep
137 %setup -q -n %{module}-%{version}
138 %patch0 -p1
139
140 %build
141 export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
142 %if %{with python2}
143 %py_build
144
145 %if %{with tests}
146 # test_pdb_custom_cls_with_settrace fails without preinstalled pytest
147 PYTHONPATH=$(pwd)/src \
148 %{__python} -m pytest -k 'not test_pdb and not test_cache_writefail_permissions and not test_cache_failure_warns' testing
149 %endif
150 %endif
151
152 %if %{with python3}
153 %py3_build
154
155 %if %{with tests}
156 # test_pdb_custom_cls_with_settrace fails without preinstalled pytest
157 # test_pdb_* which spawn pdb hang under some unclear conditions
158 PYTHONPATH=$(pwd)/src \
159 %{__python3} -m pytest -k 'not test_pdb and not test_cache_writefail_permissions and not test_cache_failure_warns' testing
160 %endif
161 %endif
162
163 %if %{with doc}
164 for l in doc/*; do
165         PYTHONPATH=$(pwd)/src \
166         %{__make} -C $l html \
167                 SPHINXBUILD=sphinx-build-3
168 done
169 %endif
170
171 %install
172 rm -rf $RPM_BUILD_ROOT
173
174 %if %{with python3}
175 %py3_install
176
177 %{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3}
178 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3}
179 %endif
180
181 %if %{with python2}
182 %py_install
183
184 ln $RPM_BUILD_ROOT%{_bindir}/py.test{,-2}
185 ln $RPM_BUILD_ROOT%{_bindir}/pytest{,-2}
186
187 # pytest.py source seems required for "monkeypatching" tests
188 %py_postclean -x pytest.py
189 %endif
190
191 %clean
192 rm -rf $RPM_BUILD_ROOT
193
194 %if %{with python2}
195 %files
196 %defattr(644,root,root,755)
197 %doc AUTHORS CHANGELOG.rst LICENSE README.rst
198 %attr(755,root,root) %{_bindir}/py.test
199 %attr(755,root,root) %{_bindir}/py.test-2
200 %attr(755,root,root) %{_bindir}/pytest
201 %attr(755,root,root) %{_bindir}/pytest-2
202 %{py_sitescriptdir}/pytest.py*
203 %{py_sitescriptdir}/_pytest
204 %{py_sitescriptdir}/pytest-%{version}-py*.egg-info
205 %endif
206
207 %if %{with python3}
208 %files -n python3-pytest
209 %defattr(644,root,root,755)
210 %doc AUTHORS CHANGELOG.rst LICENSE README.rst
211 %attr(755,root,root) %{_bindir}/py.test-3
212 %attr(755,root,root) %{_bindir}/pytest-3
213 %{py3_sitescriptdir}/pytest.py
214 %{py3_sitescriptdir}/_pytest
215 %{py3_sitescriptdir}/__pycache__/pytest.*.py[co]
216 %{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
217 %endif
218
219 %if %{with doc}
220 %files apidocs
221 %defattr(644,root,root,755)
222 %doc doc/en/_build/html/{_images,_modules,_static,announce,example,proposals,*.html,*.js}
223 %endif
This page took 0.19926 seconds and 2 git commands to generate.