A new user interface for you! Read more...

File python-jupyter.spec of Package python-jupyter

#
# spec file for package python-jupyter
#
# Copyright (c) 2017 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/
#


# PDF documentation currently broken
%bcond_with pdf

%bcond_without html

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-jupyter
Version:        1.0.0
Release:        0
Summary:        Environment for interactive computing
License:        BSD-3-Clause
Group:          Development/Languages/Python
Url:            http://jupyter.org
Source:         https://files.pythonhosted.org/packages/source/j/jupyter/jupyter-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module jupyter_console}
BuildRequires:  %{python_module jupyter_core}
BuildRequires:  %{python_module jupyter_ipykernel}
BuildRequires:  %{python_module jupyter_ipywidgets}
BuildRequires:  %{python_module jupyter_nbconvert}
BuildRequires:  %{python_module jupyter_notebook}
BuildRequires:  %{python_module jupyter_qtconsole}
# Documentation requirements
%if %{with pdf} || %{with html}
BuildRequires:  python3-Sphinx
%endif
%if %{with pdf}
BuildRequires:  python3-Sphinx-latex
%endif
Requires:       python-jupyter_core
Recommends:     python-jupyter_console
Recommends:     python-jupyter_ipykernel
Recommends:     python-jupyter_ipywidgets
Recommends:     python-jupyter_nbconvert
Recommends:     python-jupyter_notebook
Recommends:     python-jupyter_qtconsole
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%python_subpackages

%description
Jupyter is an environment for interactive computing in multiple languages.
It includes a console, a browser-based notebook format, and support for
dozens of languages through the use of language-specific kernels.

Jupyter is an evolution and modularization of the IPython project, separating
out the python3-specific parts from the language-agnostic parts.

This package pulls in the main Jupyter system, including the notebook,
qtconsole, and the IPython kernel.  Additional components and kernels
can be installed separately.

%package -n %{name}-doc
Summary:        HTML documentation for %{name}
Group:          Development/Languages/Python
Provides:       %{name}-doc-pdf = %{version}
Provides:       %{name}-doc-html = %{version}
Provides:       %{python_module %{name}-doc = %{version}}
Provides:       %{python_module %{name}-doc-pdf = %{version}}
Provides:       %{python_module %{name}-doc-html = %{version}}
# Change from <= to < when (and if) there is a next release after 1.0.0
Obsoletes:      %{name}-doc-pdf <= %{version}
Obsoletes:      %{name}-doc-html <= %{version}
Obsoletes:      %{python_module %{name}-doc-pdf <= %{version}}
Obsoletes:      %{python_module %{name}-doc-html <= %{version}}

%description -n %{name}-doc
Documentation and help files for %{name}.

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

%build
%python_build

# Build the documentation
pushd docs
export JUPYTER_PATH='%{jupyter_path}'
export PYTHONPATH=%{buildroot}%{python_sitelib}
%if %{with pdf}
make latexpdf
%endif
%if %{with html}
make html
%endif
rm -rf build/html/.buildinfo
popd

%install
%python_install

# This is provided by jupyter_core now
%python_expand rm -f %{buildroot}%{$python_sitelib}/jupyter.py*
%python_expand rm -rf %{buildroot}%{$python_sitelib}/__pycache__/

# Install documentation
mkdir -p %{buildroot}%{_docdir}/%{name}

%if %{with pdf}
cp docs/build/latex/*.pdf %{buildroot}%{_docdir}/%{name}/
%endif

%if %{with html}
cp -r docs/build/html %{buildroot}%{_docdir}/%{name}/
%endif

%fdupes %{buildroot}%{_docdir}/%{name}/

%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE README.md
%{python_sitelib}/jupyter-%{version}-py*.egg-info
%if %{with html}
%exclude %{_docdir}/%{name}/html/
%endif
%if %{with pdf}
%exclude %{_docdir}/%{name}/*.pdf
%endif

%files -n %{name}-doc
%defattr(-,root,root,-)
%doc LICENSE README.md
%dir %{_docdir}/%{name}/
%if %{with html}
%{_docdir}/%{name}/html/
%endif
%if %{with pdf}
%{_docdir}/%{name}/*.pdf
%endif

%changelog