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

Sphinx build failing when upgrading to version 5.1.0. #492

Closed
Rocamonde opened this issue Jul 24, 2022 · 4 comments
Closed

Sphinx build failing when upgrading to version 5.1.0. #492

Rocamonde opened this issue Jul 24, 2022 · 4 comments
Labels
bug Something isn't working docs Documentation missing, incorrect or unclear

Comments

@Rocamonde
Copy link
Member

Rocamonde commented Jul 24, 2022

When upgrading sphinx to version 5.1.0 (or simply installing sphinx with no version specification, as is currently the case), I am getting failing builds both locally and remotely. This is a snippet of the traceback:

Running Sphinx v5.1.0
making output directory... done
[autosummary] generating autosummary for: algorithms/airl.rst, algorithms/bc.rst, algorithms/dagger.rst, algorithms/gail.rst, development/contributing/code-of-conduct.rst, development/contributing/index.rst, development/contributing/ways-to-contribute.rst, development/license.rst, development/release-notes.rst, getting-started/faq.rst, getting-started/first-steps.rst, getting-started/installation.rst, getting-started/variable-horizon.rst, getting-started/what-is-imitation.rst, index.rst
[autosummary] generating autosummary for: /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.rst
Matplotlib is building the font cache; this may take a moment.
[autosummary] generating autosummary for: /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.data.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.envs.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.policies.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.rewards.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.testing.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.util.rst
WARNING: [autosummary] failed to import imitation.scripts.parallel.
Possible hints:
* ImportError: 
* AttributeError: module 'imitation.scripts' has no attribute 'parallel'
* ModuleNotFoundError: No module named 'ray'
[autosummary] generating autosummary for: /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.adversarial.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.base.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.bc.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.dagger.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.density.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.mce_irl.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.preference_comparisons.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.data.buffer.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.data.rollout.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.data.types.rst, ..., /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.train_preference_comparisons.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.train_rl.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.testing.envs.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.testing.reward_improvement.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.util.logger.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.util.networks.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.util.registry.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.util.sacred.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.util.util.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.util.video_wrapper.rst
WARNING: [autosummary] failed to import imitation.scripts.config.parallel.
Possible hints:
* ImportError: 
* AttributeError: module 'imitation.scripts.config' has no attribute 'parallel'
* ModuleNotFoundError: No module named 'ray'
[autosummary] generating autosummary for: /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.adversarial.airl.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.adversarial.common.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.algorithms.adversarial.gail.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.envs.examples.model_envs.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.common.common.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.common.demonstrations.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.common.reward.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.common.rl.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.common.train.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.common.wb.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.config.analyze.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.config.eval_policy.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.config.train_adversarial.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.config.train_imitation.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.config.train_preference_comparisons.rst, /home/docs/checkouts/readthedocs.org/user_builds/imitation/checkouts/484/docs/_api/imitation.scripts.config.train_rl.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 15 source files that are out of date
updating environment: [new config] 77 added, 0 changed, 0 removed
reading sources... [  1%] _api/imitation
reading sources... [  2%] _api/imitation.algorithms
reading sources... [  3%] _api/imitation.algorithms.adversarial
reading sources... [  5%] _api/imitation.algorithms.adversarial.airl
reading sources... [  6%] _api/imitation.algorithms.adversarial.common
reading sources... [  7%] _api/imitation.algorithms.adversarial.gail
reading sources... [  9%] _api/imitation.algorithms.base

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/events.py", line 94, in emit
    results.append(listener.handler(self.app, *args))
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/napoleon/__init__.py", line 389, in _process_docstring
    docstring = GoogleDocstring(result_lines, app.config, app, what, name,
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/napoleon/docstring.py", line 214, in __init__
    self._parse()
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/napoleon/docstring.py", line 594, in _parse
    res = self._parse_attribute_docstring()
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/napoleon/docstring.py", line 626, in _parse_attribute_docstring
    _type, _desc = self._consume_inline_attribute()
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/napoleon/docstring.py", line 303, in _consume_inline_attribute
    line = self._lines.popleft()
IndexError: pop from an empty deque

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/cmd/build.py", line 277, in build_main
    app.build(args.force_all, filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/application.py", line 349, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 300, in build_update
    self.build(to_build,
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 316, in build
    updated_docnames = set(self.read())
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 423, in read
    self._read_serial(docnames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 444, in _read_serial
    self.read_doc(docname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 497, in read_doc
    publisher.publish()
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/core.py", line 217, in publish
    self.document = self.reader.read(self.source, self.parser,
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/io.py", line 104, in read
    self.parse()
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/readers/__init__.py", line 78, in parse
    self.parser.parse(self.input, document)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/parsers.py", line 78, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 170, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/statemachine.py", line 239, in run
    context, next_state, result = self.check_line(
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/statemachine.py", line 451, in check_line
    return method(match, context, next_state)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/statemachine.py", line 239, in run
    context, next_state, result = self.check_line(
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/statemachine.py", line 451, in check_line
    return method(match, context, next_state)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2342, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2354, in explicit_construct
    return method(self, expmatch)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2096, in directive
    return self.run_directive(
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2146, in run_directive
    result = directive_instance.run()
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/autodoc/directive.py", line 148, in run
    documenter.generate(more_content=self.content)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 954, in generate
    self.document_members(all_members)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 830, in document_members
    documenter.generate(
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 1788, in generate
    return super().generate(more_content=more_content,
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 954, in generate
    self.document_members(all_members)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 1779, in document_members
    super().document_members(all_members)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 830, in document_members
    documenter.generate(
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 951, in generate
    self.add_content(more_content)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 602, in add_content
    for i, line in enumerate(self.process_doc(docstrings)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py", line 547, in process_doc
    self.env.app.emit('autodoc-process-docstring',
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/application.py", line 460, in emit
    return self.events.emit(event, *args, allowed_exceptions=allowed_exceptions)
  File "/home/docs/checkouts/readthedocs.org/user_builds/imitation/envs/484/lib/python3.8/site-packages/sphinx/events.py", line 105, in emit
    raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <function _process_docstring at 0x7f10843d7790> for event 'autodoc-process-docstring' threw an exception (exception: pop from an empty deque)

Extension error (sphinx.ext.napoleon):
Handler <function _process_docstring at 0x7f10843d7790> for event 'autodoc-process-docstring' threw an exception (exception: pop from an empty deque)

This is most likely an issue with Sphinx, but not sure exactly what is causing it, so hard to raise it to the sphinx team atm.

@Rocamonde Rocamonde added bug Something isn't working docs Documentation missing, incorrect or unclear labels Jul 24, 2022
@Rocamonde
Copy link
Member Author

Rocamonde commented Jul 24, 2022

This is my local traceback out of origin/master:

Running Sphinx v5.1.0
loading pickled environment... done
[autosummary] generating autosummary for: algorithms/airl.rst, algorithms/bc.rst, algorithms/dagger.rst, algorithms/gail.rst, index.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 79 source files that are out of date
updating environment: [extensions changed ('2')] 18 added, 0 changed, 74 removed
reading sources... [ 38%] guide/variable_horizon                                                                                   
Sphinx parallel build error:
sphinx.errors.ExtensionError: Handler <function _process_docstring at 0x105d134c0> for event 'autodoc-process-docstring' threw an exception (exception: pop from an empty deque)
make: *** [html] Error 2

Apparently version 5.1.0. was released a few hours ago. Seems like some bugs were introduced in it, or some functionality is no longer supported and they didn't add proper error messages. Hard to know.

I have currently fixed the version of sphinx to be 5.0.2. in #484, so this should allow the docs to be built once that is merged.

@AdamGleave
Copy link
Member

Ouch. Pinning the version for now seems like the right call. They'll probably make a bugfix release soon.

@AdamGleave
Copy link
Member

Others reporting this error: sphinx-doc/sphinx#10705

@AdamGleave
Copy link
Member

Should be fixed tomorrow: sphinx-doc/sphinx#10710

AdamGleave added a commit that referenced this issue Aug 2, 2022
* setup: Unpin sphinx

* setup: Pin sphinx to version 5.1.1

Co-authored-by: Adam Gleave <adam@gleave.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docs Documentation missing, incorrect or unclear
Projects
None yet
Development

No branches or pull requests

2 participants