Skip to content

Commit

Permalink
Update coverage call, don't install in editable mode in testing (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
rly authored May 1, 2024
1 parent 5fd5c58 commit 65f7a8b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/HDMF_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
- name: Install HDMF_Zarr Requirements
run: |
python -m pip install -r requirements-dev.txt -r requirements.txt
pip install -e .
pip install .
- name: Clone HDMF Dev Branch
run: |
git clone https://github.com/hdmf-dev/hdmf.git --recurse-submodules
cd hdmf
python -m pip install -r requirements-dev.txt -r requirements.txt
python -m pip install -e .
python -m pip install .
cd ..
- name: Run HDMF_Zarr Tests
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/run_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,26 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt -r requirements.txt -r requirements-opt.txt
python -m pip install -r requirements-dev.txt -r requirements.txt
- name: Install optional dependencies
if: ${{ matrix.opt_req }}
run: python -m pip install -r requirements-opt.txt

- name: Install package
run: |
python -m pip install -e . # must install in editable mode for coverage to find sources
python -m pip install .
python -m pip list
- name: Run tests and generate coverage report
run: |
pytest --cov
python -m coverage xml # codecov uploader requires xml format
python -m coverage report -m
# coverage is configured in pyproject.toml
pytest --cov --cov-report=xml --cov-report=term # codecov uploader requires xml format
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
file: ./coverage.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
### Enhancements
* Added support for python 3.12. @mavaylon1 [#172](https://github.com/hdmf-dev/hdmf-zarr/pull/172)
* Added support for forcing read of files without consolidated metadata using `mode=r-` in `ZarrIO`. @oruebel [#183](https://github.com/hdmf-dev/hdmf-zarr/pull/183)
- Updated testing to not install in editable mode and not run `coverage` by default. @rly [#188](https://github.com/hdmf-dev/hdmf-zarr/pull/188)

### Docs
* Removed `linkable` from the documentation to keep in line with `hdmf-schema-language`. @mavaylon1 [#180](https://github.com/hdmf-dev/hdmf-zarr/pull/180)
Expand Down
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,23 @@ exclude = [".git_archival.txt"]
[tool.hatch.build.targets.wheel]
packages = ["src/hdmf_zarr"]

[tool.pytest.ini_options]
addopts = "--cov --cov-report html"

[tool.codespell]
skip = "htmlcov,.git,.mypy_cache,.pytest_cache,.coverage,*.pdf,*.svg,venvs,.tox,./docs/_build/*,*.ipynb"
ignore-words-list = "datas"

[tool.coverage.run]
branch = true
source = ["src/"]
omit = [
"src/hdmf_zarr/_due.py",
]
source = ["hdmf_zarr"]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"@abstract"
]
omit = [
"*/hdmf_zarr/_due.py",
]

[tool.black]
line-length = 120
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ requires = pip >= 22.0

[testenv]
download = True
usedevelop = True
setenv =
PYTHONDONTWRITEBYTECODE = 1
VIRTUALENV_python -m pip = 22.3.1
Expand Down

0 comments on commit 65f7a8b

Please sign in to comment.