From 5596d0e7ac63b4c685cd73a991f0e5266759abe4 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Oct 01 2021 18:34:18 +0000 Subject: Generate PDF instead of HTML Sphinx documentation. See https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. --- diff --git a/python-asyncpg.spec b/python-asyncpg.spec index c809bb4..f4cd943 100644 --- a/python-asyncpg.spec +++ b/python-asyncpg.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 lesser substitute. +%bcond_without doc_pdf + Name: python-asyncpg Summary: A fast PostgreSQL Database Client Library for Python/asyncio Version: 0.24.0 @@ -10,8 +16,12 @@ Source0: %{pypi_source asyncpg} BuildRequires: gcc BuildRequires: python3-devel +%if %{with doc_pdf} BuildRequires: python3-docs BuildRequires: make +BuildRequires: python3-sphinx-latex +BuildRequires: latexmk +%endif # For tests: # @@ -86,6 +96,7 @@ sed -r -i 's/([Ss]phinx.*)~=/\1>=/g' setup.py %set_build_flags %pyproject_wheel +%if %{with doc_pdf} ( # Temporary local installation so we can import the Cython extension module # to build documentation: @@ -97,11 +108,12 @@ sed -r -i 's/([Ss]phinx.*)~=/\1>=/g' setup.py --disable-pip-version-check --no-clean --progress-bar off --verbose \ %{_pyproject_wheeldir}/*.whl - %make_build -C docs html SPHINXBUILD='sphinx-build' SPHINXOPTS='%{?_smp_mflags}' - rm -vf docs/_build/html/.buildinfo docs/_build/html/.nojekyll + %make_build -C docs latex SPHINXBUILD='sphinx-build' SPHINXOPTS='%{?_smp_mflags}' + %make_build -C docs/_build/latex rm -rf "${PYTEMP}" ) +%endif %install @@ -146,7 +158,9 @@ k='not TestFlake8' %files doc %license LICENSE %doc README.rst -%doc docs/_build/html +%if %{with doc_pdf} +%doc docs/_build/latex/asyncpg.pdf +%endif %changelog