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