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