jpipe-runner 3.2.0__tar.gz → 3.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/PKG-INFO +2 -2
  2. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/pyproject.toml +2 -2
  3. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/framework/engine.py +34 -40
  4. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/LICENSE +0 -0
  5. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/README.md +0 -0
  6. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/__init__.py +0 -0
  7. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/__main__.py +0 -0
  8. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/enums.py +0 -0
  9. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/exceptions.py +0 -0
  10. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/framework/__init__.py +0 -0
  11. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/framework/context.py +0 -0
  12. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/framework/decorators/__init__.py +0 -0
  13. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/framework/decorators/contribution_decorator.py +0 -0
  14. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/framework/decorators/jpipe_decorator.py +0 -0
  15. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/framework/decorators/skip_decorator.py +0 -0
  16. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/framework/logger.py +0 -0
  17. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/framework/validators.py +0 -0
  18. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/runner.py +0 -0
  19. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/runtime.py +0 -0
  20. {jpipe_runner-3.2.0 → jpipe_runner-3.3.0}/src/jpipe_runner/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jpipe-runner
3
- Version: 3.2.0
3
+ Version: 3.3.0
4
4
  Summary: A Justification Runner designed for jPipe.
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -17,8 +17,8 @@ Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Programming Language :: Python :: 3.14
18
18
  Provides-Extra: docs
19
19
  Provides-Extra: full
20
+ Requires-Dist: graphviz (>=0.20)
20
21
  Requires-Dist: networkx (==3.5)
21
- Requires-Dist: pygraphviz (==1.14)
22
22
  Requires-Dist: pyyaml (==6.0.2)
23
23
  Requires-Dist: sphinx (==8.1.3) ; extra == "docs" or extra == "full"
24
24
  Project-URL: Homepage, https://github.com/jpipe-mcscert/jpipe-runner
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "jpipe-runner"
3
- version = "3.2.0"
3
+ version = "3.3.0"
4
4
  description = "A Justification Runner designed for jPipe."
5
5
  authors = [
6
6
  "Jason Lyu <xjasonlyu@gmail.com>",
@@ -22,7 +22,7 @@ packages = [
22
22
  [tool.poetry.dependencies]
23
23
  python = ">=3.11"
24
24
  networkx = "3.5"
25
- pygraphviz = "1.14"
25
+ graphviz = ">=0.20"
26
26
  pyyaml = "6.0.2"
27
27
 
28
28
  sphinx = { version = "8.1.3", optional = true }
@@ -592,21 +592,24 @@ class PipelineEngine:
592
592
  :param filename: Output filename (without extension).
593
593
  :param format: Image format string (e.g. "png", "svg", "pdf").
594
594
  """
595
- try:
596
- from networkx.drawing.nx_agraph import to_agraph
597
- except ImportError as e:
598
- raise ImportError("pygraphviz is required to enable this feature") from e
595
+ import graphviz as gv
599
596
 
600
597
  resolved_path = self._resolve_output_path(output_path, filename)
601
598
 
602
599
  G = self.graph.copy()
603
- A = to_agraph(G)
604
- A.graph_attr.update(rankdir="BT")
605
-
606
- self._style_nodes(A, G, status_dict)
607
- self._style_edges(A, G, status_dict)
608
-
609
- A.draw(resolved_path.with_suffix(f".{format}"), format=format, prog="dot")
600
+ dot = gv.Digraph()
601
+ dot.attr(rankdir="BT")
602
+
603
+ self._style_nodes(dot, G, status_dict)
604
+ self._style_edges(dot, G, status_dict)
605
+
606
+ dot.render(
607
+ str(resolved_path),
608
+ format=format,
609
+ engine="dot",
610
+ cleanup=True,
611
+ outfile=str(resolved_path.with_suffix(f".{format}")),
612
+ )
610
613
 
611
614
  @staticmethod
612
615
  def _resolve_output_path(output_path: str, filename: str) -> Path:
@@ -623,63 +626,54 @@ class PipelineEngine:
623
626
  return path / filename
624
627
 
625
628
  @staticmethod
626
- def _style_nodes(A: Any, G: nx.DiGraph, status_dict: dict[str, str]) -> None:
629
+ def _style_nodes(dot: Any, G: nx.DiGraph, status_dict: dict[str, str]) -> None:
627
630
  """
628
631
  Apply visual styles to graph nodes based on their type and execution status.
629
632
 
630
- :param A: AGraph (pygraphviz) instance to style.
633
+ :param dot: graphviz.Digraph instance to add nodes to.
631
634
  :param G: NetworkX DiGraph with node attribute data.
632
635
  :param status_dict: Mapping of node id -> status string ("PASS", "FAIL", "SKIP").
633
636
  """
634
637
  node_attr_map = {
635
- "conclusion": dict(fillcolor="lightgrey", shape="rect", style="filled"),
636
- "strategy": dict(fillcolor="palegreen", shape="parallelogram", style="filled"),
637
- "sub-conclusion": dict(color="dodgerblue", shape="rect"),
638
- "evidence": dict(fillcolor="lightskyblue2", shape="rect", style="filled"),
639
- "support": dict(fillcolor="lightcoral", shape="rect", style="filled"),
638
+ "conclusion": {"shape": "rect", "style": "filled,rounded", "fillcolor": "lightgrey"},
639
+ "sub-conclusion": {"shape": "rect", "color": "#0072B2"},
640
+ "strategy": {"shape": "hexagon", "style": "filled", "fillcolor": "#F0C27F"},
641
+ "evidence": {"shape": "note", "style": "filled", "fillcolor": "#9ECAE1"},
642
+ "support": {"shape": "rect", "style": "dotted"},
640
643
  }
641
644
  for node_id, attrs in G.nodes(data=True):
642
645
  var_type = attrs.get("type", "").lower()
643
- style = node_attr_map.get(
646
+ style = dict(node_attr_map.get(
644
647
  var_type, dict(fillcolor="white", shape="ellipse", style="filled")
645
- )
646
- n = A.get_node(node_id)
647
- for k, v in style.items():
648
- n.attr[k] = v
648
+ ))
649
649
 
650
650
  status = status_dict.get(node_id, "UNKNOWN")
651
651
  logging.info("Setting node color for %s with status %s", node_id, status)
652
652
  if status == StatusType.FAIL.name:
653
- n.attr["style"] = "filled"
654
- n.attr["fillcolor"] = "red"
655
- n.attr["fontcolor"] = "white"
656
- n.attr["fontname"] = "Helvetica-Bold"
653
+ style.update(style="filled", fillcolor="red", fontcolor="white", fontname="Helvetica-Bold")
657
654
  elif status == StatusType.SKIP.name:
658
- n.attr["style"] = "filled"
659
- n.attr["fillcolor"] = "#cccccc"
660
- n.attr["opacity"] = "1"
661
- n.attr["fontcolor"] = "white"
662
- n.attr["fontname"] = "Helvetica-Bold"
655
+ style.update(style="filled", fillcolor="#cccccc", opacity="1", fontcolor="white", fontname="Helvetica-Bold")
656
+
657
+ label = attrs.get("label", node_id)
658
+ dot.node(node_id, label=label, **style)
663
659
 
664
660
  @staticmethod
665
- def _style_edges(A: Any, G: nx.DiGraph, status_dict: dict[str, str]) -> None:
661
+ def _style_edges(dot: Any, G: nx.DiGraph, status_dict: dict[str, str]) -> None:
666
662
  """
667
663
  Apply visual styles to graph edges based on the execution status of their source node.
668
664
 
669
- :param A: AGraph (pygraphviz) instance to style.
665
+ :param dot: graphviz.Digraph instance to add edges to.
670
666
  :param G: NetworkX DiGraph with edge data.
671
667
  :param status_dict: Mapping of node id -> status string ("PASS", "FAIL", "SKIP").
672
668
  """
673
669
  for source, target in G.edges():
674
670
  status = status_dict.get(source, "UNKNOWN")
675
671
  logging.info("Setting edge color for %s -> %s with status %s", source, target, status)
676
- e = A.get_edge(source, target)
677
672
  if status == StatusType.PASS.name:
678
- e.attr["color"] = "black"
673
+ dot.edge(source, target, color="black")
679
674
  elif status == StatusType.FAIL.name:
680
- e.attr["color"] = "red"
675
+ dot.edge(source, target, color="red")
681
676
  elif status == StatusType.SKIP.name:
682
- e.attr["color"] = "#cccccc"
683
- e.attr["opacity"] = "1"
677
+ dot.edge(source, target, color="#cccccc", opacity="1")
684
678
  else:
685
- e.attr["color"] = "gray"
679
+ dot.edge(source, target, color="gray")
File without changes
File without changes