File python-jupyter_imatlab_kernel.spec of Package python-jupyter_imatlab_kernel

#
# spec file for package python-jupyter_imatlab_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
%define         skip_python2 1
Name:           python-jupyter_imatlab_kernel
Version:        0.3
%define licver  0.2
Release:        0
License:        MIT
Summary:        Jupyter kernel for MATLAB
Url:            https://github.com/imatlab/imatlab
Group:          Development/Languages/Python
Source0:        https://files.pythonhosted.org/packages/py3/i/imatlab/imatlab-%{version}-py3-none-any.whl
Source10:       https://raw.githubusercontent.com/imatlab/imatlab/v%{licver}/LICENSE.txt
Source11:       https://raw.githubusercontent.com/imatlab/imatlab/v%{licver}/README.rst
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module jupyter_ipython >= 6}
BuildRequires:  %{python_module jupyter_ipykernel >= 4.1}
BuildRequires:  %{python_module jupyter_widgetsnbextension >= 1.0}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module plotly}
BuildRequires:  %{python_module setuptools}
BuildRequires:  unzip
BuildRequires:  fdupes
Requires:       python-jupyter_ipython >= 6
Requires:       python-jupyter_ipykernel >= 4.1
Requires:       python-jupyter_widgetsnbextension >= 1.0
Requires:       python-plotly
BuildArch:      noarch
%ifpython2
Requires:       python3-jupyter_imatlab_kernel
%endif

%python_subpackages

%description
A Jupyter kernel for MATLAB.

This kernel requires Jupyter with Python 3.5+,
and the MATLAB engine for Python (this release
provides a much better completion API), which
needs to be installed first.

%prep
%setup -T -c -n %{name}-%{version}
cp %{SOURCE10} .
cp %{SOURCE11} .

%build
# Make mock MATLAB engine to allow kernel installation.
# See https://github.com/imatlab/imatlab/issues/31
mkdir matlab
echo 'EngineError = MatlabExecutionError = Exception' > matlab/engine.py


%install
# use --no-deps because it looks for MATLAB itself
%python_expand pip%{$python_bin_suffix} install --root %{buildroot} --prefix %{_prefix} --compile --no-deps %{SOURCE0}

PYTHONPATH=%{buildroot}%{python3_sitelib} python3 -m imatlab install --prefix %{buildroot}%{_prefix}

%files %{python_files}
%defattr(-,root,root,-)
%doc README.rst
%license LICENSE.txt
%{python_sitelib}/*
%python3_only %{_datadir}/jupyter/kernels/imatlab/

%changelog
openSUSE Build Service is sponsored by