From 91d4e09c20da449a0798e7136d1f2fbf6acf595a Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 9 Dec 2023 22:29:42 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Collect=20Cython=20coverage=20in?= =?UTF-8?q?=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .coveragerc | 21 +++++++++++++++++++++ .github/workflows/ci-cd.yml | 26 ++++++++++++++++++++++++++ MANIFEST.in | 1 + 3 files changed, 48 insertions(+) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..05fd18d2 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,21 @@ +[paths] +source = + frozenlist + */lib/pypy*/site-packages/frozenlist + */lib/python*/site-packages/frozenlist + */Lib/site-packages/frozenlist + +[report] +skip_covered = true +skip_empty = true +show_missing = true + +[run] +branch = true +cover_pylib = false +plugins = Cython.Coverage +relative_files = true +source = + tests +source_pkgs = + frozenlist diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 2ed5628e..c443a5fb 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -276,6 +276,32 @@ jobs: shell: bash - name: Self-install run: python -Im pip install '${{ steps.wheel-file.outputs.path }}' + - name: Produce the C-files for the Coverage.py Cython plugin + if: >- # Only works if the dists were built with line tracing + !matrix.no-extensions + && ( + github.event_name != 'push' + || !contains(github.ref, 'refs/tags/') + ) + env: + PYTHONPATH: packaging/ + run: | + set -eEuo pipefail + + python -Im pip install expandvars + python -m pep517_backend.cli translate-cython + shell: bash + - name: Disable the Cython.Coverage Produce plugin + if: >- # Only works if the dists were built with line tracing + matrix.no-extensions + || ( + github.event_name == 'push' + && contains(github.ref, 'refs/tags/') + ) + run: | + set -eEuo pipefail + sed -i.bak 's/^plugins = .*//g' .coveragerc + shell: bash - name: Run unittests env: COLOR: 'yes' diff --git a/MANIFEST.in b/MANIFEST.in index 2122fe5a..31aa51d5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ +include .coveragerc include pyproject.toml include pytest.ini include pytest.ci.ini