hbmartin/graphviz2drawio

Python 3.4 circular imports

Closed this issue · 2 comments

For whatever reason Python 3.4 can't handle the circular import SVG->NodeFactory->SVG

  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/graphviz2drawio/__main__.py", line 2, in <module>
    from .graphviz2drawio import convert
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/graphviz2drawio/graphviz2drawio.py", line 4, in <module>
    from .models import SVG
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/graphviz2drawio/models/SVG.py", line 3, in <module>
    from graphviz2drawio.mx.NodeFactory import NodeFactory
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/graphviz2drawio/mx/NodeFactory.py", line 1, in <module>
    from graphviz2drawio.models import SVG
ImportError: cannot import name 'SVG'

Probably fixable by moving SVG.parse somewhere else and remove the imports of NodeFactory and Edge from SVG module.

@jcaplan just fyi, when you're testing you can use python3 -m graphviz2drawio instead of pip installing, and I'm using black (https://github.com/ambv/black) for formatting