File python-bokeh.spec of Package python-bokeh

#
# spec file for package python-bokeh
#
# Copyright (c) 2017 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/
#


# Tests fail due to missing test directory
%bcond_with tests

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-bokeh
Version:        0.12.13
Release:        0
Summary:        Statistical and novel interactive HTML plots for Python
License:        BSD-3-Clause
Group:          Development/Languages/Python
Url:            http://bokeh.pydata.org/
Source:         https://files.pythonhosted.org/packages/source/b/bokeh/bokeh-%{version}.tar.gz
BuildRequires:  %{python_module Jinja2 >= 2.7}
BuildRequires:  %{python_module PyYAML >= 3.10}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module jupyter_ipython}
BuildRequires:  %{python_module numpy >= 1.7.1}
BuildRequires:  %{python_module python-dateutil >= 2.1}
BuildRequires:  %{python_module requests >= 1.2.3}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module six >= 1.5.2}
BuildRequires:  %{python_module tornado >= 4.3}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
%if %{with tests}
BuildRequires:  %{python_module beautifulsoup4}
BuildRequires:  %{python_module boto}
BuildRequires:  %{python_module certifi}
BuildRequires:  %{python_module colorama}
BuildRequires:  %{python_module mock >= 1.0.1}
BuildRequires:  %{python_module pytest}
%endif
# Python2 dependencies
BuildRequires:  python-futures >= 3.0.3
Requires:       python-Jinja2 >= 2.7
Requires:       python-PyYAML >= 3.10
Requires:       python-numpy >= 1.7.1
Requires:       python-python-dateutil >= 2.1
Requires:       python-requests >= 1.2.3
Requires:       python-six >= 1.5.2
Requires:       python-tornado >= 4.3
%ifpython2
Requires:       python-futures >= 3.0.3
%endif
Recommends:     python-flexx
Recommends:     python-icalendar
Recommends:     python-vincent
BuildConflicts: python-buildservice-tweak
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires(post): update-alternatives
Requires(preun): update-alternatives
BuildArch:      noarch
%python_subpackages

%description
Bokeh is a Python interactive visualization library that targets
modern web browsers for presentation. Its goal is to provide elegant,
concise construction of novel graphics in the style of D3.js, but
also deliver this capability with high-performance interactivity over
very large or streaming datasets. Bokeh can help anyone who would like
to quickly and easily create interactive plots, dashboards, and data
applications.

%prep
%setup -q -n bokeh-%{version}

%build
%python_build

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

%python_clone -a %{buildroot}%{_bindir}/bokeh

# Remove hidden files
%python_expand mkdir -p %{buildroot}%{_docdir}/%{$python_prefix}-bokeh
%python_expand cp -r examples %{buildroot}%{_docdir}/%{$python_prefix}-bokeh/
%python_expand rm -rf examples %{buildroot}%{_docdir}/%{$python_prefix}-bokeh/examples/*/.ipynb_checkpoints
%python_expand rm -rf examples %{buildroot}%{_docdir}/%{$python_prefix}-bokeh/examples/*/*/.ipynb_checkpoints

# Remove test and script files
%python_expand rm -rf %{buildroot}%{$python_sitelib}/scripts/
%python_expand rm -rf %{buildroot}%{$python_sitelib}/tests/

%if %{with tests}
%check
%python_expand py.test-%{$python_bin_suffix} -s -m js -rs
%python_expand py.test-%{$python_bin_suffix} -m 'not (examples or js or integration)' --cov=bokeh --cov-config=bokeh/.coveragerc -rs
%python_expand py.test-%{$python_bin_suffix} -m integration -rs -v
%endif

%post
%python_install_alternative bokeh

%preun
%python_uninstall_alternative bokeh

%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE.txt
%{_docdir}/%{python_prefix}-bokeh
%python_alternative %{_bindir}/bokeh
%{python_sitelib}/bokeh/
%{python_sitelib}/bokeh-%{version}-py*.egg-info

%changelog
openSUSE Build Service is sponsored by