From e946c5f175514da282cd502d7e0f6ea76890f957 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 29 Jun 2025 04:38:44 -0400 Subject: [PATCH] Try to get coveralls working again --- pyproject.toml | 2 +- scripts/save_coverage.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 scripts/save_coverage.py diff --git a/pyproject.toml b/pyproject.toml index baef9da..36641fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,7 +78,7 @@ test-groups = ["dev"] test-command = [ "python -c 'import mwparserfromhell.parser._tokenizer'", "pytest {project}/tests -rxs --cov=mwparserfromhell", - "if [[ $RUNNER_OS == Linux ]]; then mkdir -p /output && mv .coverage /output/.coverage.$(uuidgen); fi" + "python {project}/scripts/save_coverage.py", ] [tool.pyright] diff --git a/scripts/save_coverage.py b/scripts/save_coverage.py new file mode 100755 index 0000000..566c73d --- /dev/null +++ b/scripts/save_coverage.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +import os +import shutil +import traceback +import uuid + +try: + if os.getenv("RUNNER_OS") == "Linux": + os.makedirs("/output", exist_ok=True) + shutil.move(".coverage", f"/output/.coverage.{uuid.uuid4().hex}") +except Exception: + traceback.print_exc()