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 #1107

Merged
merged 8 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
2 changes: 1 addition & 1 deletion .github/workflows/run_all_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ jobs:

- name: Install run dependencies
run: |
pip install -e .
pip install .
pip list

- name: Conda reporting
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/run_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ jobs:

- 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 }}
3 changes: 1 addition & 2 deletions .github/workflows/run_hdmf_zarr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ jobs:
git clone https://github.com/hdmf-dev/hdmf-zarr.git --recurse-submodules
cd hdmf-zarr
python -m pip install -r requirements-dev.txt # do not install the pinned install requirements
# must install in editable mode for coverage to find sources
python -m pip install -e . # this will install a different version of hdmf from the current one
python -m pip install . # this will install a different version of hdmf from the current one
cd ..
python -m pip uninstall -y hdmf # uninstall the other version of hdmf
python -m pip install . # reinstall current branch of hdmf
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/run_pynwb_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ jobs:
git clone https://github.com/NeurodataWithoutBorders/pynwb.git --recurse-submodules
cd pynwb
python -m pip install -r requirements-dev.txt # do not install the pinned install requirements
# must install in editable mode for coverage to find sources
python -m pip install -e . # this will install a different version of hdmf from the current one
python -m pip install . # this will install a different version of hdmf from the current one
cd ..
python -m pip uninstall -y hdmf # uninstall the other version of hdmf
python -m pip install . # reinstall current branch of hdmf
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ jobs:

- name: Install run dependencies
run: |
pip install -e .
pip install .
pip list

- name: Conda reporting
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Updated `_field_config` to take `type_map` as an argument for APIs. @mavaylon1 [#1094](https://github.com/hdmf-dev/hdmf/pull/1094)
- Added `TypeConfigurator` to automatically wrap fields with `TermSetWrapper` according to a configuration file. @mavaylon1 [#1016](https://github.com/hdmf-dev/hdmf/pull/1016)
- Updated `TermSetWrapper` to support validating a single field within a compound array. @mavaylon1 [#1061](https://github.com/hdmf-dev/hdmf/pull/1061)
- Updated testing to not install in editable mode and not run `coverage` by default. @rly [#1107](https://github.com/hdmf-dev/hdmf/pull/1107)

## HDMF 3.13.0 (March 20, 2024)

Expand Down
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ packages = ["src/hdmf"]
# verbose = 1

[tool.pytest.ini_options]
addopts = "--cov --cov-report html"
norecursedirs = "tests/unit/helpers"

[tool.codespell]
Expand All @@ -86,17 +85,17 @@ ignore-words-list = "datas"

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

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

# [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 @@ -8,7 +8,6 @@ requires = pip >= 22.0

[testenv]
download = True
usedevelop = True
setenv =
PYTHONDONTWRITEBYTECODE = 1
VIRTUALENV_PIP = 23.3.1
Expand Down
Loading