From 1c3ee725bea13f5125f8527265ce7b8e4ce333a2dcd2aa6718aa66b3e58a41dd Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 5 Dec 2020 17:44:43 +0000 Subject: [PATCH] Accepting request 853197 from home:bnavigator:branches:devel:languages:python - Remove unused mypy from BuildRequires in :test - Fix the intersphinx inventory bundle for multiple python flavors gh#openSUSE/python-rpm-macros#66 - Fix failing graphviz dot calls by including packages for png and pdf formats. The png fail was masked by an incorrect use of a shell command chain. Fails for pdf format were in the tests. - Add sphinx-pr8520-fix-AliasNode-copy.patch to fix failing manpages build -- gh#sphinx-doc/sphinx#8520 OBS-URL: https://build.opensuse.org/request/show/853197 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Sphinx?expand=0&rev=168 --- python-Sphinx.changes | 12 +++++++ python-Sphinx.spec | 25 +++++++++---- python3.inv | 4 +-- sphinx-pr8520-fix-AliasNode-copy.patch | 49 ++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 sphinx-pr8520-fix-AliasNode-copy.patch diff --git a/python-Sphinx.changes b/python-Sphinx.changes index 8f11d96..4432bb8 100644 --- a/python-Sphinx.changes +++ b/python-Sphinx.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Dec 4 17:19:43 UTC 2020 - Benjamin Greiner + +- Remove unused mypy from BuildRequires in :test +- Fix the intersphinx inventory bundle for multiple python flavors + gh#openSUSE/python-rpm-macros#66 +- Fix failing graphviz dot calls by including packages for png + and pdf formats. The png fail was masked by an incorrect use of + a shell command chain. Fails for pdf format were in the tests. +- Add sphinx-pr8520-fix-AliasNode-copy.patch to fix failing + manpages build -- gh#sphinx-doc/sphinx#8520 + ------------------------------------------------------------------- Thu Nov 26 09:18:00 UTC 2020 - Dirk Mueller diff --git a/python-Sphinx.spec b/python-Sphinx.spec index fe5bfd0..15d5ef4 100644 --- a/python-Sphinx.spec +++ b/python-Sphinx.spec @@ -36,8 +36,11 @@ Group: Development/Languages/Python URL: http://sphinx-doc.org Source: https://files.pythonhosted.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz Source1: https://files.pythonhosted.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz.asc -Source2: python3.inv +# Provide intersphinx inventory offline +Source2: https://docs.python.org/3/objects.inv#/python3.inv Source99: python-Sphinx-rpmlintrc +# PATCH-FIX-UPSTREAM gh#sphinx-doc/sphinx#8520 +Patch0: https://github.com/sphinx-doc/sphinx/pull/8520.patch#/sphinx-pr8520-fix-AliasNode-copy.patch BuildRequires: %{python_module base} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -72,12 +75,16 @@ BuildRequires: %{python_module Cython} BuildRequires: %{python_module Sphinx = %{version}} BuildRequires: %{python_module Sphinx-latex = %{version}} BuildRequires: %{python_module html5lib} -BuildRequires: %{python_module mypy} BuildRequires: %{python_module pytest} BuildRequires: %{python_module sphinxcontrib-websupport} BuildRequires: %{python_module testsuite} BuildRequires: %{python_module typed-ast} BuildRequires: ImageMagick +BuildRequires: graphviz +# For PNG format +BuildRequires: graphviz-gd +# For PDF format (!?) +BuildRequires: graphviz-gnome %endif %python_subpackages @@ -227,12 +234,15 @@ sed -i 's/\r$//' sphinx/themes/basic/static/jquery.js # Fix wrong end-of-line en %if %{with test} mkdir build.doc -# get its intersphinx_inventroy from python3-doc -# instead of via network from https://docs.python.org/3/objects.inv cp %{SOURCE2} doc/python3.inv -%python_expand sed -i -e "s/\(intersphinx_mapping = ..python.: (.https:..docs.python.org.3.., \)None\()}\)/\1'%{$python_prefix}.inv'\2/g" doc/conf.py -%python_exec setup.py build_sphinx && rm build/sphinx/html/.buildinfo -%python_exec setup.py build_sphinx -b man +%{python_expand # Use one bundled intersphinx inventory for all flavors. +# The python3.6 inventory fails to build even in its own flavor. +# Use a more recent default (currently 3.9) from the source tag instead. +sed -i -e "s/\(intersphinx_mapping = ..python.: (.https:..docs.python.org.3.., \)None\()\)/\1'python3.inv'\2/g" doc/conf.py +$python setup.py build_sphinx +rm build/sphinx/html/.buildinfo +$python setup.py build_sphinx -b man +} mv build/sphinx/{html,man} build.doc/ %endif @@ -285,6 +295,7 @@ mv build.doc/man/sphinx-quickstart.1 %{buildroot}%{_mandir}/man1/sphinx-quicksta %check %if %{with test} export LC_ALL="C.utf8" +# test_latex_images test downloading a remote image %pytest tests -k 'not (linkcheck or test_latex_images)' %endif diff --git a/python3.inv b/python3.inv index 6c165d9..9b2066a 100644 --- a/python3.inv +++ b/python3.inv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c6feee075722de6b2dfbb1ac6f880901c7c7c97a10212a490c0b3f833dd61eb -size 106787 +oid sha256:84d87706db08de202b66d8fb95cbf27dacd52378050c36e439a270eb5d0c3dc2 +size 109517 diff --git a/sphinx-pr8520-fix-AliasNode-copy.patch b/sphinx-pr8520-fix-AliasNode-copy.patch new file mode 100644 index 0000000..92fcf16 --- /dev/null +++ b/sphinx-pr8520-fix-AliasNode-copy.patch @@ -0,0 +1,49 @@ +From 3c5b05de514289c30130ef98fa796591e1acdb29 Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Fri, 4 Dec 2020 20:27:25 +0100 +Subject: [PATCH 1/2] Fix AliasNode.copy() + +--- + sphinx/domains/c.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py +index d18094217a..206d049f75 100644 +--- a/sphinx/domains/c.py ++++ b/sphinx/domains/c.py +@@ -3452,7 +3452,8 @@ def __init__(self, sig: str, maxdepth: int, document: Any, env: "BuildEnvironmen + self.parentKey = parentKey + + def copy(self: T) -> T: +- return self.__class__(self.sig, env=None, parentKey=self.parentKey) # type: ignore ++ return self.__class__(self.sig, self.maxdepth, self.document, ++ env=None, parentKey=self.parentKey) # type: ignore + + + class AliasTransform(SphinxTransform): + +From a549d8ff2e0371531b8ec8af1d2133812d60b2bb Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Fri, 4 Dec 2020 20:48:02 +0100 +Subject: [PATCH 2/2] Fix mypy type error + +--- + sphinx/domains/c.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py +index 206d049f75..38b81e3fa6 100644 +--- a/sphinx/domains/c.py ++++ b/sphinx/domains/c.py +@@ -3451,9 +3451,9 @@ def __init__(self, sig: str, maxdepth: int, document: Any, env: "BuildEnvironmen + assert parentKey is not None + self.parentKey = parentKey + +- def copy(self: T) -> T: ++ def copy(self) -> 'AliasNode': + return self.__class__(self.sig, self.maxdepth, self.document, +- env=None, parentKey=self.parentKey) # type: ignore ++ env=None, parentKey=self.parentKey) + + + class AliasTransform(SphinxTransform):