Skip to content

Commit

Permalink
Merge pull request #1092 from aphearin/coverage_toml
Browse files Browse the repository at this point in the history
Migrate test coverage from setup.cfg to pyproject.toml
  • Loading branch information
aphearin authored Sep 8, 2024
2 parents 2c250f5 + 488fa86 commit bdaa6df
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 36 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,42 @@ requires = ["setuptools>=42.0.0",
"extension-helpers==1.*"]

build-backend = 'setuptools.build_meta'


[tool.coverage]

[tool.coverage.run]
omit = [
"halotools/_astropy_init*",
"halotools/__init__*",
"halotools/**/setup*",
"halotools/**/tests/*",
"halotools/extern/*",
"halotools/version*",
"halotools/conftest.py",
"halotools/*setup_package*",
"*/halotools/_astropy_init*",
"*/halotools/conftest.py",
"*/halotools/*setup_package*"
]

[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about packages we have installed
"except ImportError",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain about script hooks
"'def main(.*):'",
# Ignore branches that don't pertain to this version of Python
"pragma: py{ignore_python_version}",
# Don't complain about IPython completion helper
"def _ipython_key_completions_",
# typing.TYPE_CHECKING is False at runtime
"if TYPE_CHECKING:",
# Ignore typing overloads
"@overload",
]
36 changes: 0 additions & 36 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ install_requires =
cython
h5py

[options.entry_points]
console_scripts =
astropy-package-template-example = packagename.example_mod:main

[options.extras_require]
all =
h5py
Expand Down Expand Up @@ -56,35 +52,3 @@ markers =
slow
installation_test

[coverage:run]
omit =
halotools/_astropy_init*
halotools/conftest.py
halotools/*setup_package*
halotools/tests/*
halotools/*/tests/*
halotools/extern/*
halotools/version*
*/halotools/_astropy_init*
*/halotools/conftest.py
*/halotools/*setup_package*
*/halotools/tests/*
*/halotools/*/tests/*
*/halotools/extern/*
*/halotools/version*

[coverage:report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about packages we have installed
except ImportError
# Don't complain if tests don't hit assertions
raise AssertionError
raise NotImplementedError
# Don't complain about script hooks
def main\(.*\):
# Ignore branches that don't pertain to this version of Python
pragma: py{ignore_python_version}
# Don't complain about IPython completion helper
def _ipython_key_completions_

0 comments on commit bdaa6df

Please sign in to comment.