From 4c08fabae17bf03f7d44e796732fd97d2c120fa0 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 22 Mar 2024 23:09:32 -0400 Subject: [PATCH] MNT: Coverage updates (#36) * MNT: Do not omit tests from coverage * MNT: Set fallback __version__, ignore coverage * CI: Do not submit etelemetry during tests * CI: Update pytest invocation to get test coverage --- .coveragerc | 6 +++++- .github/workflows/pythonpackage.yml | 5 +++-- codecov.yml | 3 --- pydra/tasks/nipype1/__init__.py | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.coveragerc b/.coveragerc index f65ec5e..dd05c95 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,4 +2,8 @@ branch = True omit = */_version.py - */tests/* + +[paths] +source = + pydra/tasks + /**/pydra/tasks diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 5178511..47984d1 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -7,6 +7,7 @@ name: Python package env: SUBPACKAGE: nipype1 FSLCONDA: https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ + NO_ET: 1 # etelemetry causes order-of-magnitude slowdowns on: push: @@ -86,8 +87,8 @@ jobs: python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')" - name: Test with pytest run: | - pytest -sv --doctest-modules pydra/tasks/$SUBPACKAGE \ - --cov pydra.tasks.$SUBPACKAGE --cov-report xml + pytest -sv --doctest-modules --pyargs pydra.tasks.$SUBPACKAGE \ + --cov pydra.tasks.$SUBPACKAGE --cov-report xml --cov-report term-missing - uses: codecov/codecov-action@v4 if: ${{ always() }} with: diff --git a/codecov.yml b/codecov.yml index bbf806c..f45bbe4 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,10 +1,7 @@ coverage: range: "50...100" ignore: # files and folders that will be removed during processing - - "**/tests" - "**/_version.py" - - "setup.py" - - "versioneer.py" status: project: default: diff --git a/pydra/tasks/nipype1/__init__.py b/pydra/tasks/nipype1/__init__.py index 090acf5..94ee228 100644 --- a/pydra/tasks/nipype1/__init__.py +++ b/pydra/tasks/nipype1/__init__.py @@ -5,8 +5,8 @@ try: from ._version import __version__ -except ImportError: - pass +except ImportError: # pragma: no cover + __version__ = "0+unknown" from .utils import Nipype1Task