From 937b40870ab4524cb5bf0a7b363bd0c9edf6249db9f488ddcb470384e1b56e3c Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <dleuenberger@suse.com>
Date: Tue, 29 May 2018 14:48:08 +0000
Subject: [PATCH] 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
---
 .gitattributes                  |  23 ++++++++
 .gitignore                      |   1 +
 pytest-benchmark-3.1.1.tar.gz   |   3 +
 python-pytest-benchmark.changes |  10 ++++
 python-pytest-benchmark.spec    | 100 ++++++++++++++++++++++++++++++++
 5 files changed, 137 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 .gitignore
 create mode 100644 pytest-benchmark-3.1.1.tar.gz
 create mode 100644 python-pytest-benchmark.changes
 create mode 100644 python-pytest-benchmark.spec

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..9b03811
--- /dev/null
+++ b/.gitattributes
@@ -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
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..57affb6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.osc
diff --git a/pytest-benchmark-3.1.1.tar.gz b/pytest-benchmark-3.1.1.tar.gz
new file mode 100644
index 0000000..588ddac
--- /dev/null
+++ b/pytest-benchmark-3.1.1.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:185526b10b7cf1804cb0f32ac0653561ef2f233c6e50a9b3d8066a9757e36480
+size 333499
diff --git a/python-pytest-benchmark.changes b/python-pytest-benchmark.changes
new file mode 100644
index 0000000..84090af
--- /dev/null
+++ b/python-pytest-benchmark.changes
@@ -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
diff --git a/python-pytest-benchmark.spec b/python-pytest-benchmark.spec
new file mode 100644
index 0000000..f513ac8
--- /dev/null
+++ b/python-pytest-benchmark.spec
@@ -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