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

Modules not being mocked before calling #70

Open
seanbyrne88 opened this issue Mar 26, 2021 · 1 comment
Open

Modules not being mocked before calling #70

seanbyrne88 opened this issue Mar 26, 2021 · 1 comment

Comments

@seanbyrne88
Copy link

I'm trying to use autoclasstree at the top of a document to show the hierarchy. When I run make html I get an error saying

Mermaid error:
Could not import <my module> (exception: No module named 'pandas')

When I move the diagram to the bottom of the page, after calling automodule to generate references, the build completes successfully and the diagram will render. The references I'm generating refer to the same module i'm trying to build the diagram for, so it looks like pandas is getting mocked at some point, just not before the diagram is rendered.

@seanbyrne88
Copy link
Author

seanbyrne88 commented Mar 26, 2021

was able to reproduce with the following

mermaid_test
-- __init__.py
-- parent.py
-- child.py

parent.py

import pandas

class A:
    pass

child.py

from .parent import A

class B(A):
    pass

rst file

UML
---
.. autoclasstree:: mermaid_test.parent mermaid_test.child
    :namespace:mermaid_test
    :strict:

Error:
Mermaid error:
Could not import mermaid_test.parent (exception: No module named 'pandas')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant