CrossNox / m2r2

Markdown to reStructuredText converter
https://crossnox.github.io/m2r2
MIT License
107 stars 26 forks source link

Sphinx 3.3.0 Release raises an attribute error #13

Closed mtreinish closed 3 years ago

mtreinish commented 3 years ago

The recent sphinx 3.3.0 release has started failing docs builds. It raises:

Exception occurred:
  File "/home/runner/work/retworkx/retworkx/.tox/docs/lib/python3.8/site-packages/sphinx/registry.py", line 266, in add_source_parser
    for filetype in parser.supported:
AttributeError: 'str' object has no attribute 'supported'

https://github.com/Qiskit/retworkx/pull/166/checks?check_run_id=1342230330#step:7:16

Looking at the debug logging locally the error is coming from m2r2 when trying to add the source parser.

sobolevn commented 3 years ago

The same for me:


Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/wemake-python-styleguide/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 279, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/home/docs/checkouts/readthedocs.org/user_builds/wemake-python-styleguide/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 245, in __init__
    self.setup_extension(extension)
  File "/home/docs/checkouts/readthedocs.org/user_builds/wemake-python-styleguide/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 402, in setup_extension
    self.registry.load_extension(self, extname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/wemake-python-styleguide/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 429, in load_extension
    metadata = setup(app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/wemake-python-styleguide/envs/latest/lib/python3.7/site-packages/m2r2.py", line 664, in setup
    app.add_source_parser(".md", M2RParser)  # for older sphinx versions
  File "/home/docs/checkouts/readthedocs.org/user_builds/wemake-python-styleguide/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 1136, in add_source_parser
    self.registry.add_source_parser(parser, override=override)
  File "/home/docs/checkouts/readthedocs.org/user_builds/wemake-python-styleguide/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 266, in add_source_parser
    for filetype in parser.supported:
AttributeError: 'str' object has no attribute 'supported'
devopsec commented 3 years ago

I can confirm this is still an issue, see attached sphinx log for version info, etc.. sphinx.log

sobolevn commented 3 years ago

@CrossNox any update on this? I don't want to create m2r3 🙂

CrossNox commented 3 years ago

Thanks to @dcaba this should now be fixed. Please check version 0.2.6.

dcaba commented 3 years ago

I confirm this is now working for me. Thanks!!!