1
0

Accepting request 605965 from devel:languages:python

Add benchmarks to pytest tests

OBS-URL: https://build.opensuse.org/request/show/605965
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-benchmark?expand=0&rev=1
This commit is contained in:
Dominique Leuenberger 2018-05-29 14:48:08 +00:00 committed by Git OBS Bridge
commit 937b40870a
5 changed files with 137 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:185526b10b7cf1804cb0f32ac0653561ef2f233c6e50a9b3d8066a9757e36480
size 333499

View File

@ -0,0 +1,10 @@
-------------------------------------------------------------------
Wed May 9 23:25:39 UTC 2018 - toddrme2178@gmail.com
- Use license tag
- Implement update-alternatives
-------------------------------------------------------------------
Thu Oct 19 00:24:23 UTC 2017 - toddrme2178@gmail.com
- Initial version

View File

@ -0,0 +1,100 @@
#
# spec file for package python-pytest-benchmark
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_with test
Name: python-pytest-benchmark
Version: 3.1.1
Release: 0
License: BSD-2-Clause
Summary: A py.test fixture for benchmarking code
Url: https://github.com/ionelmc/pytest-benchmark
Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/p/pytest-benchmark/pytest-benchmark-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
%if %{with test}
BuildRequires: %{python_module aspectlib}
BuildRequires: %{python_module elasticsearch}
BuildRequires: %{python_module freezegun}
BuildRequires: %{python_module py-cpuinfo}
BuildRequires: %{python_module pygal}
BuildRequires: %{python_module pygaljs}
BuildRequires: %{python_module pytest >= 2.8}
BuildRequires: python-mock
BuildRequires: python-pathlib
BuildRequires: python-statistics
%endif
BuildRequires: fdupes
Requires: python-py-cpuinfo
Requires: python-pytest >= 2.8
%ifpython2
Requires: python-pathlib
Requires: python-statistics
%endif
Recommends: python-aspectlib
Recommends: python-elasticsearch
Recommends: python-pygal
Recommends: python-pygaljs
BuildArch: noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages
%description
A py.test fixture for benchmarking code. It will group the tests into
rounds that are calibrated to the chosen timer.
%prep
%setup -q -n pytest-benchmark-%{version}
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/pytest-benchmark
%python_clone -a %{buildroot}%{_bindir}/py.test-benchmark
%if %{with test}
%check
pushd tests
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
py.test-%{$python_bin_suffix}
}
popd
%endif
%post
%{python_install_alternative pytest-benchmark py.test-benchmark}
%postun
%python_uninstall_alternative pytest-benchmark
%files %{python_files}
%defattr(-,root,root,-)
%doc AUTHORS.rst CHANGELOG.rst README.rst
%license LICENSE
%python_alternative %{_bindir}/py.test-benchmark
%python_alternative %{_bindir}/pytest-benchmark
%{python_sitelib}/*
%changelog