File python-jupyter_matlab_kernel.spec of Package python-jupyter_matlab_kernel

#
# spec file for package python-jupyter_matlab_kernel
#
# 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_matlab_kernel
Version:        0.15.1
Release:        0
License:        BSD-3-Clause and MIT
Summary:        Matlab kernel for Jupyter
Url:            https://github.com/Calysto/matlab_kernel
Group:          Development/Languages/Python
Source:         https://files.pythonhosted.org/packages/py2.py3/m/matlab_kernel/matlab_kernel-%{version}-py2.py3-none-any.whl
BuildRequires:  %{python_module certifi}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module jupyter_client >= 4.4.0}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  python-backports.tempfile
%if %{with test}
BuildRequires:  %{python_module jupyter_ipython >= 4.0.0}
BuildRequires:  %{python_module jupyter_metakernel >= 0.20.8}
%endif
Suggests:       python-backports.tempfile
Suggests:       python-certifi
Requires:       python-jupyter_client >= 4.4.0
Requires:       python-jupyter_ipython >= 4.0.0
Requires:       python-jupyter_metakernel >= 0.20.8
%ifpython2
Requires:       python3-jupyter_matlab_kernel
Requires:       python-backports.tempfile
%endif
BuildArch:      noarch

%python_subpackages

%description
A Matlab kernel for Jupyter. The Matlab kernel is based on
MetaKernel, which means it features a standard set of magics.

%prep
%setup -c -T

%build
%python_expand pip%{$python_bin_suffix} install --root=%{buildroot} %{SOURCE0}
sed -i "s|\"python\"|\"%{__python3}\"|" %{buildroot}%{_datadir}/jupyter/kernels/matlab/kernel.json

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

%files %{python_files}
%defattr(-,root,root,-)
%{python_sitelib}/matlab_kernel-%{version}.dist-info
%license %{python_sitelib}/matlab_kernel-%{version}.dist-info/LICENSE.txt
%{python_sitelib}/matlab_kernel/
%python3_only %{_datadir}/jupyter/kernels/matlab

%changelog
openSUSE Build Service is sponsored by