File python-jupyter_dashboards.spec of Package python-jupyter_dashboards
#
# spec file for package python-jupyter_dashboards
#
# 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_without test
Name: python-jupyter_dashboards
Version: 0.7.0
Release: 0
Summary: Extension for using Jupyter Notebooks as dynamic dashboards
License: BSD-3-Clause
Group: Development/Languages/Python
Url: https://github.com/jupyter/dashboards
Source: https://files.pythonhosted.org/packages/source/j/jupyter_dashboards/jupyter_dashboards-%{version}.tar.gz
BuildRequires: %{python_module certifi}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-jupyter_notebook >= 4.0
%if %{with test}
BuildRequires: %{python_module jupyter_notebook >= 4.0}
%endif
Requires: python-certifi
Requires: python-jupyter_notebook >= 4.0
%ifpython3
Requires(post): python-jupyter_notebook >= 4.0
Requires(preun): python-jupyter_notebook >= 4.0
%endif
%ifpython2
Requires: python3-jupyter_dashboards = %{version}
%endif
BuildArch: noarch
%python_subpackages
%description
This package adds the following features to Jupyter Notebook:
* Dashboard layout mode for arranging notebook cell outputs in a grid-like fashion
* Dashboard view mode for interacting with an assembled dashboard within the Jupyter Notebook
* Ability to share notebooks with dashboard layout metadata in them with other Jupyter Notebook users
%prep
%setup -q -n jupyter_dashboards-%{version}
for f in .editorconfig .gitattributes .github .gitignore .travis.yml ; do
rm -rf jupyter_dashboards/nbextension/notebook/bower_components/*/$f
rm -rf jupyter_dashboards/nbextension/notebook/bower_components/*/*/$f
done
# rpmlint: wrong-script-end-of-line-encoding
sed -i 's/\r$//' jupyter_dashboards/nbextension/notebook/bower_components/gridstack/Gruntfile.js
# rpmlint: script-without-shebang
chmod a-x jupyter_dashboards/nbextension/notebook/bower_components/gridstack/Gruntfile.js
chmod a-x jupyter_dashboards/nbextension/notebook/bower_components/gridstack/dist/gridstack.js
chmod a-x jupyter_dashboards/nbextension/notebook/bower_components/gridstack/package.json
chmod a-x jupyter_dashboards/nbextension/notebook/bower_components/jquery-ui/ui/.jshintrc
# rpmlint: non-executable-script
sed -i -e '/^#!\//, 1d' jupyter_dashboards/nbextension/notebook/bower_components/lodash/test/remove.js
sed -i -e '/^#!\//, 1d' jupyter_dashboards/nbextension/notebook/bower_components/lodash/test/saucelabs.js
# rpmlint: python-bytecode-wrong-magic-value
rm -rf jupyter_dashboards/__pycache__/
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
PYTHONPATH=%{buildroot}%{python3_sitelib} jupyter nbextension install --nbextensions=%{buildroot}%{_datadir}/jupyter/nbextensions/ --py jupyter_dashboards
%python_expand %fdupes %{buildroot}%{_datadir}/jupyter/nbextensions/
%post -n python3-jupyter_dashboards
jupyter nbextension enable --system --py jupyter_dashboards || true
%preun -n python3-jupyter_dashboards
if [ $1 = 0 ] && [ -d %{python3_sitelib}/jupyter_dashboards/ ] ; then
jupyter nbextension disable --system --py jupyter_dashboards || true
fi
%if %{with test}
%check
%python_exec setup.py test
%endif
%files %{python_files}
%defattr(-,root,root,-)
%license LICENSE.md
%python3_only %{_bindir}/jupyter-dashboards
%{python_sitelib}/jupyter_dashboards/
%{python_sitelib}/jupyter_dashboards-%{version}-py*.egg-info
%python3_only %{_datadir}/jupyter/nbextensions/jupyter_dashboards/
%changelog