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

'ImportFrom' object has no attribute 'getattr' #193

Closed
mazlum opened this issue Apr 6, 2020 · 4 comments
Closed

'ImportFrom' object has no attribute 'getattr' #193

mazlum opened this issue Apr 6, 2020 · 4 comments

Comments

@mazlum
Copy link

mazlum commented Apr 6, 2020

Hi,

I'm getting in the following error when I use "show-inheritance-diagram".

`
/autoapi/inheritance_diagrams.py

target = (target.getattr(path_stack.pop()) or (None,))[0]
AttributeError: 'ImportFrom' object has no attribute 'getattr'
`

@AWhetter
Copy link
Collaborator

Please can I see the code that its parsing? It's not clear to me how target has ended up being an ImportFrom node.

@mazlum
Copy link
Author

mazlum commented Apr 23, 2020

I don't understand. I just installed autoapi and set options like this in the conf.py

autoapi_options = [ "members", "undoc-members", "private-members", "special-members", "show-inheritance", "show-inheritance-diagram", "show-module-summary", "special-members", ]

Then I'm getting this error. Of course I installed Graphviz.

sphnix==3.0.2
sphinx-autoapi==1.3.0

@AWhetter
Copy link
Collaborator

I meant can I see the code that you are trying to generate the documentation for.

@AWhetter
Copy link
Collaborator

I've managed to reproduce this by having a top level package (A) import a submodule (B) and then try to generate a diagram using something in B (eg A.B.c).
So we need to get the directive to follow imports.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Aug 24, 2020
v1.4.0 (2020-06-07)
-------------------

Features
^^^^^^^^
* `#197 <https://github.com/readthedocs/sphinx-autoapi/issues/197>`: Added
  ``autoapi.__version__`` and ``autoapi.__version_info__`` attributes
  for accessing version information.
* `#201 <https://github.com/readthedocs/sphinx-autoapi/issues/201>`: (Python)
  Added the ``autoapi_member_order`` option to allow the order that members
  are documentated to be configurable.
* `#203 <https://github.com/readthedocs/sphinx-autoapi/issues/203>`: (Python)
  A class without a docstring inherits one from its parent.
  A methods without a docstring inherits one from the method that it overrides.
* `#204 <https://github.com/readthedocs/sphinx-autoapi/issues/204>`: (Python)
  Added the ``imported-members`` AutoAPI option to be able to enable or disable
  documenting objects imported from the same top-level package or module
  without needing to override templates.

Bug Fixes
^^^^^^^^^
* `#198 <https://github.com/readthedocs/sphinx-autoapi/issues/198>`:
  Documentation describes the required layout for template override directories.
* `#195 <https://github.com/readthedocs/sphinx-autoapi/issues/195>`: (Python)
  Fixed incorrect formatting when ``show-inheritance-diagram``
  and ``private-members`` are turned on.
* `#193 <https://github.com/readthedocs/sphinx-autoapi/issues/193>` and
* `#208 <https://github.com/readthedocs/sphinx-autoapi/issues/208>`: (Python)
  Inheritance diagrams can follow imports to find classes to document.
* `#213 <https://github.com/readthedocs/sphinx-autoapi/issues/213>`: (Python)
  Fixed module summary never showing.

Trivial/Internal Changes
^^^^^^^^^^^^^^^^^^^^^^^^
* black shows diffs by default
* `#207 <https://github.com/readthedocs/sphinx-autoapi/issues/207>`:
  Fixed a typo in the code of the golang tutorial.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants