From b7e0a696a4d9737ff361e209be6c99b7e08d5a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20M=2E=20Thi=C3=A9ry?= Date: Tue, 21 Oct 2014 18:11:37 +0200 Subject: [PATCH 1/2] 17189: upon the first pass of the documentation compilation, warnings don't trigger an exception --- src/doc/common/custom-sphinx-build.py | 6 ++++-- src/doc/en/reference/dynamics/index.rst | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/doc/common/custom-sphinx-build.py b/src/doc/common/custom-sphinx-build.py index a93bec38e13..712694efb4a 100644 --- a/src/doc/common/custom-sphinx-build.py +++ b/src/doc/common/custom-sphinx-build.py @@ -48,7 +48,6 @@ def term_width_line(text): # warnings: regular expressions (or strings) indicating a problem with # docbuilding. Raise an exception if any of these occur. - warnings = (re.compile('Segmentation fault'), re.compile('SEVERE'), re.compile('ERROR'), @@ -56,7 +55,10 @@ def term_width_line(text): re.compile('Exception occurred'), re.compile('Sphinx error')) -if 'latex' not in sys.argv: +# Unless this is the first pass of the compilation (where some cross +# links may not be resolvable yet), or we are compiling the latex +# documentation, we want all warnings to raise an exception. +if 'multidoc_first_pass=1' not in sys.argv and 'latex' not in sys.argv: warnings += (re.compile('WARNING'),) diff --git a/src/doc/en/reference/dynamics/index.rst b/src/doc/en/reference/dynamics/index.rst index 002577d9be5..3ded1bba00b 100644 --- a/src/doc/en/reference/dynamics/index.rst +++ b/src/doc/en/reference/dynamics/index.rst @@ -7,4 +7,8 @@ Discrete dynamics interval_exchanges flat_surfaces +.. SEEALSO:: + + - :ref:`sage.combinat.e_one_star` + .. include:: ../footer.txt From fb43b1946ab3f7e5de66e0bc1eb885c9173ba2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20M=2E=20Thi=C3=A9ry?= Date: Tue, 21 Oct 2014 23:28:10 +0200 Subject: [PATCH 2/2] 17189: referee's suggestions: only undefined warnings don't trigger an exception --- src/doc/common/custom-sphinx-build.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/doc/common/custom-sphinx-build.py b/src/doc/common/custom-sphinx-build.py index 712694efb4a..5f19092b678 100644 --- a/src/doc/common/custom-sphinx-build.py +++ b/src/doc/common/custom-sphinx-build.py @@ -55,11 +55,17 @@ def term_width_line(text): re.compile('Exception occurred'), re.compile('Sphinx error')) -# Unless this is the first pass of the compilation (where some cross -# links may not be resolvable yet), or we are compiling the latex -# documentation, we want all warnings to raise an exception. -if 'multidoc_first_pass=1' not in sys.argv and 'latex' not in sys.argv: - warnings += (re.compile('WARNING'),) +# We want all warnings to actually be errors. +# Exceptions: +# - warnings upon building the LaTeX documentation +# - undefined labels upon the first pass of the compilation: some +# cross links may legitimately not yet be resolvable at this point. +if 'latex' not in sys.argv: + if 'multidoc_first_pass=1' in sys.argv: + # Catch all warnings except 'WARNING: undefined label' + warnings += (re.compile('WARNING: (?!undefined label)'),) + else: + warnings += (re.compile('WARNING:'),) # Do not error out at the first warning, sometimes there is more