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