]>
Commit | Line | Data |
---|---|---|
aaf27adc JB |
1 | # |
2 | # Conditional build: | |
fa29ddd7 | 3 | %bcond_without doc # Sphinx documentation |
2b332d96 | 4 | %bcond_with tests # py.test tests [sensitive to coverage and pytest output, few tests fail for me] |
fa29ddd7 | 5 | %bcond_with tests_py2 # Python 2 py.test tests [require some modules sources + the above] |
2b332d96 JB |
6 | %bcond_without python2 # CPython 2.x module |
7 | %bcond_without python3 # CPython 3.x module | |
aaf27adc JB |
8 | |
9 | Summary: pytest plugin for measuring coverage | |
10 | Summary(pl.UTF-8): Wtyczka pytest do mierzenia pokrycia | |
11 | Name: python-pytest-cov | |
9da1806d JB |
12 | # keep 2.x here for python2 support; >=2.11,<3 requires updating coverage to >=5.2.1 |
13 | Version: 2.10.1 | |
1ed7110f | 14 | Release: 3 |
aaf27adc JB |
15 | License: MIT |
16 | Group: Libraries/Python | |
2b332d96 | 17 | #Source0Download: https://pypi.org/simple/pytest-cov/ |
aaf27adc | 18 | Source0: https://files.pythonhosted.org/packages/source/p/pytest-cov/pytest-cov-%{version}.tar.gz |
9da1806d | 19 | # Source0-md5: 13e17f0b4f263a04fb1fadde7ebe2fbb |
aaf27adc JB |
20 | URL: https://github.com/pytest-dev/pytest-cov |
21 | %if %{with python2} | |
2b332d96 | 22 | BuildRequires: python-modules >= 1:2.7 |
aaf27adc | 23 | BuildRequires: python-setuptools |
fa29ddd7 | 24 | %if %{with tests_py2} |
826fbf4b | 25 | BuildRequires: python-coverage >= 4.5.4 |
2b332d96 | 26 | BuildRequires: python-fields |
826fbf4b | 27 | BuildRequires: python-process_tests >= 2.0.2 |
2b332d96 | 28 | BuildRequires: python-py |
826fbf4b | 29 | BuildRequires: python-pytest >= 3.10.1 |
2b332d96 JB |
30 | BuildRequires: python-pytest-xdist >= 1.23.0 |
31 | BuildRequires: python-six | |
aaf27adc JB |
32 | BuildRequires: python-virtualenv |
33 | %endif | |
34 | %endif | |
35 | %if %{with python3} | |
2b332d96 | 36 | BuildRequires: python3-modules >= 1:3.4 |
aaf27adc JB |
37 | BuildRequires: python3-setuptools |
38 | %if %{with tests} | |
826fbf4b | 39 | BuildRequires: python3-coverage >= 4.5.4 |
2b332d96 | 40 | BuildRequires: python3-fields |
826fbf4b | 41 | BuildRequires: python3-process_tests >= 2.0.2 |
2b332d96 | 42 | BuildRequires: python3-py |
826fbf4b | 43 | BuildRequires: python3-pytest >= 3.10.1 |
2b332d96 JB |
44 | BuildRequires: python3-pytest-xdist >= 1.23.0 |
45 | BuildRequires: python3-six | |
aaf27adc JB |
46 | BuildRequires: python3-virtualenv |
47 | %endif | |
48 | %endif | |
49 | BuildRequires: rpm-pythonprov | |
50 | BuildRequires: rpmbuild(macros) >= 1.714 | |
51 | %if %{with doc} | |
52 | BuildRequires: sphinx-pdg | |
53 | BuildRequires: python3-sphinx_py3doc_enhanced_theme | |
54 | %endif | |
2b332d96 | 55 | Requires: python-modules >= 1:2.7 |
aaf27adc JB |
56 | BuildArch: noarch |
57 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
58 | ||
59 | %description | |
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. | |
63 | ||
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. | |
68 | ||
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 | |
2b332d96 | 73 | Requires: python3-modules >= 1:3.4 |
aaf27adc JB |
74 | |
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. | |
79 | ||
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. | |
84 | ||
85 | %package apidocs | |
86 | Summary: Documentation for pytest-cov module | |
87 | Summary(pl.UTF-8): Dokumentacja do modułu pytest-cov | |
88 | Group: Documentation | |
89 | ||
90 | %description apidocs | |
91 | Documentation for pytest-cov module. | |
92 | ||
93 | %description apidocs -l pl.UTF-8 | |
94 | Dokumentacja do modułu pytest-cov. | |
95 | ||
96 | %prep | |
97 | %setup -q -n pytest-cov-%{version} | |
98 | ||
99 | %build | |
100 | %if %{with python2} | |
101 | %py_build | |
102 | ||
fa29ddd7 | 103 | %if %{with tests_py2} |
2b332d96 JB |
104 | PYTHONPATH=$(pwd)/src:$(pwd)/tests \ |
105 | XPYTEST_PLUGINS=pytest_cov.plugin \ | |
106 | %{__python} -m pytest tests | |
aaf27adc JB |
107 | %endif |
108 | %endif | |
109 | ||
110 | %if %{with python3} | |
111 | %py3_build | |
112 | ||
113 | %if %{with tests} | |
2b332d96 JB |
114 | PYTHONPATH=$(pwd)/src:$(pwd)/tests \ |
115 | XPYTEST_PLUGINS=pytest_cov.plugin \ | |
116 | %{__python3} -m pytest tests | |
aaf27adc JB |
117 | %endif |
118 | %endif | |
119 | ||
120 | %if %{with doc} | |
121 | cd docs | |
122 | sphinx-build -b html . _build/html | |
123 | %endif | |
124 | ||
125 | %install | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
128 | %if %{with python2} | |
129 | %py_install | |
130 | ||
131 | %py_postclean | |
132 | %endif | |
133 | ||
134 | %if %{with python3} | |
135 | %py3_install | |
136 | %endif | |
137 | ||
138 | %clean | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
141 | %if %{with python2} | |
142 | %files | |
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 | |
148 | %endif | |
149 | ||
150 | %if %{with python3} | |
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 | |
157 | %endif | |
158 | ||
159 | %if %{with doc} | |
160 | %files apidocs | |
161 | %defattr(644,root,root,755) | |
162 | %doc docs/_build/html/{_static,*.html,*.js} | |
163 | %endif |