File python-jupyter_metakernel.spec of Package python-jupyter_metakernel

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


# Tests require an active terminal
%bcond_with     test

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-jupyter_metakernel
Version:        0.20.14
Release:        0
Summary:        Metakernel for Jupyter
License:        BSD-3-Clause
Group:          Development/Languages/Python
Url:            https://github.com/Calysto/metakernel
Source:         https://files.pythonhosted.org/packages/source/m/metakernel/metakernel-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module jupyter_client}
BuildRequires:  %{python_module jupyter_core}
BuildRequires:  %{python_module jupyter_ipykernel}
BuildRequires:  %{python_module jupyter_ipython}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
%if %{with test}
BuildRequires:  %{python_module pexpect >= 4.2}
BuildRequires:  bash
%endif
Requires:       python-jupyter_client
Requires:       python-jupyter_core
Requires:       python-jupyter_ipykernel
Requires:       python-jupyter_ipython
Requires:       python-pexpect >= 4.2
BuildArch:      noarch

%python_subpackages

%description
A Jupyter/IPython kernel template which includes core magic functions
(including help, command and file path completion, parallel and
distributed processing, downloads, and much more).

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

%build
%python_build

%install
%python_install

%{python_expand chmod a+x %{buildroot}%{$python_sitelib}/metakernel/tests/test_expect.py
chmod a+x %{buildroot}%{$python_sitelib}/metakernel/tests/_echo_wait.py
sed -i "s|^#!/usr/bin/env python$|#!%__$python|" %{buildroot}%{$python_sitelib}/metakernel/tests/test_expect.py
sed -i "s|^#!/usr/bin/env python$|#!%__$python|" %{buildroot}%{$python_sitelib}/metakernel/tests/_echo_wait.py
$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/metakernel/tests/
$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/metakernel/tests/
%fdupes %{buildroot}%{$python_sitelib}
}

%if %{with test}
%check
%python_exec setup.py test
%endif

%files %{python_files}
%defattr(-,root,root,-)
%doc CONTRIBUTORS.rst HISTORY.rst README.rst
%license LICENSE.txt
%{python_sitelib}/metakernel/
%{python_sitelib}/metakernel-%{version}-py*.egg-info

%changelog
openSUSE Build Service is sponsored by