Skip to content

Commit 46ffded

Browse files
authored
Fix Workflow.view and add graphviz to the testing environment (#2099)
* Fix workflow.view() * Add graphviz to requirements_test.txt * Install graphviz in test pipelines * Fix skip message in test_workflow_view
1 parent 2bed7d2 commit 46ffded

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

.github/workflows/test_docker.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ jobs:
5151
with:
5252
python-version: ${{ matrix.python-version }}
5353

54+
- name: "Setup Graphviz"
55+
uses: ts-graphviz/setup-graphviz@v2
56+
5457
- name: "Install requirements"
5558
run: pip install -r requirements/requirements_build.txt
5659

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ jobs:
114114
with:
115115
python-version: ${{ matrix.python-version }}
116116

117+
- name: "Setup Graphviz"
118+
uses: ts-graphviz/setup-graphviz@v2
119+
117120
- name: "Update pip to the latest version and install tox"
118121
shell: pwsh
119122
run: |

requirements/requirements_test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ansys-platform-instancemanagement==1.1.2
22
coverage==7.6.11
3+
graphviz==0.20.1
34
imageio==2.36.0
45
imageio-ffmpeg==0.6.0
56
pytest==8.3.4

src/ansys/dpf/core/workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,10 +934,10 @@ def view(
934934

935935
if save_as:
936936
image_path = Path(save_as)
937-
dot_path = image_path.parent / image_path.stem / ".dot"
937+
dot_path = image_path.parent / f"{image_path.stem}.dot"
938938
else:
939939
image_path = Path.cwd() / f"{name}.png"
940-
dot_path = image_path.parent / image_path.stem / ".dot"
940+
dot_path = image_path.parent / f"{image_path.stem}.dot"
941941

942942
# Create graphviz file of workflow
943943
self.to_graphviz(dot_path)

tests/test_workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def remove_files():
6363
request.addfinalizer(remove_files)
6464

6565

66-
@pytest.mark.skipif(not HAS_GRAPHVIZ, reason="Please install pyvista")
66+
@pytest.mark.skipif(not HAS_GRAPHVIZ, reason="Please install graphviz")
6767
def test_workflow_view(server_in_process, remove_dot_file):
6868
pre_wf = dpf.core.Workflow(server=server_in_process)
6969
pre_op = dpf.core.operators.utility.forward(server=server_in_process)

0 commit comments

Comments
 (0)