File python-pytest-benchmark.spec of Package python-pytest-benchmark

# 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

%{?!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
Group:          Development/Languages/Python
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
BuildRequires:  fdupes
Requires:       python-py-cpuinfo
Requires:       python-pytest >= 2.8
Requires:       python-pathlib
Requires:       python-statistics
Recommends:     python-aspectlib
Recommends:     python-elasticsearch
Recommends:     python-pygal
Recommends:     python-pygaljs
BuildArch:      noarch
Requires(post):   update-alternatives
Requires(postun):  update-alternatives


A py.test fixture for benchmarking code. It will group the tests into
rounds that are calibrated to the chosen timer. 

%setup -q -n pytest-benchmark-%{version}


%python_expand %fdupes %{buildroot}%{$python_sitelib}

%python_clone -a %{buildroot}%{_bindir}/pytest-benchmark
%python_clone -a %{buildroot}%{_bindir}/py.test-benchmark

%if %{with test}
pushd tests
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}

%{python_install_alternative pytest-benchmark py.test-benchmark}

%python_uninstall_alternative pytest-benchmark

%files %{python_files}
%license LICENSE
%python_alternative %{_bindir}/py.test-benchmark
%python_alternative %{_bindir}/pytest-benchmark

openSUSE Build Service is sponsored by