Notification time stamped 2023-06-30 14:32:48 UTC
From 5d6e64441b3ad85a379319df1bb9cbe8d6c68c53 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley code@musicinmybrain.net Date: Jun 29 2023 19:01:46 +0000 Subject: Build docs as PDF instead of HTML
---
diff --git a/python-stdlib-list.spec b/python-stdlib-list.spec index d29b41f..ca50be4 100644 --- a/python-stdlib-list.spec +++ b/python-stdlib-list.spec @@ -1,3 +1,9 @@ +# Sphinx-generated HTML documentation is not suitable for packaging; see +# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. +# +# We can generate PDF documentation as a substitute. +%bcond doc_pdf 1 + %global desc %{expand: Python Standard Library List -This package includes lists of all of the standard libraries for Python, along with the code for scraping the official @@ -29,8 +35,13 @@ Summary: %{summary} %package doc Summary: Documentation for python-stdlib-list
+%if %{with doc_pdf} +BuildRequires: make +BuildRequires: python3-sphinx-latex +BuildRequires: latexmk # From requirements-dev.txt (which otherwise contains unwanted dependencies): BuildRequires: %{py3_dist sphinx_rtd_theme} +%endif
%description doc %{summary}. @@ -39,14 +50,15 @@ BuildRequires: %{py3_dist sphinx_rtd_theme} %autosetup
%generate_buildrequires -%pyproject_buildrequires -x develop +%pyproject_buildrequires %{?with_doc_pdf:-x develop}
%build %pyproject_wheel -# generate html docs -PYTHONPATH=${PWD} sphinx-build-3 docs html -# remove the sphinx-build leftovers -rm -rf html/.{doctrees,buildinfo} +%if %{with doc_pdf} +PYTHONPATH="${PWD}" %make_build -C docs latex \ + SPHINXOPTS='-j%{?_smp_build_ncpus}' +%make_build -C docs/_build/latex LATEXMKOPTS='-quiet' +%endif
%install %pyproject_install @@ -67,11 +79,14 @@ rm -rf html/.{doctrees,buildinfo}
%files doc %license LICENSE -%doc html +%if %{with doc_pdf} +%doc docs/_build/latex/PythonStandardLibraryList.pdf +%endif
%changelog * Thu Jun 29 2023 Benjamin A. Beasley code@musicinmybrain.net - 0.8.0-9 - Port to pyproject-rpm-macros +- Build docs as PDF instead of HTML
* Thu Jun 15 2023 Python Maint python-maint@redhat.com - 0.8.0-8 - Rebuilt for Python 3.12
https://src.fedoraproject.org/rpms/python-stdlib-list/c/5d6e64441b3ad85a3793...
scm-commits@lists.fedoraproject.org