python-nbconvert/python-nbconvert.spec
Benjamin Greiner 8f458d9041 - Update to version 7.0.0
* Update to Mistune 2.0.2 by @TiagodePAlves in #1764
  * Clean up markdown parsing by @blink1073 in #1774
  * Switch to hatch build backend by @blink1073 in #1777
  * switch from entrypoints to importlib-metadata by @konstin in
    #1782
  * Add recursive flag for glob notebook search by @paoloalba in
    #1785
  * Updates for sphinx 5.0 support by @blink1073 in #1788
  * Fixed unique div ids in lab template, fixed #1759 by @veghdev
    in #1761
  * WebPDFExporter: Emulate media print by @martinRenou in #1791
  * Fix fonts overriden by user stylesheet by inheriting styles by
    @dakoop in #1793
  * Fix lab template output alignment by @dakoop in #1795
  * Add qtpdf and qtpng exporters by @davidbrochart in #1611
  * Fix linters by @martinRenou in #1825
  * Remove downloaded CSS from repository by @martinRenou in #1827
  * escape_html: prevent escaping quotes on widgets JSON reprs
    (#1829) by @martinRenou in #1830
  * Remove tests from bdist by @TiagodePAlves in #1822
  * Encode SVG image data as UTF-8 before calling lxml cleaner
    (fixes #1836) by @emarsden in #1837
  * Handle nbformat 5.5 by @blink1073 in #1841
- Drop nbconvert-vendorize-mistune.patch and mistune 0.8.4 sources.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-nbconvert?expand=0&rev=42
2022-09-26 00:28:09 +00:00

200 lines
6.2 KiB
RPMSpec

#
# spec file
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
Name: python-nbconvert%{psuffix}
Version: 7.0.0
Release: 0
Summary: Conversion of Jupyter Notebooks
License: BSD-3-Clause AND MIT
URL: https://github.com/jupyter/nbconvert
Source0: https://files.pythonhosted.org/packages/source/n/nbconvert/nbconvert-%{version}.tar.gz
# See hatch_build.py
# License10: MIT
Source10: https://cdn.jupyter.org/notebook/5.4.0/style/style.min.css
# PATCH-FIX-OPENSUSE ignore-bleach-deprecation-test.patch -- ignore warning that we don't have bleach5 yet
Patch0: ignore-bleach-deprecation-test.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module hatchling >= 0.25}
BuildRequires: %{python_module pip}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
Requires: jupyter-nbconvert = %{version}
Requires: python-Jinja2 >= 3.0
Requires: python-MarkupSafe >= 2.0
Requires: python-Pygments >= 2.4.1
Requires: python-beautifulsoup4
Requires: python-bleach
Requires: python-defusedxml
Requires: python-jupyter-core >= 4.7
Requires: python-jupyterlab-pygments
Requires: python-lxml
Requires: python-nbclient >= 0.5
Requires: python-nbformat >= 5.1
Requires: python-packaging
Requires: python-pandocfilters >= 1.4.1
Requires: python-tinycss2
Requires: python-traitlets >= 5.0
Requires: (python-mistune >= 2.0.3 with python-mistune < 3)
%if 0%{python_version_nodots} < 310
Requires: python-importlib-metadata >= 3.6
%endif
Recommends: pandoc
Recommends: python-tornado >= 6.1
Suggests: %{name}-latex
Suggests: python-qtwebengine-qt5 >= 5.15
Provides: python-jupyter_nbconvert = %{version}
Obsoletes: python-jupyter_nbconvert < %{version}
BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun):update-alternatives
%endif
%if %{with test}
BuildRequires: %{python_module ipykernel}
BuildRequires: %{python_module ipywidgets >= 7}
BuildRequires: %{python_module nbconvert = %{version}}
BuildRequires: %{python_module pytest-dependency}
BuildRequires: pandoc
%endif
%python_subpackages
%description
The jupyter nbconvert package converts notebooks to various other formats
via Jinja templates.
This package provides the python interface.
%package -n jupyter-nbconvert
Summary: Conversion of Jupyter Notebooks
Requires: jupyter-ipykernel
Requires: jupyter-jupyter-core
Requires: jupyter-nbformat >= 4.4
Requires: python3-nbconvert = %{version}
Conflicts: python3-jupyter_nbconvert < 5.5.0
%description -n jupyter-nbconvert
The jupyter nbconvert package converts notebooks to various other formats
via Jinja templates.
This package provides the jupyter components.
%package -n jupyter-nbconvert-latex
Summary: LaTeX support for nbconvert
Requires: jupyter-nbconvert = %{version}
Requires: texlive-bibtex
Requires: texlive-makeindex
Requires: tex(adjustbox.sty)
Requires: tex(eurosym.sty)
Requires: tex(ulem.sty)
Provides: %{python_module jupyter_nbconvert-latex = %{version}}
Provides: %{python_module nbconvert-latex = %{version}}
Obsoletes: %{python_module jupyter_nbconvert-latex < %{version}}
%description -n jupyter-nbconvert-latex
The jupyter nbconvert package converts notebooks to various other formats
via Jinja templates.
This package pulls in the LaTeX dependencies for nbconvert.
%prep
%autosetup -p1 -n nbconvert-%{version}
for f in nbconvert/nbconvertapp.py nbconvert/filters/filter_links.py; do
sed -i -e '/^#!\//, 1d' $f
chmod -x $f
done
mkdir share/templates/classic/static
cp %{SOURCE10} share/templates/classic/static/style.css
sed -i '/addopts/ s/--color=yes//' pyproject.toml
%build
%if ! %{with test}
%pyproject_wheel
%endif
%install
%if ! %{with test}
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/jupyter-nbconvert
%python_clone -a %{buildroot}%{_bindir}/jupyter-dejavu
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%fdupes %{buildroot}%{_docdir}/jupyter-nbconvert/
%endif
%if %{with test}
%check
export LANG=en_US.UTF-8
# not test_webpdf: no pyppeteer, not even offline
donttest="test_webpdf"
# requires modules not installed: https://github.com/jupyter/nbconvert/issues/1846
donttest="$donttest or test_convert_full_qualified_name or test_post_processor"
# nbformat error
donttest="$donttest or test_empty_code_cell"
%{python_expand # installed package in :test flavor
$python -B -m ipykernel.kernelspec --user
pytest-%{$python_bin_suffix} -v -m 'not network' -k "not ($donttest)" --pyargs nbconvert
}
%endif
%if !%{with test}
%pre
%python_libalternatives_reset_alternative jupyter-nbconvert
%post
%python_install_alternative jupyter-nbconvert jupyter-dejavu
%postun
%python_uninstall_alternative jupyter-nbconvert
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/nbconvert-%{version}*-info
%{python_sitelib}/nbconvert/
%python_alternative %{_bindir}/jupyter-nbconvert
%python_alternative %{_bindir}/jupyter-dejavu
%files -n jupyter-nbconvert
%license LICENSE
%dir %{_datadir}/jupyter/
%dir %{_datadir}/jupyter/nbconvert
%{_datadir}/jupyter/nbconvert/templates
%files -n jupyter-nbconvert-latex
%license LICENSE
%endif
%changelog