Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs don't build with Sphinx 5.2.0 #1017

Closed
StefRe opened this issue Sep 24, 2022 · 4 comments · Fixed by #1019
Closed

Docs don't build with Sphinx 5.2.0 #1017

StefRe opened this issue Sep 24, 2022 · 4 comments · Fixed by #1019

Comments

@StefRe
Copy link
Contributor

StefRe commented Sep 24, 2022

CI uses sphinx 5.2.0 since this afternoon (sphinx-doc/sphinx#10853 (comment)). This throws the following error (local build of current master with -vvv):

reading sources... [ 86%] reference
[app] emitting event: 'env-purge-doc'(<sphinx.environment.BuildEnvironment object at 0x7f793f47a1d0>, 'reference')
[app] emitting event: 'source-read'('reference', ['\n.. _sphx_glr_api_reference:\n\nSphinx-Gallery API Reference\n=====================
[autodoc] /home/steffen/Dev/sphinx-gallery/doc/reference.rst:12: input:
.. automodule:: sphinx_gallery
   :no-members:
   :no-inherited-members:

[autodoc] import sphinx_gallery
[autodoc] import sphinx_gallery => <module 'sphinx_gallery' from '/home/steffen/Dev/sphinx-gallery/sphinx_gallery/__init__.py'>
[app] emitting event: 'autodoc-process-signature'('module', 'sphinx_gallery', <module 'sphinx_gallery' from '/home/steffen/Dev/sphinx-gallery/sphinx_
[app] emitting event: 'autodoc-process-docstring'('module', 'sphinx_gallery', <module 'sphinx_gallery' from '/home/steffen/Dev/sphinx-gallery/sphinx_
[autodoc] output:

.. py:module:: sphinx_gallery

   Sphinx Gallery
   ==============

[autodoc] import sphinx_gallery.gen_gallery
[autodoc] import sphinx_gallery.gen_gallery => <module 'sphinx_gallery.gen_gallery' from '/home/steffen/Dev/sphinx-gallery/sphinx_gallery/gen_gallery.py'>
[app] emitting event: 'autodoc-process-signature'('module', 'sphinx_gallery.gen_gallery', <module 'sphinx_gallery.gen_gallery' from '/home/steffen/De
[app] emitting event: 'autodoc-process-docstring'('module', 'sphinx_gallery.gen_gallery', <module 'sphinx_gallery.gen_gallery' from '/home/steffen/De
:2: (SEVERE/4) Unexpected section title.

Sphinx-Gallery Generator
========================
[app] emitting event: 'build-finished'(SystemMessage(':2: (SEVERE/4) Unexpected section title.\n\nSphinx-Gallery Generator\n==============

Traceback (most recent call last):
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/cmd/build.py", line 279, in build_main
    app.build(args.force_all, filenames)
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/application.py", line 350, in build
    self.builder.build_update()
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 302, in build_update
    self.build(to_build,
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 318, in build
    updated_docnames = set(self.read())
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 425, in read
    self._read_serial(docnames)
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 446, in _read_serial
    self.read_doc(docname)
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 502, in read_doc
    publisher.publish()
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/core.py", line 217, in publish
    self.document = self.reader.read(self.source, self.parser,
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/io.py", line 104, in read
    self.parse()
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/readers/__init__.py", line 78, in parse
    self.parser.parse(self.input, document)
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/parsers.py", line 78, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 170, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/statemachine.py", line 239, in run
    context, next_state, result = self.check_line(
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/statemachine.py", line 451, in check_line
    return method(match, context, next_state)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/statemachine.py", line 239, in run
    context, next_state, result = self.check_line(
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/statemachine.py", line 451, in check_line
    return method(match, context, next_state)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 2342, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 2354, in explicit_construct
    return method(self, expmatch)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 2096, in directive
    return self.run_directive(
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 2146, in run_directive
    result = directive_instance.run()
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/ext/autosummary/__init__.py", line 232, in run
    items = self.get_items(names)
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/ext/autosummary/__init__.py", line 375, in get_items
    summary = extract_summary(self.bridge.result.data[:], self.state.document)
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/ext/autosummary/__init__.py", line 538, in extract_summary
    node = parse(doc, document.settings)
  File "/home/steffen/.local/lib/python3.10/site-packages/sphinx/ext/autosummary/__init__.py", line 518, in parse
    state_machine.run(doc, node)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 170, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/statemachine.py", line 239, in run
    context, next_state, result = self.check_line(
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/statemachine.py", line 451, in check_line
    return method(match, context, next_state)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 1165, in indent
    elements = self.block_quote(indented, line_offset)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 1180, in block_quote
    self.nested_parse(blockquote_lines, line_offset, blockquote)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/statemachine.py", line 239, in run
    context, next_state, result = self.check_line(
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/statemachine.py", line 451, in check_line
    return method(match, context, next_state)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/parsers/rst/states.py", line 2761, in underline
    msg = self.reporter.severe('Unexpected section title.',
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/utils/__init__.py", line 239, in severe
    return self.system_message(self.SEVERE_LEVEL, *args, **kwargs)
  File "/home/steffen/.local/lib/python3.10/site-packages/docutils/utils/__init__.py", line 197, in system_message
    raise SystemMessage(msg, level)
docutils.utils.SystemMessage: :2: (SEVERE/4) Unexpected section title.

Sphinx-Gallery Generator
========================

reST markup error:
:2: (SEVERE/4) Unexpected section title.

Sphinx-Gallery Generator
========================
make: *** [Makefile:77: html] Fehler 2
@AA-Turner
Copy link

Are you able to provide a consistently failing minimal example? If a regression in Sphinx 5.2 I'd like to fix it sooner rather than later.

A

@StefRe
Copy link
Contributor Author

StefRe commented Sep 25, 2022

@AA-Turner I stripped down the sphinx-gallery documentation to a minimal example demonstrating the error, see https://github.com/StefRe/sphinx520.

It builds with sphinx 5.1.1:
image

and fails with sphinx 5.2.0:

Sphinx v5.2.0 in Verwendung
making output directory... erledigt
[autosummary] generating autosummary for: index.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
:2: (SEVERE/4) Unexpected section title.                                                                                                     

The Module
==========

reST markup error:
:2: (SEVERE/4) Unexpected section title.

The Module
==========
make: *** [Makefile:20: html] Fehler 2

@AA-Turner
Copy link

Sphinx 5.2.1 has been released with a fix, please let me know if your builds still fail.

A

@StefRe
Copy link
Contributor Author

StefRe commented Sep 26, 2022

Sphinx 5.2.1 has been released with a fix, please let me know if your builds still fail.

Perfect - 5.2.1 fixes the issue. Thanks for the very prompt response @AA-Turner!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants