3 %bcond_without doc # Sphinx documentation
4 %bcond_with tests # py.test tests [sensitive to coverage and pytest output, few tests fail for me]
5 %bcond_with tests_py2 # Python 2 py.test tests [require some modules sources + the above]
6 %bcond_without python2 # CPython 2.x module
7 %bcond_without python3 # CPython 3.x module
9 Summary: pytest plugin for measuring coverage
10 Summary(pl.UTF-8): Wtyczka pytest do mierzenia pokrycia
11 Name: python-pytest-cov
12 # keep 2.x here for python2 support; >=2.11,<3 requires updating coverage to >=5.2.1
16 Group: Libraries/Python
17 #Source0Download: https://pypi.org/simple/pytest-cov/
18 Source0: https://files.pythonhosted.org/packages/source/p/pytest-cov/pytest-cov-%{version}.tar.gz
19 # Source0-md5: 13e17f0b4f263a04fb1fadde7ebe2fbb
20 URL: https://github.com/pytest-dev/pytest-cov
22 BuildRequires: python-modules >= 1:2.7
23 BuildRequires: python-setuptools
25 BuildRequires: python-coverage >= 4.5.4
26 BuildRequires: python-fields
27 BuildRequires: python-process_tests >= 2.0.2
28 BuildRequires: python-py
29 BuildRequires: python-pytest >= 3.10.1
30 BuildRequires: python-pytest-xdist >= 1.23.0
31 BuildRequires: python-six
32 BuildRequires: python-virtualenv
36 BuildRequires: python3-modules >= 1:3.4
37 BuildRequires: python3-setuptools
39 BuildRequires: python3-coverage >= 4.5.4
40 BuildRequires: python3-fields
41 BuildRequires: python3-process_tests >= 2.0.2
42 BuildRequires: python3-py
43 BuildRequires: python3-pytest >= 3.10.1
44 BuildRequires: python3-pytest-xdist >= 1.23.0
45 BuildRequires: python3-six
46 BuildRequires: python3-virtualenv
49 BuildRequires: rpm-pythonprov
50 BuildRequires: rpmbuild(macros) >= 1.714
52 BuildRequires: sphinx-pdg
53 BuildRequires: python3-sphinx_py3doc_enhanced_theme
55 Requires: python-modules >= 1:2.7
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 This plugin produces coverage reports. It supports centralised testing
61 and distributed testing in both load and each modes. It also supports
62 coverage of subprocesses.
64 %description -l pl.UTF-8
65 Ta wtyczka tworzy raporty pokrycia. Obsługuje testowanie
66 zcentraliwowane i rozproszone, zarówno w trybie "load", jak i "each".
67 Obsługuje także pokrycie podprocesów.
69 %package -n python3-pytest-cov
70 Summary: pytest plugin for measuring coverage
71 Summary(pl.UTF-8): Wtyczka pytest do mierzenia pokrycia
72 Group: Libraries/Python
73 Requires: python3-modules >= 1:3.4
75 %description -n python3-pytest-cov
76 This plugin produces coverage reports. It supports centralised testing
77 and distributed testing in both load and each modes. It also supports
78 coverage of subprocesses.
80 %description -n python3-pytest-cov -l pl.UTF-8
81 Ta wtyczka tworzy raporty pokrycia. Obsługuje testowanie
82 zcentraliwowane i rozproszone, zarówno w trybie "load", jak i "each".
83 Obsługuje także pokrycie podprocesów.
86 Summary: Documentation for pytest-cov module
87 Summary(pl.UTF-8): Dokumentacja do modułu pytest-cov
91 Documentation for pytest-cov module.
93 %description apidocs -l pl.UTF-8
94 Dokumentacja do modułu pytest-cov.
97 %setup -q -n pytest-cov-%{version}
103 %if %{with tests_py2}
104 PYTHONPATH=$(pwd)/src:$(pwd)/tests \
105 XPYTEST_PLUGINS=pytest_cov.plugin \
106 %{__python} -m pytest tests
114 PYTHONPATH=$(pwd)/src:$(pwd)/tests \
115 XPYTEST_PLUGINS=pytest_cov.plugin \
116 %{__python3} -m pytest tests
122 sphinx-build -b html . _build/html
126 rm -rf $RPM_BUILD_ROOT
139 rm -rf $RPM_BUILD_ROOT
143 %defattr(644,root,root,755)
144 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
145 %{py_sitescriptdir}/pytest-cov.pth
146 %{py_sitescriptdir}/pytest_cov
147 %{py_sitescriptdir}/pytest_cov-%{version}-py*.egg-info
151 %files -n python3-pytest-cov
152 %defattr(644,root,root,755)
153 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
154 %{py3_sitescriptdir}/pytest-cov.pth
155 %{py3_sitescriptdir}/pytest_cov
156 %{py3_sitescriptdir}/pytest_cov-%{version}-py*.egg-info
161 %defattr(644,root,root,755)
162 %doc docs/_build/html/{_static,*.html,*.js}