pyiron / pyiron_workflow

Graph-and-node based workflows
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

[patch] Update graphviz #267

Closed liamhuber closed 3 months ago

liamhuber commented 3 months ago

Not python-graphviz, but the non-python one on conda-forge

github-actions[bot] commented 3 months ago

Binder :point_left: Launch a binder notebook on branch _pyiron/pyiron_workflow/update_underlyinggraphviz

codacy-production[bot] commented 3 months ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: -0.02% (target: -1.00%) :white_check_mark: 66.67%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (c616bdceaf599f685236a89e5a5d2565a89deaea) | 3390 | 2971 | 87.64% | | | Head commit (044838eefa00aadf1cbd2dbdf469306d4c9a223b) | 3393 (+3) | 2973 (+2) | 87.62% (**-0.02%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#267) | 3 | 2 | **66.67%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 8459218494

Details


Files with Coverage Reduction New Missed Lines %
node.py 8 93.49%
<!-- Total: 8 -->
Totals Coverage Status
Change from base Build 8404068076: -0.009%
Covered Lines: 6348
Relevant Lines: 6912

💛 - Coveralls
liamhuber commented 3 months ago

No, I'm still getting the following error on Windows:

======================================================================
ERROR: test_draw (test_node.TestNode.test_draw)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Miniconda3\envs\my-env\Lib\site-packages\graphviz\backend\execute.py", line 88, in run_check
    proc.check_returncode()
  File "C:\Miniconda3\envs\my-env\Lib\subprocess.py", line 502, in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '[WindowsPath('dot'), '-Kdot', '-Tpdf', '-O', 'start_graph']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\a\pyiron_workflow\pyiron_workflow\tests\unit\test_node.py", line 322, in test_draw
    self.n1.draw(save=True, format=fmt)
  File "D:\a\pyiron_workflow\pyiron_workflow\pyiron_workflow\node.py", line 655, in draw
    graph.render(
  File "C:\Miniconda3\envs\my-env\Lib\site-packages\graphviz\_tools.py", line 171, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Miniconda3\envs\my-env\Lib\site-packages\graphviz\rendering.py", line 122, in render
    rendered = self._render(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Miniconda3\envs\my-env\Lib\site-packages\graphviz\_tools.py", line 171, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Miniconda3\envs\my-env\Lib\site-packages\graphviz\backend\rendering.py", line 326, in render
    execute.run_check(cmd,
  File "C:\Miniconda3\envs\my-env\Lib\site-packages\graphviz\backend\execute.py", line 90, in run_check
    raise CalledProcessError(*e.args)
graphviz.backend.execute.CalledProcessError: Command '[WindowsPath('dot'), '-Kdot', '-Tpdf', '-O', 'start_graph']' returned non-zero exit status 1. [stderr: b'Warning: Could not load "C:\\Miniconda3\\envs\\my-env\\Library\\bin\\gvplugin_pango.dll" - It was found, so perhaps one of its dependents was not.  Try ldd.\r\nWarning: Could not load "C:\\Miniconda3\\envs\\my-env\\Library\\bin\\gvplugin_pango.dll" - It was found, so perhaps one of its dependents was not.  Try ldd.\r\nFormat: "pdf" not recognized. Use one of: bmp canon cmap cmapx cmapx_np dot dot_json emf emfplus eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg json json0 metafile mp pdf pic plain plain-ext png pov ps ps2 svg tif tiff tk webp xdot xdot1.2 xdot1.4 xdot_json\r\n']

I'm going to try downgrading python-graphviz back to the last known version to work -- 0.20.1, two patches back.

liamhuber commented 3 months ago

~That worked. I'm going to try bumping to the intermediate 0.20.2.~

Nevermind, it failed not worked.

liamhuber commented 3 months ago

Since both the new and old python-graphviz failed with the old graphviz and new python-graphviz also fails with new graphviz, my conclusion is that this is some upstream dependency nonsense that is not in my power to fix.

The known problem I'm actively running into is when you combine Windows + PDF format for the graph render. I added a warning to the Node.draw call, and left an assertRaises in the tests -- if that assertRaises ever starts working again, the test will fail and we can come it and remove the warning and extra testing.