diff --git a/b553c23ab1cadfe75db6637ca95daa11abc87049.patch b/b553c23ab1cadfe75db6637ca95daa11abc87049.patch new file mode 100644 index 0000000..c5b39e1 --- /dev/null +++ b/b553c23ab1cadfe75db6637ca95daa11abc87049.patch @@ -0,0 +1,38 @@ +From b553c23ab1cadfe75db6637ca95daa11abc87049 Mon Sep 17 00:00:00 2001 +From: Michel Alexandre Salim +Date: Tue, 3 Jul 2018 09:28:54 -0700 +Subject: [PATCH] Closes #5076: [ext/napoleon] explicitly catch StopIteration + (#5119) + +* Closes #5076: [ext/napoleon] explicitly catch StopIteration + +Per PEP 479, Python 3.7 no longer allows bubbling up StopIteration +outside of a generator. Instead, wrap attribute parsing in a try +block and provide a sane default in case it raises an exception +([]). + +* Fix mypy and flake8 issues +--- + sphinx/ext/napoleon/docstring.py | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py +index b349c761f8..64107d8fb3 100644 +--- a/sphinx/ext/napoleon/docstring.py ++++ b/sphinx/ext/napoleon/docstring.py +@@ -527,7 +527,14 @@ def _parse(self): + self._parsed_lines = self._consume_empty() + + if self._name and (self._what == 'attribute' or self._what == 'data'): +- self._parsed_lines.extend(self._parse_attribute_docstring()) ++ # Implicit stop using StopIteration no longer allowed in ++ # Python 3.7; see PEP 479 ++ res = [] # type: List[unicode] ++ try: ++ res = self._parse_attribute_docstring() ++ except StopIteration: ++ pass ++ self._parsed_lines.extend(res) + return + + while self._line_iter.has_next(): diff --git a/python-sphinx.spec b/python-sphinx.spec index 283eb30..12b8694 100644 --- a/python-sphinx.spec +++ b/python-sphinx.spec @@ -27,7 +27,7 @@ Name: python-sphinx Version: 1.7.5 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 Summary: Python documentation generator @@ -54,6 +54,12 @@ Source6: default-sphinx-command.in # to fetch images, which is not possible in koji or mock. Patch0: xfail-test_latex_remote_images.patch +# Allow extra themes to exist. We pull in python[23]-sphinx-theme-alabaster +# which causes that test to fail. +Patch1: sphinx-test_theming.diff + +Patch2: https://github.com/sphinx-doc/sphinx/commit/b553c23ab1cadfe75db6637ca95daa11abc87049.patch + BuildArch: noarch BuildRequires: python2-devel >= 2.4 BuildRequires: python2-babel @@ -618,6 +624,10 @@ popd %changelog +* Thu Jul 5 2018 Zbigniew Jędrzejewski-Szmek - 1:1.7.5-5 +- Add patch to fix build if alabaster theme is installed +- Add patch for #1589868 + * Mon Jul 02 2018 Miro Hrončok - 1:1.7.5-4 - Enable tests diff --git a/sphinx-test_theming.diff b/sphinx-test_theming.diff new file mode 100644 index 0000000..12b3ac9 --- /dev/null +++ b/sphinx-test_theming.diff @@ -0,0 +1,11 @@ +--- Sphinx-1.7.5/tests/test_theming.py~ 2018-05-28 16:04:20.000000000 +0200 ++++ Sphinx-1.7.5/tests/test_theming.py 2018-07-05 16:24:46.454357525 +0200 +@@ -24,7 +24,7 @@ + cfg = app.config + + # test Theme class API +- assert set(app.html_themes.keys()) == \ ++ assert set(app.html_themes.keys()) >= \ + set(['basic', 'default', 'scrolls', 'agogo', 'sphinxdoc', 'haiku', + 'traditional', 'epub', 'nature', 'pyramid', 'bizstyle', 'classic', 'nonav', + 'test-theme', 'ziptheme', 'staticfiles', 'parent', 'child'])