]> git.pld-linux.org Git - SPECS.git/blob - python-coverage.spec
SPECS updated Wed 1 May 10:14:00 CEST 2024
[SPECS.git] / python-coverage.spec
1 # TODO: finish doc and tests (where dependencies available in PLD)
2 #
3 # Conditional build:
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
8
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
14 Version:        5.5
15 Release:        1
16 License:        Apache v2.0
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
24 %if %{with python2}
25 BuildRequires:  python-devel >= 1:2.7
26 BuildRequires:  python-setuptools >= 1:42.0.2
27 %if %{with tests}
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
38 %endif
39 %endif
40 %if %{with python3}
41 BuildRequires:  python3-devel >= 1:3.5
42 BuildRequires:  python3-setuptools >= 1:42.0.2
43 %if %{with tests}
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
52 %endif
53 %endif
54 %if %{with doc}
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
63 %endif
64 Requires:       python-modules >= 1:2.7
65 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67 %description
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.
72
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ł.
78
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
84
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.
90
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ł.
96
97 %prep
98 %setup -q -n %{module}-%{version}
99
100 %build
101 %if %{with python2}
102 %py_build
103
104 %if %{with tests}
105 %{__python} igor.py test_with_tracer py
106 %{__python} igor.py test_with_tracer c
107 %endif
108 %endif
109
110 %if %{with python3}
111 %py3_build
112
113 %if %{with tests}
114 %{__python3} igor.py test_with_tracer py
115 %{__python3} igor.py test_with_tracer c
116 %endif
117 %endif
118
119 %if %{with doc}
120 sphinx-build -b html -aqE doc doc/_build/html
121 %endif
122
123 %install
124 rm -rf $RPM_BUILD_ROOT
125
126 %if %{with python3}
127 %py3_install
128 %endif
129
130 %if %{with python2}
131 %py_install
132
133 %py_postclean
134 %endif
135
136 %clean
137 rm -rf $RPM_BUILD_ROOT
138
139 %if %{with python2}
140 %files
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
152 %endif
153
154 %if %{with python3}
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
167 %endif
This page took 0.190871 seconds and 4 git commands to generate.