From 61055f71cc18dda7018bcfee195f5559f61c9a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Fri, 15 Aug 2025 11:08:44 +0200 Subject: [PATCH 1/2] TST: use `coverage` directly, ditch `pytest-cov` --- .codecov.yml | 10 ---------- .github/workflows/ci.yml | 6 ++++-- Makefile | 3 ++- pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml deleted file mode 100644 index 6d478d53..00000000 --- a/.codecov.yml +++ /dev/null @@ -1,10 +0,0 @@ -coverage: - status: - patch: false - range: 50..70 - round: nearest - precision: 2 - -ignore: - - tests/* - - src/vip_hci/vip_ds9.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d970a930..47b4916e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,8 @@ jobs: # pre-commit run --files src/**/*.py - name: Test with pytest run: | - pytest tests/pre_3_10 --cov=src --cov-report=xml --splits 3 --group ${{ matrix.group }} + coverage run --source src -m pytest tests/pre_3_10 --splits 3 --group ${{ matrix.group }} + coverage xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 @@ -87,6 +88,7 @@ jobs: # pre-commit run --files src/vip_hci/objects/*.py - name: Test with pytest run: | - pytest tests/post_3_10 --cov=src/vpi_hci/objects/ --cov-report=xml + coverage run --source=src/vip_hci/objects/ -m pytest tests/post_3_10 + coverage xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/Makefile b/Makefile index 8f412811..c93fba37 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,8 @@ test: pre-commit install-hooks pre-commit install pre-commit run --files src/**/*.py - pytest --cov=src --cov-report=xml + coverate run -m pytest + coverage xml rm confi_hist.pdf rm confi_hist_gaussfit.pdf rm confidence.txt diff --git a/pyproject.toml b/pyproject.toml index 4ffc5dd2..9bb55c76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ dependencies = [ [dependency-groups] dev = [ + "coverage>=7.10.0", "build", "twine", "opencv-python", @@ -55,7 +56,6 @@ dev = [ "myst-parser", "pandoc", "pytest", - "pytest-cov ~=2.6.0", "pytest-split", "flake8", "flake8-bandit", From e6d4e09fd301946e945bde1d17b75f1184c142e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Fri, 15 Aug 2025 13:07:27 +0200 Subject: [PATCH 2/2] TST: install package in editable mode to simplify coverage measurements --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47b4916e..ccf4b1a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install . --group dev + pip install --editable . --group dev # Uncomment below when ready to deal with a lot of PEP8 formatting changes # - name: Verify files with pre-commit # run: | @@ -74,7 +74,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install . --group dev + pip install --editable . --group dev # - name: Verify files with pre-commit # run: | # # Setup pre-commit hooks