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

Fix #6220, #6225: napoleon: AttributeError is raised for raised section having references #6237

Merged
merged 1 commit into from Apr 4, 2019

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Mar 31, 2019

…sed for raised section having references
@tk0miya tk0miya force-pushed the 6220_napoleon_AttributeError branch from 97c558c to 8e356c3 Compare March 31, 2019 13:25
@codecov
Copy link

codecov bot commented Mar 31, 2019

Codecov Report

Merging #6237 into 2.0.1 will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##            2.0.1    #6237   +/-   ##
=======================================
  Coverage   83.54%   83.54%           
=======================================
  Files         272      272           
  Lines       39354    39354           
  Branches     5868     5868           
=======================================
  Hits        32879    32879           
  Misses       5126     5126           
  Partials     1349     1349
Impacted Files Coverage Δ
tests/test_ext_napoleon_docstring.py 99.51% <ø> (ø) ⬆️
sphinx/ext/napoleon/docstring.py 80.23% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cbefc01...8e356c3. Read the comment docs.

@tk0miya tk0miya merged commit d34302a into sphinx-doc:2.0.1 Apr 4, 2019
@tk0miya tk0miya deleted the 6220_napoleon_AttributeError branch April 4, 2019 14:46
tatianaleon added a commit to digidotcom/xbee-python that referenced this pull request Oct 29, 2020
sphinx-doc/sphinx#6237
sphinx-doc/sphinx@d34302a

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
tatianaleon added a commit to digidotcom/xbee-python that referenced this pull request Oct 30, 2020
sphinx-doc/sphinx#6237
sphinx-doc/sphinx@d34302a

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
tatianaleon added a commit to digidotcom/xbee-python that referenced this pull request Oct 30, 2020
sphinx-doc/sphinx#6237
sphinx-doc/sphinx@d34302a

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
tatianaleon added a commit to digidotcom/xbee-python that referenced this pull request Oct 30, 2020
sphinx-doc/sphinx#6237
sphinx-doc/sphinx@d34302a

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
tatianaleon added a commit to digidotcom/xbee-python that referenced this pull request Oct 30, 2020
Extension 'sphinxcontrib.napoleon' is not working and throwing an exception
while reading the source code files to generate the API documentation (see
below)

This commit removes the installation of that extension and adds
'sphinx.ext.napoleon' to the extensions list in 'doc/conf.py' as documented at
https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html

sphinx-doc/sphinx#6237
sphinx-doc/sphinx@d34302a

Error from https://readthedocs.org/projects/xbplib/builds/11893463/

    [...]
    reading sources... [ 44%] api/digi.xbee.packets.common
    reading sources... [ 46%] api/digi.xbee.packets.devicecloud
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.XBeeDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.Raw802Device.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.DigiMeshDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.DigiPointDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.ZigBeeDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.IPDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.CellularDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.LPWANDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.NBIoTDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.WiFiDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/filesystem.py:docstring of digi.xbee.filesystem.FileSystemManager.read_file:13: WARNING: Unexpected indentation.
    .../digi/xbee/filesystem.py:docstring of digi.xbee.filesystem.FileSystemManager.write_file:17: WARNING: Unexpected indentation.
    .../digi/xbee/filesystem.py:docstring of digi.xbee.filesystem.FileSystemManager.get_file:10: WARNING: Unexpected indentation.
    .../digi/xbee/filesystem.py:docstring of digi.xbee.filesystem.FileSystemManager.put_file:19: WARNING: Unexpected indentation.
    .../digi/xbee/filesystem.py:docstring of digi.xbee.filesystem.FileSystemManager.put_dir:14: WARNING: Unexpected indentation.

    Traceback (most recent call last):
      File ".../lib/python3.7/site-packages/sphinx/cmd/build.py", line 304, in build_main
        app.build(args.force_all, filenames)
      File ".../lib/python3.7/site-packages/sphinx/application.py", line 341, in build
        self.builder.build_update()
      File ".../lib/python3.7/site-packages/sphinx/builders/__init__.py", line 347, in build_update
        len(to_build))
      File ".../lib/python3.7/site-packages/sphinx/builders/__init__.py", line 360, in build
        updated_docnames = set(self.read())
      File ".../lib/python3.7/site-packages/sphinx/builders/__init__.py", line 468, in read
        self._read_serial(docnames)
      File ".../lib/python3.7/site-packages/sphinx/builders/__init__.py", line 490, in _read_serial
        self.read_doc(docname)
      File ".../lib/python3.7/site-packages/sphinx/builders/__init__.py", line 534, in read_doc
        doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
      File ".../lib/python3.7/site-packages/sphinx/io.py", line 318, in read_doc
        pub.publish()
      File ".../lib/python3.7/site-packages/docutils/core.py", line 217, in publish
        self.settings)
      File ".../lib/python3.7/site-packages/docutils/readers/__init__.py", line 72, in read
        self.parse()
      File ".../lib/python3.7/site-packages/docutils/readers/__init__.py", line 78, in parse
        self.parser.parse(self.input, document)
      File ".../lib/python3.7/site-packages/sphinx/parsers.py", line 88, in parse
        self.statemachine.run(inputstring, document, inliner=self.inliner)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 171, in run
        input_source=document['source'])
      File ".../lib/python3.7/site-packages/docutils/statemachine.py", line 239, in run
        context, state, transitions)
      File ".../lib/python3.7/site-packages/docutils/statemachine.py", line 460, in check_line
        return method(match, context, next_state)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2753, in underline
        self.section(title, source, style, lineno - 1, messages)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 327, in section
        self.new_subsection(title, lineno, messages)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
        node=section_node, match_titles=True)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
        node=node, match_titles=match_titles)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 196, in run
        results = StateMachineWS.run(self, input_lines, input_offset)
      File ".../lib/python3.7/site-packages/docutils/statemachine.py", line 239, in run
        context, state, transitions)
      File ".../lib/python3.7/site-packages/docutils/statemachine.py", line 460, in check_line
        return method(match, context, next_state)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2326, in explicit_markup
        nodelist, blank_finish = self.explicit_construct(match)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2338, in explicit_construct
        return method(self, expmatch)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2081, in directive
        directive_class, match, type_name, option_presets)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2130, in run_directive
        result = directive_instance.run()
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/directive.py", line 131, in run
        documenter.generate(more_content=self.content)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 819, in generate
        self.document_members(all_members)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 740, in document_members
        check_module=members_check_module and not isattr)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 1248, in generate
        all_members=all_members)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 819, in generate
        self.document_members(all_members)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 1236, in document_members
        ModuleLevelDocumenter.document_members(self, all_members)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 740, in document_members
        check_module=members_check_module and not isattr)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 816, in generate
        self.add_content(more_content)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 554, in add_content
        for i, line in enumerate(self.process_doc(docstrings)):
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 514, in process_doc
        self.options, docstringlines)
      File ".../lib/python3.7/site-packages/sphinx/application.py", line 510, in emit
        return self.events.emit(event, self, *args)
      File ".../lib/python3.7/site-packages/sphinx/events.py", line 80, in emit
        results.append(callback(*args))
      File ".../lib/python3.7/site-packages/sphinxcontrib/napoleon/__init__.py", line 382, in _process_docstring
        obj, options)
      File ".../lib/python3.7/site-packages/sphinxcontrib/napoleon/docstring.py", line 180, in __init__
        self._parse()
      File ".../lib/python3.7/site-packages/sphinxcontrib/napoleon/docstring.py", line 582, in _parse
        lines = self._sections[section.lower()](section)
      File ".../lib/python3.7/site-packages/sphinxcontrib/napoleon/docstring.py", line 707, in _parse_raises_section
        m = self._name_rgx.match(_type).groupdict()  # type: ignore
    AttributeError: 'NoneType' object has no attribute 'groupdict'

    Exception occurred:
      File ".../lib/python3.7/site-packages/sphinxcontrib/napoleon/docstring.py", line 707, in _parse_raises_section
        m = self._name_rgx.match(_type).groupdict()  # type: ignore
    AttributeError: 'NoneType' object has no attribute 'groupdict'
    The full traceback has been saved in /tmp/sphinx-err-lhkjiv9z.log, if you want to report the issue to the developers.
    Please also report this if it was a user error, so that a better error message can be provided next time.
    A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
tatianaleon added a commit to digidotcom/xbee-python that referenced this pull request Oct 30, 2020
Extension 'sphinxcontrib.napoleon' is not working and throwing an exception
while reading the source code files to generate the API documentation (see
below)

This commit removes the installation of that extension and adds
'sphinx.ext.napoleon' to the extensions list in 'doc/conf.py' as documented at
https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html

sphinx-doc/sphinx#6237
sphinx-doc/sphinx@d34302a

Error from https://readthedocs.org/projects/xbplib/builds/11893463/

    [...]
    reading sources... [ 44%] api/digi.xbee.packets.common
    reading sources... [ 46%] api/digi.xbee.packets.devicecloud
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.XBeeDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.Raw802Device.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.DigiMeshDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.DigiPointDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.ZigBeeDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.IPDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.CellularDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.LPWANDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.NBIoTDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/devices.py:docstring of digi.xbee.devices.WiFiDevice.get_route_to_node:15: WARNING: Unexpected indentation.
    .../digi/xbee/filesystem.py:docstring of digi.xbee.filesystem.FileSystemManager.read_file:13: WARNING: Unexpected indentation.
    .../digi/xbee/filesystem.py:docstring of digi.xbee.filesystem.FileSystemManager.write_file:17: WARNING: Unexpected indentation.
    .../digi/xbee/filesystem.py:docstring of digi.xbee.filesystem.FileSystemManager.get_file:10: WARNING: Unexpected indentation.
    .../digi/xbee/filesystem.py:docstring of digi.xbee.filesystem.FileSystemManager.put_file:19: WARNING: Unexpected indentation.
    .../digi/xbee/filesystem.py:docstring of digi.xbee.filesystem.FileSystemManager.put_dir:14: WARNING: Unexpected indentation.

    Traceback (most recent call last):
      File ".../lib/python3.7/site-packages/sphinx/cmd/build.py", line 304, in build_main
        app.build(args.force_all, filenames)
      File ".../lib/python3.7/site-packages/sphinx/application.py", line 341, in build
        self.builder.build_update()
      File ".../lib/python3.7/site-packages/sphinx/builders/__init__.py", line 347, in build_update
        len(to_build))
      File ".../lib/python3.7/site-packages/sphinx/builders/__init__.py", line 360, in build
        updated_docnames = set(self.read())
      File ".../lib/python3.7/site-packages/sphinx/builders/__init__.py", line 468, in read
        self._read_serial(docnames)
      File ".../lib/python3.7/site-packages/sphinx/builders/__init__.py", line 490, in _read_serial
        self.read_doc(docname)
      File ".../lib/python3.7/site-packages/sphinx/builders/__init__.py", line 534, in read_doc
        doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
      File ".../lib/python3.7/site-packages/sphinx/io.py", line 318, in read_doc
        pub.publish()
      File ".../lib/python3.7/site-packages/docutils/core.py", line 217, in publish
        self.settings)
      File ".../lib/python3.7/site-packages/docutils/readers/__init__.py", line 72, in read
        self.parse()
      File ".../lib/python3.7/site-packages/docutils/readers/__init__.py", line 78, in parse
        self.parser.parse(self.input, document)
      File ".../lib/python3.7/site-packages/sphinx/parsers.py", line 88, in parse
        self.statemachine.run(inputstring, document, inliner=self.inliner)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 171, in run
        input_source=document['source'])
      File ".../lib/python3.7/site-packages/docutils/statemachine.py", line 239, in run
        context, state, transitions)
      File ".../lib/python3.7/site-packages/docutils/statemachine.py", line 460, in check_line
        return method(match, context, next_state)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2753, in underline
        self.section(title, source, style, lineno - 1, messages)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 327, in section
        self.new_subsection(title, lineno, messages)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
        node=section_node, match_titles=True)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
        node=node, match_titles=match_titles)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 196, in run
        results = StateMachineWS.run(self, input_lines, input_offset)
      File ".../lib/python3.7/site-packages/docutils/statemachine.py", line 239, in run
        context, state, transitions)
      File ".../lib/python3.7/site-packages/docutils/statemachine.py", line 460, in check_line
        return method(match, context, next_state)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2326, in explicit_markup
        nodelist, blank_finish = self.explicit_construct(match)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2338, in explicit_construct
        return method(self, expmatch)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2081, in directive
        directive_class, match, type_name, option_presets)
      File ".../lib/python3.7/site-packages/docutils/parsers/rst/states.py", line 2130, in run_directive
        result = directive_instance.run()
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/directive.py", line 131, in run
        documenter.generate(more_content=self.content)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 819, in generate
        self.document_members(all_members)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 740, in document_members
        check_module=members_check_module and not isattr)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 1248, in generate
        all_members=all_members)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 819, in generate
        self.document_members(all_members)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 1236, in document_members
        ModuleLevelDocumenter.document_members(self, all_members)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 740, in document_members
        check_module=members_check_module and not isattr)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 816, in generate
        self.add_content(more_content)
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 554, in add_content
        for i, line in enumerate(self.process_doc(docstrings)):
      File ".../lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 514, in process_doc
        self.options, docstringlines)
      File ".../lib/python3.7/site-packages/sphinx/application.py", line 510, in emit
        return self.events.emit(event, self, *args)
      File ".../lib/python3.7/site-packages/sphinx/events.py", line 80, in emit
        results.append(callback(*args))
      File ".../lib/python3.7/site-packages/sphinxcontrib/napoleon/__init__.py", line 382, in _process_docstring
        obj, options)
      File ".../lib/python3.7/site-packages/sphinxcontrib/napoleon/docstring.py", line 180, in __init__
        self._parse()
      File ".../lib/python3.7/site-packages/sphinxcontrib/napoleon/docstring.py", line 582, in _parse
        lines = self._sections[section.lower()](section)
      File ".../lib/python3.7/site-packages/sphinxcontrib/napoleon/docstring.py", line 707, in _parse_raises_section
        m = self._name_rgx.match(_type).groupdict()  # type: ignore
    AttributeError: 'NoneType' object has no attribute 'groupdict'

    Exception occurred:
      File ".../lib/python3.7/site-packages/sphinxcontrib/napoleon/docstring.py", line 707, in _parse_raises_section
        m = self._name_rgx.match(_type).groupdict()  # type: ignore
    AttributeError: 'NoneType' object has no attribute 'groupdict'
    The full traceback has been saved in /tmp/sphinx-err-lhkjiv9z.log, if you want to report the issue to the developers.
    Please also report this if it was a user error, so that a better error message can be provided next time.
    A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant