]> git.pld-linux.org Git - packages/python-pytest-cov.git/blob - python-pytest-cov.spec
- updated to 2.10.1
[packages/python-pytest-cov.git] / python-pytest-cov.spec
1 #
2 # Conditional build:
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
8
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
13 Version:        2.10.1
14 Release:        1
15 License:        MIT
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
21 %if %{with python2}
22 BuildRequires:  python-modules >= 1:2.7
23 BuildRequires:  python-setuptools
24 %if %{with tests_py2}
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
33 %endif
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3-modules >= 1:3.4
37 BuildRequires:  python3-setuptools
38 %if %{with tests}
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
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
55 Requires:       python-modules >= 1:2.7
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
73 Requires:       python3-modules >= 1:3.4
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
103 %if %{with tests_py2}
104 PYTHONPATH=$(pwd)/src:$(pwd)/tests \
105 XPYTEST_PLUGINS=pytest_cov.plugin \
106 %{__python} -m pytest tests
107 %endif
108 %endif
109
110 %if %{with python3}
111 %py3_build
112
113 %if %{with tests}
114 PYTHONPATH=$(pwd)/src:$(pwd)/tests \
115 XPYTEST_PLUGINS=pytest_cov.plugin \
116 %{__python3} -m pytest tests
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
This page took 0.054843 seconds and 3 git commands to generate.