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