Skip to content

Commit

Permalink
Fixed AttributeError using inheritance diagrams on a module with plai…
Browse files Browse the repository at this point in the history
…n imports

Fixes #289
  • Loading branch information
AWhetter committed Jun 27, 2021
1 parent 17ffa2d commit 26b7d72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Breaking Changes
Features
^^^^^^^^

* Added support for using type hints as parameter types and return types
* (Python) Added support for using type hints as parameter types and return types
via the ``sphinx.ext.autodoc.typehints`` extension.
* `#191 <https://github.com/readthedocs/sphinx-autoapi/issues/191>`:
Basic incremental build support is enabled ``autoapi_keep_files`` is enabled.
Expand All @@ -109,16 +109,18 @@ Features
Bug Fixes
^^^^^^^^^

* `#246 <https://github.com/readthedocs/sphinx-autoapi/issues/246>`:
* `#246 <https://github.com/readthedocs/sphinx-autoapi/issues/246>`: (Python)
Fixed TypeError when parsing a class that inherits from ``type``.
* `#244 <https://github.com/readthedocs/sphinx-autoapi/issues/244>`:
Fixed an unnecessary deprecation warning being raised when running
sphinx-build from the same directory as conf.py.
* Fixed properties documented by Autodoc directives geting documented as methods.
* (Python) Fixed properties documented by Autodoc directives geting documented as methods.
* `#293 <https://github.com/readthedocs/sphinx-autoapi/issues/293>`:
Fixed failure to build out of source conf.py files.
Configuration values using relative values are now relative to the source directory
instead of relative to the conf.py file.
* `#289 <https://github.com/readthedocs/sphinx-autoapi/issues/289>`: (Python)
Fixed AttributeError using inheritance diagrams on a module with plain imports.


V1.5.1 (2020-10-01)
Expand All @@ -140,7 +142,7 @@ Features

* `#222 <https://github.com/readthedocs/sphinx-autoapi/issues/222>`:
Declare the extension as parallel unsafe.
* `#217 <https://github.com/readthedocs/sphinx-autoapi/issues/217>`:
* `#217 <https://github.com/readthedocs/sphinx-autoapi/issues/217>`: (Python)
All overload signatures are documented.
* `#243 <https://github.com/readthedocs/sphinx-autoapi/issues/243>`:
Files are found in order of preference according to ``autoapi_file_patterns``.
Expand All @@ -149,9 +151,9 @@ Features
Bug Fixes
^^^^^^^^^

* `#219 <https://github.com/readthedocs/sphinx-autoapi/issues/219>`:
* `#219 <https://github.com/readthedocs/sphinx-autoapi/issues/219>`: (Python)
Fixed return types not showing for methods.
* Fixed incorrect formatting of properties on generated method directives.
* (Python) Fixed incorrect formatting of properties on generated method directives.
* Fixed every toctree entry getting added as a new list.
* `#234 <https://github.com/readthedocs/sphinx-autoapi/issues/234>`:
Fixed only some entries getting added to the toctree.
Expand Down
2 changes: 1 addition & 1 deletion autoapi/inheritance_diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def _do_import_class(name, currmodule=None):
while target and path_stack:
path_part = path_stack.pop()
target = (target.getattr(path_part) or (None,))[0]
while isinstance(target, astroid.ImportFrom):
while isinstance(target, (astroid.ImportFrom, astroid.Import)):
try:
target = target.do_import_module(path_part)
except astroid.AstroidImportError:
Expand Down

0 comments on commit 26b7d72

Please sign in to comment.