From db97518b05ba904c4c71068398b74e68f438db51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Sun, 15 Feb 2026 15:57:41 +0100 Subject: [PATCH 1/2] improve report coverage --- .coveragerc | 5 +++++ codecov.yml | 3 --- onnx_diagnostic/ci_models/export_qwen25_vl.py | 2 +- onnx_diagnostic/helpers/cache_helper.py | 2 +- .../torch_export_patches/onnx_export_serialization.py | 4 ++-- .../patches/_patch_transformers_idefics.py | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..1069caef --- /dev/null +++ b/.coveragerc @@ -0,0 +1,5 @@ +[report] +exclude_lines = + pragma: no cover + if __name__ == .__main__.: + @onnxscript.* diff --git a/codecov.yml b/codecov.yml index 15eff562..e69de29b 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +0,0 @@ -ignore: - - "*onnx_diagnostic/big_models/*" - - "*onnx_diagnostic/ci_models/export*" diff --git a/onnx_diagnostic/ci_models/export_qwen25_vl.py b/onnx_diagnostic/ci_models/export_qwen25_vl.py index 42a022bf..9279f57d 100644 --- a/onnx_diagnostic/ci_models/export_qwen25_vl.py +++ b/onnx_diagnostic/ci_models/export_qwen25_vl.py @@ -460,7 +460,7 @@ def process_image(inputs_embeds, image_features): import onnxscript v_onnxscript = onnxscript.__version__ - if pv.Version(v_onnxscript) <= pv.Version("0.5.6"): + if pv.Version(v_onnxscript) <= pv.Version("0.5.6"): # pragma: no cover print(f"-- onnxscript=={v_onnxscript} not recent enough") print("-- stop.") return diff --git a/onnx_diagnostic/helpers/cache_helper.py b/onnx_diagnostic/helpers/cache_helper.py index 303ebb48..7f1cd81b 100644 --- a/onnx_diagnostic/helpers/cache_helper.py +++ b/onnx_diagnostic/helpers/cache_helper.py @@ -355,7 +355,7 @@ def make_dynamic_cache( ) return finalize_cache(cache) -else: +else: # pragma: no cover def make_dynamic_cache( key_value_pairs: Union[List[torch.Tensor], List[Tuple[torch.Tensor, torch.Tensor]]], diff --git a/onnx_diagnostic/torch_export_patches/onnx_export_serialization.py b/onnx_diagnostic/torch_export_patches/onnx_export_serialization.py index cbab26c8..d70b1cc3 100644 --- a/onnx_diagnostic/torch_export_patches/onnx_export_serialization.py +++ b/onnx_diagnostic/torch_export_patches/onnx_export_serialization.py @@ -83,7 +83,7 @@ def register_class_serialization( serialized_type_name=f"{cls.__module__}.{cls.__name__}", flatten_with_keys_fn=f_flatten_with_keys, ) - if pv.Version(torch.__version__) < pv.Version("2.7"): + if pv.Version(torch.__version__) < pv.Version("2.7"): # pragma: no cover if verbose: print( f"[register_class_serialization] " @@ -322,7 +322,7 @@ def unregister_class_serialization(cls: type, verbose: int = 0): import packaging.version as pv if pv.Version(torch.__version__) < pv.Version("2.7.0"): - del torch.utils._pytree.SUPPORTED_NODES[cls] + del torch.utils._pytree.SUPPORTED_NODES[cls] # pragma: no cover assert cls not in torch.utils._pytree.SUPPORTED_NODES, ( f"{cls} was not successful unregistered " f"from torch.utils._pytree.SUPPORTED_NODES=" diff --git a/onnx_diagnostic/torch_export_patches/patches/_patch_transformers_idefics.py b/onnx_diagnostic/torch_export_patches/patches/_patch_transformers_idefics.py index f9735445..3e757150 100644 --- a/onnx_diagnostic/torch_export_patches/patches/_patch_transformers_idefics.py +++ b/onnx_diagnostic/torch_export_patches/patches/_patch_transformers_idefics.py @@ -152,5 +152,5 @@ def forward( attn_weights = None if pv.Version(transformers.__version__) < pv.Version("4.53.99"): - return attn_output, attn_weights, past_key_value + return attn_output, attn_weights, past_key_value # pragma: no cover return attn_output, attn_weights From 758aafc82eb2ef6c74fd10fa5fb30bcefcb4cf05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Sun, 15 Feb 2026 16:05:10 +0100 Subject: [PATCH 2/2] update coveragerc --- .coveragerc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.coveragerc b/.coveragerc index 1069caef..b1e36335 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,3 +3,9 @@ exclude_lines = pragma: no cover if __name__ == .__main__.: @onnxscript.* + +[run] +include = + onnx_diagnostic/* +omit = + onnx_diagnostic/big_models/export_phi4_mm*