]>
Commit | Line | Data |
---|---|---|
3c63b87a | 1 | # TODO: finish doc and tests (where dependencies available in PLD) |
89c96ed0 JB |
2 | # |
3 | # Conditional build: | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
3c63b87a JB |
6 | %bcond_with doc # Sphinx documentation |
7 | %bcond_with tests # unit tests | |
89c96ed0 | 8 | |
d1b18853 | 9 | %define module coverage |
10 | Summary: Tool for measuring code coverage of Python programs | |
89c96ed0 | 11 | Summary(pl.UTF-8): Narzędzie do szacowania pokrycia kodu programów w Pythonie |
d1b18853 | 12 | Name: python-%{module} |
5420a90b | 13 | Version: 4.5.4 |
941079b2 | 14 | Release: 4 |
305b66d8 | 15 | License: Apache v2.0 |
d1b18853 | 16 | Group: Development/Languages/Python |
3c63b87a | 17 | #Source0Download: https://pypi.org/simple/coverage/ |
564086f1 | 18 | Source0: https://files.pythonhosted.org/packages/source/c/coverage/%{module}-%{version}.tar.gz |
5420a90b | 19 | # Source0-md5: c33cab2aed8780aac32880cb6c7616b7 |
89c96ed0 JB |
20 | URL: http://coverage.readthedocs.org/ |
21 | BuildRequires: rpm-pythonprov | |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
23 | %if %{with python2} | |
305b66d8 | 24 | BuildRequires: python-devel >= 1:2.6 |
e121db2c | 25 | BuildRequires: python-setuptools >= 1:35.0.2 |
3c63b87a | 26 | %if %{with tests} |
5420a90b | 27 | BuildRequires: python-eventlet >= 0.22.0 |
3c63b87a | 28 | BuildRequires: python-flaky >= 3.4.0 |
5420a90b JB |
29 | BuildRequires: python-gevent >= 1.2.2 |
30 | BuildRequires: python-greenlet >= 0.4.13 | |
31 | BuildRequires: python-mock >= 2.0.0 | |
32 | BuildRequires: python-pycontracts >= 1.8.2 | |
33 | BuildRequires: python-pyparsing >= 2.4.0 | |
3c63b87a JB |
34 | BuildRequires: python-pytest >= 3.2.5 |
35 | BuildRequires: python-pytest-xdist >= 1.20.1 | |
5420a90b | 36 | BuildRequires: python-unittest-mixins >= 1.4 |
3c63b87a | 37 | %endif |
89c96ed0 JB |
38 | %endif |
39 | %if %{with python3} | |
305b66d8 | 40 | BuildRequires: python3-devel >= 1:3.3 |
e121db2c | 41 | BuildRequires: python3-setuptools >= 1:35.0.2 |
3c63b87a | 42 | %if %{with tests} |
5420a90b JB |
43 | BuildRequires: python3-eventlet >= 0.22.0 |
44 | BuildRequires: python3-flaky >= 3.4.0 | |
45 | BuildRequires: python3-greenlet >= 0.4.13 | |
46 | BuildRequires: python3-pycontracts >= 1.8.2 | |
47 | BuildRequires: python3-pyparsing >= 2.4.0 | |
48 | BuildRequires: python3-pytest >= 3.2.5 | |
49 | BuildRequires: python3-pytest-xdist >= 1.20.1 | |
50 | BuildRequires: python3-unittest-mixins >= 1.4 | |
3c63b87a JB |
51 | %endif |
52 | %endif | |
53 | %if %{with doc} | |
5420a90b | 54 | BuildRequires: python-doc8 >= 0.8.0 |
3c63b87a JB |
55 | BuildRequires: python-pyenchant >= 2.0.0 |
56 | BuildRequires: python-sphinxcontrib-spelling >= 4.0.1 | |
57 | BuildRequires: python-sphinx_rtd_theme >= 0.2.4 | |
58 | BuildRequires: sphinx-pdg-2 >= 1.6.6 | |
89c96ed0 | 59 | %endif |
305b66d8 | 60 | Requires: python-modules >= 1:2.6 |
d1b18853 | 61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
62 | ||
63 | %description | |
61734f13 | 64 | Coverage.py is a tool for measuring code coverage of Python programs. |
65 | It monitors your program, noting which parts of the code have been | |
66 | executed, then analyzes the source to identify code that could have | |
67 | been executed but was not. | |
d1b18853 | 68 | |
89c96ed0 JB |
69 | %description -l pl.UTF-8 |
70 | Coverage.py to narzędzie do szacowania pokrycia kodu programów w | |
71 | Pythonie. Monitoruje program, zapisując, które części kodu zostały | |
72 | wykonane, a następnie analizuje kod źródłowy w celu zidentyfikowania | |
73 | kodu, który mógłby zostać wykonany, ale nie był. | |
74 | ||
4af080a0 | 75 | %package -n python3-%{module} |
76 | Summary: Tool for measuring code coverage of Python programs | |
89c96ed0 | 77 | Summary(pl.UTF-8): Narzędzie do szacowania pokrycia kodu programów w Pythonie |
4af080a0 | 78 | Group: Development/Languages/Python |
305b66d8 | 79 | Requires: python3-modules >= 1:3.3 |
4af080a0 | 80 | |
81 | %description -n python3-%{module} | |
82 | Coverage.py is a tool for measuring code coverage of Python programs. | |
83 | It monitors your program, noting which parts of the code have been | |
84 | executed, then analyzes the source to identify code that could have | |
85 | been executed but was not. | |
86 | ||
89c96ed0 JB |
87 | %description -n python3-%{module} -l pl.UTF-8 |
88 | Coverage.py to narzędzie do szacowania pokrycia kodu programów w | |
89 | Pythonie. Monitoruje program, zapisując, które części kodu zostały | |
90 | wykonane, a następnie analizuje kod źródłowy w celu zidentyfikowania | |
91 | kodu, który mógłby zostać wykonany, ale nie był. | |
92 | ||
d1b18853 | 93 | %prep |
94 | %setup -q -n %{module}-%{version} | |
95 | ||
96 | %build | |
89c96ed0 JB |
97 | %if %{with python2} |
98 | %py_build | |
3c63b87a JB |
99 | |
100 | %if %{with tests} | |
101 | %{__python} igor.py test_with_tracer py | |
102 | %{__python} igor.py test_with_tracer c | |
103 | %endif | |
89c96ed0 JB |
104 | %endif |
105 | ||
106 | %if %{with python3} | |
107 | %py3_build | |
3c63b87a JB |
108 | |
109 | %if %{with tests} | |
110 | %{__python3} igor.py test_with_tracer py | |
111 | %{__python3} igor.py test_with_tracer c | |
112 | %endif | |
113 | %endif | |
114 | ||
115 | %if %{with doc} | |
116 | sphinx-build -b html -aqE doc doc/_build/html | |
89c96ed0 | 117 | %endif |
d1b18853 | 118 | |
119 | %install | |
120 | rm -rf $RPM_BUILD_ROOT | |
4af080a0 | 121 | |
564086f1 JB |
122 | %if %{with python3} |
123 | %py3_install | |
124 | %endif | |
125 | ||
89c96ed0 JB |
126 | %if %{with python2} |
127 | %py_install | |
d1b18853 | 128 | |
d1b18853 | 129 | %py_postclean |
89c96ed0 JB |
130 | %endif |
131 | ||
d1b18853 | 132 | %clean |
133 | rm -rf $RPM_BUILD_ROOT | |
134 | ||
89c96ed0 | 135 | %if %{with python2} |
d1b18853 | 136 | %files |
137 | %defattr(644,root,root,755) | |
67d01746 | 138 | %doc CHANGES.rst CONTRIBUTORS.txt NOTICE.txt README.rst TODO.txt |
564086f1 | 139 | %attr(755,root,root) %{_bindir}/coverage |
305b66d8 | 140 | %attr(755,root,root) %{_bindir}/coverage2 |
54d0d8d2 | 141 | %attr(755,root,root) %{_bindir}/coverage-%{py_ver} |
3c63b87a JB |
142 | %dir %{py_sitedir}/coverage |
143 | %{py_sitedir}/coverage/*.py[co] | |
144 | %attr(755,root,root) %{py_sitedir}/coverage/tracer.so | |
145 | %{py_sitedir}/coverage/fullcoverage | |
146 | %{py_sitedir}/coverage/htmlfiles | |
305b66d8 | 147 | %{py_sitedir}/coverage-%{version}-py*.egg-info |
d1b18853 | 148 | %endif |
4af080a0 | 149 | |
89c96ed0 | 150 | %if %{with python3} |
4af080a0 | 151 | %files -n python3-%{module} |
152 | %defattr(644,root,root,755) | |
67d01746 | 153 | %doc CHANGES.rst CONTRIBUTORS.txt NOTICE.txt README.rst TODO.txt |
305b66d8 | 154 | %attr(755,root,root) %{_bindir}/coverage3 |
54d0d8d2 | 155 | %attr(755,root,root) %{_bindir}/coverage-%{py3_ver} |
3c63b87a JB |
156 | %dir %{py3_sitedir}/coverage |
157 | %attr(755,root,root) %{py3_sitedir}/coverage/tracer.cpython-*.so | |
158 | %{py3_sitedir}/coverage/*.py | |
159 | %{py3_sitedir}/coverage/__pycache__ | |
160 | %{py3_sitedir}/coverage/fullcoverage | |
161 | %{py3_sitedir}/coverage/htmlfiles | |
305b66d8 | 162 | %{py3_sitedir}/coverage-%{version}-py*.egg-info |
89c96ed0 | 163 | %endif |