File python-jupyter_nbformat-doc.spec of Package python-jupyter_nbformat

# spec file for package python-jupyter_nbformat-doc
# 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

%if 0%{?suse_version} && 0%{?suse_version} != 1315
%bcond_without pdf
%bcond_with pdf

%bcond_without html

%bcond_without tests

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-jupyter_nbformat-doc
Version:        4.4.0
Release:        0
Summary:        Documentation for python-jupyter_nbformat
License:        BSD-3-Clause
Group:          Development/Languages/Python
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module jupyter_nbformat}
%if %{with tests}
# Test Requirements
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module testpath}
# Documentation requirements
%if %{with pdf} || %{with html}
BuildRequires:  python3-Sphinx
BuildRequires:  python3-numpydoc
%if %{with pdf}
BuildRequires:  python3-Sphinx-latex
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Provides:       %{name}-html = %{version}
Provides:       %{name}-pdf = %{version}
Obsoletes:      %{name}-html < %{version}
Obsoletes:      %{name}-pdf < %{version}
Provides:       %{python_module jupyter_nbformat-doc = %{version}}

Documentation and help files for python-jupyter_nbformat.

%setup -q -n nbformat-%{version}

# Build the documentation
pushd docs
%if %{with html}
make html
rm -r _build/html/.buildinfo
%if %{with pdf}
make latexpdf

mkdir -p %{buildroot}%{_docdir}/python-jupyter_nbformat

%if %{with pdf}
cp docs/_build/latex/*.pdf %{buildroot}%{_docdir}/python-jupyter_nbformat/

%if %{with html}
cp -r docs/_build/html %{buildroot}%{_docdir}/python-jupyter_nbformat/

%fdupes %{buildroot}%{_docdir}/python-jupyter_nbformat/

%if %{with tests}
pushd scripts
%python_expand py.test-%{$python_bin_suffix} -k "not TestNotary and not SQLiteSignatureStoreTests" %{$python_sitelib}/nbformat


openSUSE Build Service is sponsored by