Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update coverage call, don't install in editable mode in testing #188

Merged
merged 6 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The testing matrix was set up to test and report coverage with both optional requirements installed and not installed. Testing with the optional requirements takes a lot longer because of the streaming test.


- 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
Loading