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 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
openSUSE Build Service is sponsored by