hbmartin / graphviz2drawio

Convert graphviz (dot) files into draw.io / lucid (mxGraph) format
http://graphviz2drawio.rtfd.io
GNU General Public License v3.0
164 stars 33 forks source link

Python 3.4 circular imports #8

Closed jcaplan closed 5 years ago

jcaplan commented 5 years ago

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.

hbmartin commented 5 years ago

https://github.com/hbmartin/graphviz2drawio/commit/3408687c0dc68a1f0f0c0a9d839c8c306023f76e

hbmartin commented 5 years ago

@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