]> git.pld-linux.org Git - packages/python-pytest-benchmark.git/blob - python-pytest-benchmark.spec
rebuild with tests and docs
[packages/python-pytest-benchmark.git] / python-pytest-benchmark.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_with     tests   # unit tests [very sensitive to pytest output]
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 Summary:        py.test fixture for benchmarking code
9 Summary(pl.UTF-8):      Wyposażenie py.testa do testowania wydajności kodu
10 Name:           python-pytest-benchmark
11 Version:        3.4.1
12 Release:        3
13 License:        BSD
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/pytest-benchmark/
16 Source0:        https://files.pythonhosted.org/packages/source/p/pytest-benchmark/pytest-benchmark-%{version}.tar.gz
17 # Source0-md5:  7fa3588a1a94fc2bbf42b377d6bdb946
18 Patch0:         %{name}-tests.patch
19 URL:            https://github.com/ionelmc/pytest-benchmark
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.6
22 BuildRequires:  python-setuptools
23 %if %{with tests}
24 #BuildRequires: python-aspectlib >= 1.4.2
25 # for storage tests
26 #BuildRequires: python-elasticsearch >= 5.3.0
27 BuildRequires:  python-freezegun >= 0.3.8
28 BuildRequires:  python-pathlib >= 1.0.1
29 BuildRequires:  python-py-cpuinfo
30 # for histogram tests
31 #BuildRequires: python-pygal >= 2.2.1
32 #BuildRequires: python-pygaljs >= 1.0.1
33 BuildRequires:  python-pytest >= 3.8
34 BuildRequires:  python-statistics >= 1.0.3.5
35 %endif
36 %endif
37 %if %{with python3}
38 BuildRequires:  python3-modules >= 1:3.4
39 BuildRequires:  python3-setuptools
40 %if %{with tests}
41 #BuildRequires: python3-aspectlib >= 1.4.2
42 # for storage tests
43 #BuildRequires: python3-elasticsearch >= 5.3.0
44 BuildRequires:  python3-freezegun >= 0.3.8
45 BuildRequires:  python3-py-cpuinfo
46 # for histogram tests
47 #BuildRequires: python3-pygal >= 2.2.3
48 #BuildRequires: python3-pygaljs >= 1.0.1
49 BuildRequires:  python3-pytest >= 3.8
50 %if "%{py3_ver}" < "3.3"
51 BuildRequires:  python3-mock >= 2.0.0
52 %endif
53 %if "%{py3_ver}" < "3.4"
54 BuildRequires:  python3-pathlib >= 1.0.1
55 BuildRequires:  python3-statistics >= 1.0.3.5
56 %endif
57 %endif
58 %endif
59 BuildRequires:  rpm-pythonprov
60 BuildRequires:  rpmbuild(macros) >= 1.714
61 %if %{with doc}
62 BuildRequires:  python3-sphinx_py3doc_enhanced_theme
63 BuildRequires:  sphinx-pdg-3
64 %endif
65 Requires:       python-modules >= 1:2.6
66 BuildArch:      noarch
67 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69 %description
70 A py.test fixture for benchmarking code. It will group the tests into
71 rounds that are calibrated to the chosen timer.
72
73 %description -l pl.UTF-8
74 Wyposażenie (fixture) modułu py.test do testowania wydajności kodu.
75 Grupuje testy w rundy, które są kalibrowane do wybranego stopera.
76
77 %package -n python3-pytest-benchmark
78 Summary:        py.test fixture for benchmarking code
79 Summary(pl.UTF-8):      Wyposażenie py.testa do testowania wydajności kodu
80 Group:          Libraries/Python
81 Requires:       python3-modules >= 1:3.4
82
83 %description -n python3-pytest-benchmark
84 A py.test fixture for benchmarking code. It will group the tests into
85 rounds that are calibrated to the chosen timer.
86
87 %description -n python3-pytest-benchmark -l pl.UTF-8
88 Wyposażenie (fixture) modułu py.test do testowania wydajności kodu.
89 Grupuje testy w rundy, które są kalibrowane do wybranego stopera.
90
91 %package apidocs
92 Summary:        API documentation for Python pytest_benchmark module
93 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona pytest_benchmark
94 Group:          Documentation
95
96 %description apidocs
97 API documentation for Python pytest_benchmark module.
98
99 %description apidocs -l pl.UTF-8
100 Dokumentacja API modułu Pythona pytest_benchmark.
101
102 %prep
103 %setup -q -n pytest-benchmark-%{version}
104 %patch0 -p1
105
106 # (mostly temporarily disabled tests)
107 # requires elasticsearch
108 %{__rm} tests/test_elasticsearch_storage.py
109 # no py.test-benchmark program before install
110 %{__rm} tests/test_cli.py
111 # requires pygal for histograms
112 %{__rm} tests/test_storage.py
113 # require aspectlib
114 %{__rm} tests/test_with_testcase.py
115 %{__rm} tests/test_with_weaver.py
116 # a few too depending on git, one elasticsearch
117 %{__rm} tests/test_utils.py
118
119 %build
120 %if %{with python2}
121 %py_build
122
123 %if %{with tests}
124 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
125 PYTHONPATH=$(pwd)/src \
126 %{__python} -m pytest tests
127 %endif
128 %endif
129
130 %if %{with python3}
131 %py3_build
132
133 %if %{with tests}
134 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
135 PYTHONPATH=$(pwd)/src \
136 %{__python3} -m pytest tests
137 %endif
138 %endif
139
140 %if %{with doc}
141 cd docs
142 PYTHONPATH=$(pwd)/../src \
143 sphinx-build-3 -b html . _build/html
144 %endif
145
146 %install
147 rm -rf $RPM_BUILD_ROOT
148
149 %if %{with python2}
150 %py_install
151
152 %py_postclean
153
154 %{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test-benchmark{,-2}
155 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest-benchmark{,-2}
156 %endif
157
158 %if %{with python3}
159 %py3_install
160
161 %{__mv} $RPM_BUILD_ROOT%{_bindir}/py.test-benchmark{,-3}
162 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pytest-benchmark{,-3}
163 ln -s py.test-benchmark-3 $RPM_BUILD_ROOT%{_bindir}/py.test-benchmark
164 ln -s pytest-benchmark-3 $RPM_BUILD_ROOT%{_bindir}/pytest-benchmark
165 %endif
166
167 %clean
168 rm -rf $RPM_BUILD_ROOT
169
170 %if %{with python2}
171 %files
172 %defattr(644,root,root,755)
173 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
174 %attr(755,root,root) %{_bindir}/py.test-benchmark-2
175 %attr(755,root,root) %{_bindir}/pytest-benchmark-2
176 %{py_sitescriptdir}/pytest_benchmark
177 %{py_sitescriptdir}/pytest_benchmark-%{version}-py*.egg-info
178 %endif
179
180 %if %{with python3}
181 %files -n python3-pytest-benchmark
182 %defattr(644,root,root,755)
183 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
184 %attr(755,root,root) %{_bindir}/py.test-benchmark
185 %attr(755,root,root) %{_bindir}/pytest-benchmark
186 %attr(755,root,root) %{_bindir}/py.test-benchmark-3
187 %attr(755,root,root) %{_bindir}/pytest-benchmark-3
188 %{py3_sitescriptdir}/pytest_benchmark
189 %{py3_sitescriptdir}/pytest_benchmark-%{version}-py*.egg-info
190 %endif
191
192 %if %{with doc}
193 %files apidocs
194 %defattr(644,root,root,755)
195 %doc docs/_build/html/{_images,_modules,_static,*.html,*.js}
196 %endif
This page took 0.066185 seconds and 3 git commands to generate.