# Building the documentation requires packages not available from Fedora: # altair, coconut, sphinx-book-theme %bcond doc 0 # python-jupytext cannot be built for s390x at present # python-nbdime can only be built for x86_64 and aarch64 at present %ifarch x86_64 aarch64 %bcond test 1 %else %bcond test 0 %endif %global giturl https://github.com/executablebooks/MyST-NB Name: python-myst-nb Version: 1.1.1 Release: %autorelease Summary: Jupyter Notebook Sphinx reader License: BSD-3-Clause BuildArch: noarch URL: https://myst-nb.readthedocs.io/ VCS: git:%{giturl}.git Source: %{giturl}/archive/v%{version}/myst-nb-%{version}.tar.gz BuildRequires: help2man BuildRequires: python3-devel %if %{with doc} BuildRequires: make %endif %global _desc %{expand: MyST is a rich and extensible flavor of Markdown meant for technical documentation and publishing. It is designed for simplicity, flexibility, and extensibility. This package contains a reference implementation of MyST Markdown, as well as a collection of tools to support working with MyST in Python and Sphinx. It contains an extended CommonMark-compliant parser using markdown-it-py, as well as a Sphinx extension that allows you to write MyST Markdown in Sphinx.} %description %_desc %package -n python3-myst-nb Summary: %{summary} %description -n python3-myst-nb %_desc %if %{with doc} %package doc Summary: Documentation for %{name} %description doc Documentation for %{name}. %endif %prep %autosetup -n MyST-NB-%{version} # Permit newer versions of ipython, jupytext, matplotlib, and pandas for # testing only. The newer version of matplotlib causes some changes in test # output; pyproject.toml says: # Matplotlib outputs are sensitive to the matplotlib version sed -i 's/,<8\.17//;s/,<1\.16\.0//;s/==[*.[:digit:]]*//' pyproject.toml sed -e 's/9bc81205a14646a235d284d1b68223d17f30f7f1d3d8ed3e52cf47830b02e3bb/fd9ed1ea43d887584ea600fa27ca630752bf6f02d767def5675bcd5114ad03ba/g' \ -e 's/a2e637020dfe58f670ba2c942d7a55e49ba48bed09312569ee15a84f5ac680cb/d4af8d3724871916ca3dad388b7031ac3493074b53430101d6cea5d7c3924be9/g' \ -i tests/test_execute/test_complex_outputs_unrun_{auto,cache}.xml \ tests/test_execute/test_custom_convert_{auto,cache}.xml %generate_buildrequires %pyproject_buildrequires %{?with_doc:-x rtd}%{?with_test:-x testing} %build %pyproject_wheel %if %{with doc} # Build the documentation PYTHONPATH=$PWD make -C docs html rm docs/_build/html/.buildinfo %endif %install %pyproject_install %pyproject_save_files myst_nb export PYTHONPATH=%{buildroot}%{python3_sitelib} mkdir -p %{buildroot}%{_mandir}/man1 makeman() { help2man -N -n "$2" --version-string='%{version}' %{buildroot}%{_bindir}/$1 \ -o %{buildroot}%{_mandir}/man1/$1.1 } makeman mystnb-docutils-html 'Generate (X)HTML documents from MyST sources' makeman mystnb-docutils-html5 'Generate HTML5 documents from MyST sources' makeman mystnb-docutils-latex 'Generate LaTeX documents from MyST sources' makeman mystnb-docutils-pseudoxml 'Generate pseudo-XML from MyST sources' makeman mystnb-docutils-xml 'Generate docutils-native XML from MyST sources' makeman mystnb-quickstart 'Create a basic MyST-NB project' makeman mystnb-to-jupyter 'Convert a text-based notebook to a Jupyter notebook' %if %{with test} %check %pytest %endif %files -n python3-myst-nb -f %{pyproject_files} %doc CHANGELOG.md README.md %license LICENSE %{_bindir}/mystnb-docutils-html %{_bindir}/mystnb-docutils-html5 %{_bindir}/mystnb-docutils-latex %{_bindir}/mystnb-docutils-pseudoxml %{_bindir}/mystnb-docutils-xml %{_bindir}/mystnb-quickstart %{_bindir}/mystnb-to-jupyter %{_mandir}/man1/mystnb-docutils-html.1* %{_mandir}/man1/mystnb-docutils-html5.1* %{_mandir}/man1/mystnb-docutils-latex.1* %{_mandir}/man1/mystnb-docutils-pseudoxml.1* %{_mandir}/man1/mystnb-docutils-xml.1* %{_mandir}/man1/mystnb-quickstart.1* %{_mandir}/man1/mystnb-to-jupyter.1* %if %{with doc} %files doc %doc doc/_build/html %license LICENSE %endif %changelog %autochangelog