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

Merged
merged 3 commits into from
May 2, 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/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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Added `mock_Units` for generating Units tables. @h-mayorquin [#1875](https://github.com/NeurodataWithoutBorders/pynwb/pull/1875) and [#1883](https://github.com/NeurodataWithoutBorders/pynwb/pull/1883)
- Allow datetimes without a timezone and without a time. @rly [#1886](https://github.com/NeurodataWithoutBorders/pynwb/pull/1886)
- No longer automatically set the timezone to the local timezone when not provided. [#1886](https://github.com/NeurodataWithoutBorders/pynwb/pull/1886)
- Updated testing to not install in editable mode and not run `coverage` by default. [#1897](https://github.com/NeurodataWithoutBorders/pynwb/pull/1897)

### Bug fixes
- Fix bug with reading file with linked `TimeSeriesReferenceVectorData` @rly [#1865](https://github.com/NeurodataWithoutBorders/pynwb/pull/1865)
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 = ["pynwb"]

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