question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Builds fail when using MyST and autodoc with `docutils==0.17` installed

See original GitHub issue

With docutils==0.17 (but not earlier), builds fail when using MyST alongside the autodoc extension, invoked via an eval-rst directive.

To reproduce, create this conf.py

import sys
sys.path.insert(0, '.')
extensions = ['myst_parser', 'sphinx.ext.autodoc']

this index.md

```{eval-rst}
.. automodule:: module
```

and this module.py

"""Lorem ipsum."""

Then run sphinx-build . output inside that folder. With docutils==0.16 installed, this renders as expected: A page that just says “Lorem ipsum.”

With docutils==0.17 (released a couple of days ago), I get this error:

Exception occurred:
  File "c:\programs\python\lib\site-packages\docutils\parsers\rst\__init__.py", line 196, in parse
    if len(line) > self.document.settings.line_length_limit:
AttributeError: 'Values' object has no attribute 'line_length_limit'

If I run the same build without the MyST parser, i.e. instead of index.md I have index.rst with .. automodule:: module in it, then things are fine again.

My environment is Sphinx 3.5.3, MyST 0.13.5, Python 3.9.2, Windows 10. But the same error occurs when Read-the-Docs builds my project on its server with sphinx>=2.0.0 required.

A similar issue with docutils==0.17 has been reported for recommonmark in readthedocs/recommonmark#220.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
chrisjsewellcommented, Apr 9, 2021

See #344

0reactions
chrisjsewellcommented, Apr 9, 2021

Hey yeh I have an idea of how to fix this. I’ve been side-tracked, messing around with some other stuff, but should be able to address this in the next day or two 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

FAQ - MyST-Parser - Read the Docs
To include a MyST file within a ReStructuredText file, we can use the parser option of the include directive: ... The parser option...
Read more >
Build errors with docutils 0.18 - Read the Docs Blog
The underlying cause for this error is using an outdated version of Sphinx (version < 3.0) with the latest release of docutils (version...
Read more >
Changelog - Sphinx documentation
Support docutils-0.17. Please notice it changes the output of HTML builder. Some themes do not support it, and you need to update your...
Read more >
MyST-Parser: Auto linking / linkifying references to bug tracker ...
At the time of writing, I'm using Sphinx 4.3.2, MyST-Parser 0.17.2, and docutils 0.17.1 on python 3.10.2. Notes. For the sake of an...
Read more >
1715375 - [wpt-sync] Sync PR 29287 - Update sphinx to 4.0.2
Python 3.7 or above); 8992: autodoc: Failed to resolve types. ... 8870, 9001, 9051: html theme: The style are not applied with docutils-0.17....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found