File python-soco.spec of Package python-soco

#
# spec file for package python-soco
#
# 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/
#


%define check 0

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-soco
Version:        0.13
Release:        0
Summary:        SoCo (Sonos Controller) is a simple library to control Sonos speakers
License:        MIT
Group:          Development/Languages/Python
Url:            https://github.com/SoCo/SoCo
Source:         https://files.pythonhosted.org/packages/source/s/soco/soco-%{version}.tar.gz
Patch0:         dont-require-test-modules.patch
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module requests}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module xmltodict}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
# test requirements
%if %{check}
BuildRequires:  %{python_module Sphinx >= 1.3}
BuildRequires:  %{python_module coveralls}
BuildRequires:  %{python_module flake8}
BuildRequires:  %{python_module graphviz}
BuildRequires:  %{python_module mock >= 1.0.1}
BuildRequires:  %{python_module pylint >= 1.4}
BuildRequires:  %{python_module pytest >= 2.5}
BuildRequires:  %{python_module pytest-cov}
BuildRequires:  %{python_module sphinx_rtd_theme}
BuildRequires:  %{python_module wheel}
%endif
Requires:       python-requests
Requires:       python-xmltodict
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%python_subpackages

%description
SoCo (Sonos Controller) is a simple Python class that allows you to
programmatically control Sonos speakers.

%prep
%setup -q -n soco-%{version}
%patch0 -p1

%build
%python_build

%install
%python_install
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}

%if %{check}
%check
%python_exec setup.py test
%endif

%files %{python_files}
%defattr(-,root,root,-)
%doc AUTHORS.rst README.rst LICENSE.rst
%{python_sitelib}/soco
%{python_sitelib}/soco-%{version}-py%{py_ver}.egg-info

%changelog
openSUSE Build Service is sponsored by