1 # TODO: finish doc and tests (where dependencies available in PLD)
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
6 %bcond_with doc # Sphinx documentation
7 %bcond_with tests # unit tests
9 %define module coverage
10 Summary: Tool for measuring code coverage of Python programs
11 Summary(pl.UTF-8): Narzędzie do szacowania pokrycia kodu programów w Pythonie
12 Name: python-%{module}
13 # keep 5.x here for python2 support
17 Group: Development/Languages/Python
18 #Source0Download: https://pypi.org/simple/coverage/
19 Source0: https://files.pythonhosted.org/packages/source/c/coverage/%{module}-%{version}.tar.gz
20 # Source0-md5: 22e8fc8c26c46e76fb3c7f99a5f6eb92
21 URL: http://coverage.readthedocs.org/
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.714
25 BuildRequires: python-devel >= 1:2.7
26 BuildRequires: python-setuptools >= 1:42.0.2
28 BuildRequires: python-eventlet >= 0.25.1
29 BuildRequires: python-flaky >= 3.7.0
30 BuildRequires: python-gevent >= 1.2.2
31 BuildRequires: python-greenlet >= 0.4.15
32 BuildRequires: python-hypothesis >= 4.57.1
33 BuildRequires: python-mock >= 3.0.5
34 BuildRequires: python-pycontracts >= 1.8.12
35 BuildRequires: python-pytest >= 4.6.11
36 BuildRequires: python-pytest-xdist >= 1.34.0
37 BuildRequires: python-unittest-mixins >= 1.6
41 BuildRequires: python3-devel >= 1:3.5
42 BuildRequires: python3-setuptools >= 1:42.0.2
44 BuildRequires: python3-eventlet >= 0.25.1
45 BuildRequires: python3-flaky >= 3.7.0
46 BuildRequires: python3-greenlet >= 0.4.15
47 BuildRequires: python3-hypothesis >= 4.57.1
48 BuildRequires: python3-pycontracts >= 1.8.12
49 BuildRequires: python3-pytest >= 4.6.11
50 BuildRequires: python3-pytest-xdist >= 1.34.0
51 BuildRequires: python3-unittest-mixins >= 1.6
55 BuildRequires: python3-doc8 >= 0.8.1
56 BuildRequires: python3-pyenchant >= 3.2.0
57 BuildRequires: python3-sphinxcontrib-restbuilder >= 0.3
58 BuildRequires: python3-sphinxcontrib-spelling >= 7.1.0
59 BuildRequires: python3-sphinx_autobuild >= 2020.9.1
60 BuildRequires: python3-sphinx_rtd_theme >= 0.5.1
61 BuildRequires: python3-sphinx_tabs >= 2.0.0
62 BuildRequires: sphinx-pdg-3 >= 3.4.3
64 Requires: python-modules >= 1:2.7
65 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68 Coverage.py is a tool for measuring code coverage of Python programs.
69 It monitors your program, noting which parts of the code have been
70 executed, then analyzes the source to identify code that could have
71 been executed but was not.
73 %description -l pl.UTF-8
74 Coverage.py to narzędzie do szacowania pokrycia kodu programów w
75 Pythonie. Monitoruje program, zapisując, które części kodu zostały
76 wykonane, a następnie analizuje kod źródłowy w celu zidentyfikowania
77 kodu, który mógłby zostać wykonany, ale nie był.
79 %package -n python3-%{module}
80 Summary: Tool for measuring code coverage of Python programs
81 Summary(pl.UTF-8): Narzędzie do szacowania pokrycia kodu programów w Pythonie
82 Group: Development/Languages/Python
83 Requires: python3-modules >= 1:3.5
85 %description -n python3-%{module}
86 Coverage.py is a tool for measuring code coverage of Python programs.
87 It monitors your program, noting which parts of the code have been
88 executed, then analyzes the source to identify code that could have
89 been executed but was not.
91 %description -n python3-%{module} -l pl.UTF-8
92 Coverage.py to narzędzie do szacowania pokrycia kodu programów w
93 Pythonie. Monitoruje program, zapisując, które części kodu zostały
94 wykonane, a następnie analizuje kod źródłowy w celu zidentyfikowania
95 kodu, który mógłby zostać wykonany, ale nie był.
98 %setup -q -n %{module}-%{version}
105 %{__python} igor.py test_with_tracer py
106 %{__python} igor.py test_with_tracer c
114 %{__python3} igor.py test_with_tracer py
115 %{__python3} igor.py test_with_tracer c
120 sphinx-build -b html -aqE doc doc/_build/html
124 rm -rf $RPM_BUILD_ROOT
137 rm -rf $RPM_BUILD_ROOT
141 %defattr(644,root,root,755)
142 %doc CHANGES.rst CONTRIBUTORS.txt NOTICE.txt README.rst
143 %attr(755,root,root) %{_bindir}/coverage
144 %attr(755,root,root) %{_bindir}/coverage2
145 %attr(755,root,root) %{_bindir}/coverage-%{py_ver}
146 %dir %{py_sitedir}/coverage
147 %{py_sitedir}/coverage/*.py[co]
148 %attr(755,root,root) %{py_sitedir}/coverage/tracer.so
149 %{py_sitedir}/coverage/fullcoverage
150 %{py_sitedir}/coverage/htmlfiles
151 %{py_sitedir}/coverage-%{version}-py*.egg-info
155 %files -n python3-%{module}
156 %defattr(644,root,root,755)
157 %doc CHANGES.rst CONTRIBUTORS.txt NOTICE.txt README.rst
158 %attr(755,root,root) %{_bindir}/coverage3
159 %attr(755,root,root) %{_bindir}/coverage-%{py3_ver}
160 %dir %{py3_sitedir}/coverage
161 %attr(755,root,root) %{py3_sitedir}/coverage/tracer.cpython-*.so
162 %{py3_sitedir}/coverage/*.py
163 %{py3_sitedir}/coverage/__pycache__
164 %{py3_sitedir}/coverage/fullcoverage
165 %{py3_sitedir}/coverage/htmlfiles
166 %{py3_sitedir}/coverage-%{version}-py*.egg-info