]> git.pld-linux.org Git - packages/python-pytest.git/blame - python-pytest.spec
- release 3 (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
ac0b7cbd 16Release: 3
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
84b7690d 102Requires: python-setuptools
9179728f
JB
103Obsoletes: python-pytest-cache < 1.1
104Obsoletes: python-pytest-catchlog < 1.2.3
bd571570
JB
105BuildArch: noarch
106BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
107
108%description
109py.test is a simple and popular testing tool for Python.
110
111%description -l pl.UTF-8
112py.test to proste i popularne narzędzie testujące dla Pythona.
113
e4983238
ER
114%package -n python3-pytest
115Summary: Simple powerful testing with Python
6b847094 116Summary(pl.UTF-8): Proste, ale funkcjonalne narzędzie testujące dla Pythona
e4983238 117Group: Development/Languages
95f20b73 118Requires: python3-devel-tools >= 1:3.4
84b7690d 119Requires: python3-setuptools
9179728f
JB
120Obsoletes: python3-pytest-cache < 1.1
121Obsoletes: python3-pytest-catchlog < 1.2.3
e4983238
ER
122
123%description -n python3-pytest
124py.test provides simple, yet powerful testing for Python.
125
6b847094
JB
126%description -n python3-pytest -l pl.UTF-8
127py.test to proste, ale bardzo funkcjonalne narzędzie testujące dla
128Pythona.
129
c4594506
JB
130%package apidocs
131Summary: Documentation for py.test Pythona package
132Summary(pl.UTF-8): Dokumentacja pakietu Pythona py.test
133Group: Documentation
134
135%description apidocs
136Documentation for py.test Pythona package.
137
138%description apidocs -l pl.UTF-8
139Dokumentacja pakietu Pythona py.test.
140
bd571570 141%prep
e4983238 142%setup -q -n %{module}-%{version}
65ffd36d 143%patch0 -p1
e4983238 144
bd571570 145%build
7359165f 146export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
08c08cc1 147%if %{with python2}
ac22139b 148%py_build
65ffd36d
JB
149
150%if %{with tests}
9c502aa4 151# test_pdb_custom_cls_with_settrace fails without preinstalled pytest
e920318a
JB
152# test_cache_writefail_permissions, test_cache_failure_warns makes tests unreliable due to post-test cleanup failures
153# test_pytester.py, test_terminal.py, test_unittest.py need ptys to spawn processes with terminal
65ffd36d 154PYTHONPATH=$(pwd)/src \
e920318a 155%{__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 156%endif
08c08cc1 157%endif
bd571570 158
e4983238 159%if %{with python3}
ac22139b 160%py3_build
65ffd36d
JB
161
162%if %{with tests}
9c502aa4
JB
163# test_pdb_custom_cls_with_settrace fails without preinstalled pytest
164# test_pdb_* which spawn pdb hang under some unclear conditions
e920318a
JB
165# test_cache_writefail_permissions, test_cache_failure_warns makes tests unreliable due to post-test cleanup failures
166# test_pytester.py, test_terminal.py, test_unittest.py need ptys to spawn processes with terminal
65ffd36d 167PYTHONPATH=$(pwd)/src \
e920318a 168%{__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 169%endif
e4983238
ER
170%endif
171
bd571570 172%if %{with doc}
e4983238 173for l in doc/*; do
65ffd36d
JB
174 PYTHONPATH=$(pwd)/src \
175 %{__make} -C $l html \
176 SPHINXBUILD=sphinx-build-3
e4983238 177done
bd571570
JB
178%endif
179
180%install
181rm -rf $RPM_BUILD_ROOT
ac22139b 182
08c08cc1 183%if %{with python2}
ac22139b 184%py_install
bd571570 185
23d34d20
JB
186%{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-2}
187%{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-2}
84b7690d 188
08c08cc1
JB
189# pytest.py source seems required for "monkeypatching" tests
190%py_postclean -x pytest.py
191%endif
bd571570 192
23d34d20
JB
193%if %{with python3}
194%py3_install
195
196%{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test{,-3}
197%{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest{,-3}
198%endif
199
bd571570
JB
200%clean
201rm -rf $RPM_BUILD_ROOT
202
08c08cc1 203%if %{with python2}
bd571570
JB
204%files
205%defattr(644,root,root,755)
c4594506 206%doc AUTHORS CHANGELOG.rst LICENSE README.rst
84b7690d 207%attr(755,root,root) %{_bindir}/py.test-2
84b7690d 208%attr(755,root,root) %{_bindir}/pytest-2
08c08cc1 209%{py_sitescriptdir}/pytest.py*
bd571570
JB
210%{py_sitescriptdir}/_pytest
211%{py_sitescriptdir}/pytest-%{version}-py*.egg-info
08c08cc1 212%endif
e4983238
ER
213
214%if %{with python3}
215%files -n python3-pytest
216%defattr(644,root,root,755)
c4594506 217%doc AUTHORS CHANGELOG.rst LICENSE README.rst
84b7690d
JB
218%attr(755,root,root) %{_bindir}/py.test-3
219%attr(755,root,root) %{_bindir}/pytest-3
6b847094 220%{py3_sitescriptdir}/pytest.py
e4983238 221%{py3_sitescriptdir}/_pytest
6b847094 222%{py3_sitescriptdir}/__pycache__/pytest.*.py[co]
e4983238
ER
223%{py3_sitescriptdir}/pytest-%{version}-py*.egg-info
224%endif
c4594506
JB
225
226%if %{with doc}
227%files apidocs
228%defattr(644,root,root,755)
65ffd36d 229%doc doc/en/_build/html/{_images,_modules,_static,announce,example,proposals,*.html,*.js}
c4594506 230%endif
This page took 0.146593 seconds and 4 git commands to generate.