File python-jupyter_widgetsnbextension.spec of Package python-jupyter_widgetsnbextension

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

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define         oldpython python
Name:           python-jupyter_widgetsnbextension
Version:        3.2.1
Release:        0
Summary:        IPython HTML widgets for Jupyter
License:        BSD-3-Clause
Group:          Development/Languages/Python
# This package is created from inside the ipywidgets github project at the same time, so use its license.
BuildRequires:  %{python_module certifi}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module jupyter_notebook >= 4.4.1}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-certifi
Requires:       python-jupyter_notebook >= 4.4.1
Requires:       python3-jupyter_widgetsnbextension
Provides:       %{oldpython}-jupyter_widgetsnbextension-nbextension = %{version}
Obsoletes:      %{oldpython}-jupyter_widgetsnbextension-nbextension < %{version}
BuildArch:      noarch

Interactive HTML widgets for Jupyter notebooks.

Requires the corresponding package for your kernel. i.e. Python users
would also install `ipywidgets`. Refer to that package's
documentation for usage instructions.

%setup -c -T
cp %{SOURCE10} .
cp %{SOURCE11} .

# not needed

%python_expand pip%{$python_bin_suffix} install --root=%{buildroot} %{SOURCE0}

if [ "$(dirname %{_prefix}/etc/jupyter)" != "$(dirname %{_sysconfdir}/jupyter)" ]; then
mkdir -p %{buildroot}%{_sysconfdir}
mv %{buildroot}%{_prefix}/etc/jupyter %{buildroot}%{_sysconfdir}/jupyter
rm -d %{buildroot}%{_prefix}/etc

%python_expand %fdupes %{buildroot}%{$python_sitelib}
%{fdupes %{buildroot}%{_datadir}/jupyter/ %{buildroot}%{python3_sitelib}}

%files %{python_files}
%python3_only %{_datadir}/jupyter/nbextensions/jupyter-js-widgets/
%python3_only %config %{_sysconfdir}/jupyter/nbconfig/notebook.d/widgetsnbextension.json

openSUSE Build Service is sponsored by