Skip to content

Commit 3e1c591

Browse files
committed
Set the source on pyproject and add a paths config
If using relative paths, the `source` argument needs to passed on the config file instead of the command line (don't know why but says so in the docs). We can also set patterns for paths that should be considered the same by the reporting.
1 parent 47de4c6 commit 3e1c591

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Build, package, test, and clean
22
PROJECT=harmonica
33
TESTDIR=tmp-test-dir-with-unique-name
4-
PYTEST_ARGS=--cov-report=term-missing --cov=$(PROJECT) --doctest-modules --doctest-continue-on-failure -v --pyargs
4+
PYTEST_ARGS=--cov-report=term-missing --cov --doctest-modules --doctest-continue-on-failure -v --pyargs
55
NUMBATEST_ARGS=--doctest-modules -v --pyargs -m use_numba
66
STYLE_CHECK_FILES=$(PROJECT) examples doc
77
GITHUB_ACTIONS=.github/workflows

pyproject.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,21 @@ notice = '''
8080
#'''
8181

8282
[tool.coverage.run]
83-
branch = true
83+
source = ["harmonica"]
8484
omit = [
8585
"**/_version.py",
8686
"**/__init__.py",
8787
]
88+
branch = true
8889
# Needed to combine coverage data from multiple OSs on CI
8990
relative_files = true
9091

92+
[tool.coverage.paths]
93+
source = [
94+
"harmonica",
95+
"*/harmonica",
96+
"*\\harmonica",
97+
]
98+
9199
[tool.coverage.report]
92100
show_missing = true

0 commit comments

Comments
 (0)