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