From 2ee9b34cab0dfea402d1aad2648d7f6a39bb6d9e Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 15 Nov 2020 21:14:08 -0500 Subject: [PATCH] Migrate coverage configurations to pyproject.toml (#667) This PR migrates the `coverage` configurations from `.coveragerc` to `pyproject.toml`. Coverage configurations: https://coverage.readthedocs.io/en/latest/config.html --- .coveragerc | 5 ----- Makefile | 2 +- environment.yml | 2 +- pyproject.toml | 2 ++ requirements-dev.txt | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 .coveragerc create mode 100644 pyproject.toml diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 9a0c535dcf5..00000000000 --- a/.coveragerc +++ /dev/null @@ -1,5 +0,0 @@ -[run] -omit = - */tests/* - */_version.py - *pygmt/__init__.py diff --git a/Makefile b/Makefile index 9f5fdd40e6b..54fa7d9dccd 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Build, package, test, and clean PROJECT=pygmt TESTDIR=tmp-test-dir-with-unique-name -PYTEST_ARGS=--cov=$(PROJECT) --cov-config=../.coveragerc \ +PYTEST_ARGS=--cov=$(PROJECT) --cov-config=../pyproject.toml \ --cov-report=term-missing --cov-report=xml --cov-report=html \ --doctest-modules -v --mpl --mpl-results-path=results \ --pyargs ${PYTEST_EXTRA} diff --git a/environment.yml b/environment.yml index 4a8e69abf92..fec3dbaaebf 100644 --- a/environment.yml +++ b/environment.yml @@ -17,7 +17,7 @@ dependencies: - pytest - pytest-cov - pytest-mpl - - coverage + - coverage[toml] - black - blackdoc - pylint diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000000..334fb0a9922 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.coverage.run] +omit = ["*/tests/*", "*/_version.py", "*pygmt/__init__.py"] diff --git a/requirements-dev.txt b/requirements-dev.txt index f6a53ef0310..fc05772b072 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ jupyter pytest pytest-cov pytest-mpl -coverage +coverage[toml] black blackdoc pylint