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

graphviz.backend.FORMATS throws AttributeError #149

Closed
xamm opened this issue Nov 15, 2021 · 2 comments
Closed

graphviz.backend.FORMATS throws AttributeError #149

xamm opened this issue Nov 15, 2021 · 2 comments

Comments

@xamm
Copy link

xamm commented Nov 15, 2021

Environment Details

  • graphviz version: 0.18.1
  • Python version: 3.8.12
  • Operating System: macOS

Error Description

When calling graphviz.backend.FORMATS an AttributeError is thrown.
Expected would be a list of available Formats as was the case in previous versions.

e.g.

{
  'cmap', 'ismap', 'gd2', 'eps', 'fig', 'xdot1.4', 'cgimage', 'x11', 'pict', 'gif', 
  'psd', 'vml', 'ps', 'cmapx', 'wbmp', 'ps2', 'svg', 'canon', 'xdot_json', 'pic', 
  'plain', 'gtk', 'bmp', 'svgz', 'ico', 'jpe', 'json0', 'sgi', 'imap', 'xdot1.2', 'tiff', 
  'jp2', 'xdot', 'pct', 'tga', 'gd', 'xlib', 'tk', 'tif', 'dot_json', 'png', 'jpg', 'exr', 
  'imap_np', 'pdf', 'vrml', 'webp', 'dot', 'json', 'plain-ext', 'pov', 'jpeg', 
  'cmapx_np', 'gv', 'vmlz'
}

Steps to reproduce

  • Install the latest graphviz version 0.18.1.
  • Import graphviz
  • call graphviz.backend.FORMATS
Python 3.8.12 (default, Oct 13 2021, 06:42:42)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import graphviz
>>> graphviz.backend.FORMATS
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'graphviz.backend' has no attribute 'FORMATS'
@xflr6 xflr6 changed the title Calling graphviz.backend.FORMATS throws AttributeError graphviz.backend.FORMATS throws AttributeError Nov 15, 2021
@xflr6
Copy link
Owner

xflr6 commented Nov 15, 2021

Thanks. I am afraid this is as documented: Submodules of graphviz are not part of the public API (cf. https://graphviz.readthedocs.io/en/stable/api.html). Please stick to the documented interface and use graphviz.FORMATS, see https://graphviz.readthedocs.io/en/stable/api.html#graphviz.FORMATS).

Just saw that the API now mentions graphviz.backend.DOT_BINARY, let me fix that.

xflr6 added a commit that referenced this issue Nov 15, 2021
@xflr6
Copy link
Owner

xflr6 commented Nov 15, 2021

Fixed unintended API reference to backend in 04f5abd, closing.

@xflr6 xflr6 closed this as completed Nov 15, 2021
katxiao pushed a commit to sdv-dev/SDV that referenced this issue Nov 16, 2021
Issue xflr6/graphviz#149 states:
- this is not the public API
- the underlying submodules should be called directly
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

2 participants