File python-mpld3.spec of Package python-mpld3

#
# spec file for package python-mpld3
#
# Copyright (c) 2015 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-mpld3
Version:        0.3
Release:        0
Summary:        D3 Viewer for Matplotlib
License:        BSD-3-Clause
Group:          Development/Languages/Python
Url:            http://mpld3.github.com
Source:         https://files.pythonhosted.org/packages/source/m/mpld3/mpld3-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module Jinja2 >= 2.7}
BuildRequires:  %{python_module matplotlib >= 1.3}
BuildRequires:  %{python_module pandas}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
%if %{with test}
BuildRequires:  %{python_module nose}
BuildRequires:  %{python_module numpy}
%endif
Requires:       python-Jinja2 >= 2.7
Requires:       python-matplotlib >= 1.3
Requires:       python-pandas
Recommends:     python-jupyter_ipython >= 2.0
BuildArch:      noarch

%python_subpackages

%description
This is an interactive D3js-based viewer which brings matplotlib graphics to the browser.
Please visit http://mpld3.github.io for documentation and examples.

mpld3 provides a custom stand-alone javascript library built on D3, which
parses JSON representations of plots.  The mpld3 python module provides a
set of routines which parses matplotlib plots (using the mplexporter
framework) and outputs the JSON description readable by mpld3.js.

%package -n %{name}-doc
Summary:        Documentation for %{name}
Group:          Development/Languages/Python
Recommends:     python3-jupyter_ipython >= 2.0
Provides:       %{python_module %{name} = %{version}}

%description -n %{name}-doc
Documentation and examples for %{name}

%prep
%setup -q -n mpld3-%{version}
chmod a-x notebooks/sliderPlugin.ipynb

%build
%python_build

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

%if %{with test}
%check
%python_expand nosetests-%{$python_bin_suffix} mpld3
%endif

%files %{python_files}
%defattr(-,root,root,-)
%doc AUTHORS.md LICENSE README.md
%{python_sitelib}/*

%files -n %{name}-doc
%defattr(-,root,root,-)
%doc examples/ notebooks/

%changelog
openSUSE Build Service is sponsored by