Skip to content

Commit

Permalink
Configure coverage in pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwondo committed Jan 27, 2025
1 parent bb5f0a7 commit 904daa3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- hdf5plugin
- numcodecs
# Testing
- codecov
- codecov[toml]
- pre-commit
- mypy
- ruff
Expand Down
2 changes: 1 addition & 1 deletion ci/min-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- ujson
- universal_pathlib
# Testing
- codecov
- codecov[toml]
- pre-commit
- mypy
- ruff
Expand Down
2 changes: 1 addition & 1 deletion ci/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- numcodecs
- imagecodecs>=2024.6.1
# Testing
- codecov
- codecov[toml]
- pre-commit
- mypy
- ruff
Expand Down
17 changes: 15 additions & 2 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@ mamba activate virtualizarr-tests
pre-commit install
# git checkout -b new-feature
python -m pip install -e . --no-deps
python -m pytest --run-network-tests
python -m pytest
```

The `--run-network-tests` argument is optional -- it will run additional tests that require downloading files over the network. Skip this if you want the tests to run faster or you have no internet access.
You may also add the `--run-network-tests` option, which will run additional tests
that require downloading files over the network. Skip this if you want the tests to run
faster or you have no internet access:

```bash
pytest -m pytest --run-network-tests
```

Further, we use the `pytest-cov` plugin to generate a test coverage report. By default,
a report showing lines missing coverage will be printed to the terminal. You may supply
additional options to `pytest` to generate other outputs, such as an HTML report (via
`--cov-report=html`). For all available options added by the `pytest-cov` plugin, run
`python -m pytest -h`, or see the
[pytest-cov documentation](https://pytest-cov.readthedocs.io/en/latest/readme.html).

## Contributing documentation

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ line-ending = "auto"
[tool.ruff.lint.isort]
known-first-party = ["virtualizarr"]

[tool.coverage.run]
omit = ["virtualizarr/tests/*"]

[tool.pytest.ini_options]
addopts = [
"--cov=virtualizarr",
Expand Down

0 comments on commit 904daa3

Please sign in to comment.