File python-jupyter_ipyparallel.spec of Package python-jupyter_ipyparallel
#
# spec file for package python-jupyter_ipyparallel
#
# 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-%{**}}
Name: python-jupyter_ipyparallel
Version: 6.2.3
Release: 0
Summary: Interactive Parallel Computing with IPython
License: BSD-3-Clause
Group: Development/Languages/Python
Url: https://github.com/ipython/ipyparallel
Source: https://files.pythonhosted.org/packages/py2.py3/i/ipyparallel/ipyparallel-%{version}-py2.py3-none-any.whl
Source20: https://media.readthedocs.org/pdf/ipyparallel/%{version}/ipyparallel.pdf
Source21: https://media.readthedocs.org/htmlzip/ipyparallel/%{version}/ipyparallel.zip
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
# Test requirements
BuildRequires: %{python_module decorator}
BuildRequires: %{python_module ipython_genutils}
BuildRequires: %{python_module jupyter_client}
BuildRequires: %{python_module jupyter_ipykernel >= 4.4}
BuildRequires: %{python_module jupyter_ipython >= 4}
BuildRequires: %{python_module jupyter_ipython-iptest >= 4}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module python-dateutil >= 2.1}
BuildRequires: %{python_module pyzmq >= 13}
BuildRequires: %{python_module testpath}
BuildRequires: %{python_module tornado >= 4}
BuildRequires: %{python_module traitlets >= 4.3}
BuildRequires: python-futures
# Python 2 test requirements
Requires: python-decorator
Requires: python-ipython_genutils
Requires: python-jupyter_client
Requires: python-jupyter_ipykernel >= 4.4
Requires: python-jupyter_ipython >= 4
Requires: python-python-dateutil >= 2.1
Requires: python-pyzmq >= 13
Requires: python-tornado >= 4
Requires: python-traitlets >= 4.3
%ifpython2
Requires: python-futures
Requires: python3-jupyter_ipyparallel
%endif
%ifpython3
Requires: python3-jupyter_notebook
%endif
Recommends: python-mpi4py
Recommends: python-pymongo
%ifpython3
Provides: python-jupyter_ipyparallel-nbextension = %{version}
Obsoletes: python-jupyter_ipyparallel-nbextension < %{version}
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%python_subpackages
%description
Use multiple instances of IPython in parallel, interactively.
%package -n %{name}-doc
Summary: Documentation for python-jupyter_ipyparallel
Group: Documentation/Other
Provides: %{python_module jupyter_ipyparallel-doc = %{version}}
%description -n %{name}-doc
Documentation and help files for python-jupyter_ipyparallel.
%prep
%setup -c -T
cp %{SOURCE20} .
%setup -T -D -a 21
mv ipyparallel-%{version} html
rm html/.buildinfo
%build
# Not Needed
%install
%python_expand pip%{$python_bin_suffix} install --root=%{buildroot} %{SOURCE0}
%{fdupes %{buildroot}%{_datadir}/jupyter/ %{buildroot}%{python3_sitelib}}
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
fi
# Prepare for update-alternatives
%python_clone -a %{buildroot}%{_bindir}/ipcluster
%python_clone -a %{buildroot}%{_bindir}/ipcontroller
%python_clone -a %{buildroot}%{_bindir}/ipengine
# These files are meant to be runnable stand-alone, so they should be executable
%{python_expand pushd %{buildroot}%{$python_sitelib}
chmod a+x ipyparallel/apps/*app.py
chmod a-x ipyparallel/apps/baseapp.py
chmod a+x ipyparallel/controller/heartmonitor.py
# Fix wrong-script-interpreter
sed -i "s|#!/usr/bin/env python|#!%__$python|" ipyparallel/apps/*app.py
sed -i "s|#!/usr/bin/env python|#!%__$python|" ipyparallel/controller/heartmonitor.py
# Deduplicating files can generate a RPMLINT warning for pyc mtime
$python -m compileall -d %{$python_sitearch} ipyparallel/apps/
$python -O -m compileall -d %{$python_sitearch} ipyparallel/apps/
$python -m compileall -d %{$python_sitearch} ipyparallel/controller/heartmonitor.py
$python -O -m compileall -d %{$python_sitearch} ipyparallel/controller/heartmonitor.py
%fdupes .
popd
}
cp %{buildroot}%{python_sitelib}/ipyparallel-%{version}.dist-info/LICENSE.txt .
%post
%{python_install_alternative ipcluster ipcontroller ipengine}
%postun
%python_uninstall_alternative ipcluster
%files %{python_files}
%python_alternative %{_bindir}/ipcluster
%python_alternative %{_bindir}/ipcontroller
%python_alternative %{_bindir}/ipengine
%{python_sitelib}/ipyparallel-%{version}.dist-info
%license %{python_sitelib}/ipyparallel-%{version}.dist-info/LICENSE.txt
%{python_sitelib}/ipyparallel/
%python3_only %dir %{_datadir}/jupyter/nbextensions/
%python3_only %dir %{_sysconfdir}/jupyter/jupyter_notebook_config.d
%python3_only %dir %{_sysconfdir}/jupyter/nbconfig/
%python3_only %dir %{_sysconfdir}/jupyter/nbconfig/tree.d
%python3_only %{_datadir}/jupyter/nbextensions/ipyparallel/
%python3_only %config %{_sysconfdir}/jupyter/jupyter_notebook_config.d/ipyparallel-serverextension.json
%python3_only %config %{_sysconfdir}/jupyter/nbconfig/tree.d/ipyparallel-nbextension.json
%files -n %{name}-doc
%license LICENSE.txt
%doc ipyparallel.pdf
%doc html/
%changelog