diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 3e1bba41b7..0000000000 --- a/.coveragerc +++ /dev/null @@ -1,5 +0,0 @@ -[run] -plugins = Cython.Coverage -branch = True -source = dpctl -omit = dpctl/tests/*, dpctl/_version.py diff --git a/.github/workflows/generate-coverage.yaml b/.github/workflows/generate-coverage.yaml index f6da4861f1..41f77b4279 100644 --- a/.github/workflows/generate-coverage.yaml +++ b/.github/workflows/generate-coverage.yaml @@ -79,7 +79,7 @@ jobs: - name: Install dpctl dependencies shell: bash -l {0} run: | - pip install numpy cython setuptools pytest pytest-cov coverage + pip install numpy cython setuptools pytest pytest-cov coverage[toml] - name: Build dpctl with coverage shell: bash -l {0} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a7d01a62c9..9cae87e86e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -154,6 +154,10 @@ these steps: To generate the coverage data for dpctl's Python sources, you only need to install `coverage`. + ```bash + python -m pip install coverage[toml] + ``` + 3. Build dpctl with code coverage support. ```bash diff --git a/pyproject.toml b/pyproject.toml index 7598e26713..6d79a1dc21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,3 +10,32 @@ use_parentheses = true ensure_newline_before_comments = true line_length = 80 skip = ["versioneer.py", "dpctl/_version.py"] + +[tool.coverage.run] +plugins = [ + "Cython.Coverage" +] +branch = true +source = [ + "dpctl" +] +omit = [ + "dpctl/tests/*", + "dpctl/_version.py", +] + +[tool.pytest.ini.options] +minversion = "6.0" +norecursedirs= [ + ".*", "*.egg*", "build", "dist", "conda.recipe", +] +addopts = [ + "--junitxml=junit.xml", + "--ignore setup.py", + "--ignore run_test.py", + "--cov-report term-missing", + "--tb native", + "--strict", + "--durations=20", + "-q -ra", +] diff --git a/setup.cfg b/setup.cfg index e754d4e620..79a4c6ffec 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,18 +1,3 @@ -[tool:pytest] -norecursedirs= .* *.egg* build dist conda.recipe -addopts = - --junitxml=junit.xml - --ignore setup.py - --ignore run_test.py - --cov-report term-missing - --tb native - --strict - --durations=20 -env = - PYTHONHASHSEED=0 -markers = - serial: execute test serially (to avoid race conditions) - [versioneer] VCS = git versionfile_source = dpctl/_version.py