Skip to content

Commit

Permalink
Update coverage call, don't install in editable mode in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rly authored Apr 29, 2024
1 parent d7f5f26 commit 757134a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_all_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ jobs:
- name: Install run dependencies
run: |
pip install -r requirements-dev.txt
pip install -e .
pip install .
conda info
conda list
pip list
Expand Down Expand Up @@ -271,7 +271,7 @@ jobs:
- name: Install run dependencies
run: |
pip install matplotlib
pip install -e .
pip install .
pip list
- name: Conda reporting
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/run_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ 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 unit tests and generate coverage report
run: |
python -m coverage run test.py --pynwb
python -m coverage xml # codecov uploader requires xml format
python -m coverage report -m
python -m coverage report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
flags: unit
files: coverage.xml
file: coverage.xml
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -77,13 +77,13 @@ jobs:
# validation CLI tests generate separate .coverage files that need to be merged
python -m coverage combine
python -m coverage xml # codecov uploader requires xml format
python -m coverage report -m
python -m coverage report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
flags: integration
files: coverage.xml
file: coverage.xml
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/run_dandi_read_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: |
python -m pip install dandi fsspec requests aiohttp pytest
python -m pip uninstall -y pynwb # uninstall pynwb
python -m pip install -e .
python -m pip install .
python -m pip list
- name: Conda reporting
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/run_inspector_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
git clone https://github.com/NeurodataWithoutBorders/nwbinspector.git
cd nwbinspector
python -m pip install -r requirements.txt pytest
# must install in editable mode for coverage to find sources
python -m pip install -e . # this might install a pinned version of pynwb instead of the current one
python -m pip install . # this might install a pinned version of pynwb instead of the current one
cd ..
python -m pip uninstall -y pynwb # uninstall the pinned version of pynwb
python -m pip install . # reinstall current branch of pynwb
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
- name: Install run dependencies
run: |
pip install -r requirements-dev.txt
pip install -e .
pip install .
conda info
conda list
pip list
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
- name: Install run dependencies
run: |
pip install matplotlib
pip install -e .
pip install .
pip list
- name: Conda reporting
Expand Down
16 changes: 6 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,24 @@ version-file = "src/pynwb/_version.py"
[tool.hatch.build.targets.wheel]
packages = ["src/pynwb"]

# [tool.pytest.ini_options] # TODO: uncomment when pytest is integrated
# # Addopts creates a shortcut for pytest. For example below, running `pytest` will actually run `pytest --cov --cov-report html`.
# addopts = "--cov --cov-report html" # generates coverage report in html format without showing anything on the terminal.

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

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

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

[tool.ruff]
select = ["E", "F", "T100", "T201", "T203"]
Expand Down
7 changes: 3 additions & 4 deletions 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_PIP = 23.3.1
Expand Down Expand Up @@ -112,7 +111,7 @@ install_command =
deps =
-rrequirements.txt
commands =
python -m pip install -e .
python -m pip install .
python -m pip install -r requirements-doc.txt # NOTE: allensdk (requirements-doc.txt) requires pynwb
python -m pip check
python -m pip list
Expand Down Expand Up @@ -144,7 +143,7 @@ basepython = python3.12
deps =
-rrequirements-dev.txt
commands =
python -m pip install -U -e .
python -m pip install -U .
python -m pip install -r requirements-doc.txt # NOTE: allensdk (requirements-doc.txt) requires pynwb
python -m pip check
python -m pip list
Expand All @@ -156,7 +155,7 @@ basepython = python3.12
deps =
-rrequirements-dev.txt
commands =
python -m pip install -U --pre -e .
python -m pip install -U --pre .
python -m pip install -r requirements-doc.txt # NOTE: allensdk (requirements-doc.txt) requires pynwb
python -m pip check
python -m pip list
Expand Down

0 comments on commit 757134a

Please sign in to comment.