From c5129496e538bc8036fc20f5184993b6ea87a1b7 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Mon, 29 Apr 2024 15:15:55 -0500 Subject: [PATCH 1/8] Don't install in editable/develop mode during testing --- .github/workflows/run_all_tests.yml | 2 +- .github/workflows/run_coverage.yml | 2 +- .github/workflows/run_hdmf_zarr_tests.yml | 3 +-- .github/workflows/run_pynwb_tests.yml | 3 +-- .github/workflows/run_tests.yml | 2 +- pyproject.toml | 2 +- tox.ini | 1 - 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run_all_tests.yml b/.github/workflows/run_all_tests.yml index 67a645037..def51537f 100644 --- a/.github/workflows/run_all_tests.yml +++ b/.github/workflows/run_all_tests.yml @@ -233,7 +233,7 @@ jobs: - name: Install run dependencies run: | - pip install -e . + pip install . pip list - name: Conda reporting diff --git a/.github/workflows/run_coverage.yml b/.github/workflows/run_coverage.yml index 7a18e5068..1cdd61590 100644 --- a/.github/workflows/run_coverage.yml +++ b/.github/workflows/run_coverage.yml @@ -55,7 +55,7 @@ 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 diff --git a/.github/workflows/run_hdmf_zarr_tests.yml b/.github/workflows/run_hdmf_zarr_tests.yml index ecfdeaeeb..5e76711af 100644 --- a/.github/workflows/run_hdmf_zarr_tests.yml +++ b/.github/workflows/run_hdmf_zarr_tests.yml @@ -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 diff --git a/.github/workflows/run_pynwb_tests.yml b/.github/workflows/run_pynwb_tests.yml index bf3f32343..1a714ed9f 100644 --- a/.github/workflows/run_pynwb_tests.yml +++ b/.github/workflows/run_pynwb_tests.yml @@ -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 diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index d800d86f1..2723e03d0 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -243,7 +243,7 @@ jobs: - name: Install run dependencies run: | - pip install -e . + pip install . pip list - name: Conda reporting diff --git a/pyproject.toml b/pyproject.toml index b60ae6943..7658dae14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,7 @@ packages = ["src/hdmf"] # verbose = 1 [tool.pytest.ini_options] -addopts = "--cov --cov-report html" +addopts = "--cov=hdmf --cov-report html" norecursedirs = "tests/unit/helpers" [tool.codespell] diff --git a/tox.ini b/tox.ini index aeb743c45..75b011aa0 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,6 @@ requires = pip >= 22.0 [testenv] download = True -usedevelop = True setenv = PYTHONDONTWRITEBYTECODE = 1 VIRTUALENV_PIP = 23.3.1 From 07aa2fdca098b316dc25e8a3986ffd2cbfc6c064 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Mon, 29 Apr 2024 13:21:25 -0700 Subject: [PATCH 2/8] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7658dae14..97a68872f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,7 @@ packages = ["src/hdmf"] # verbose = 1 [tool.pytest.ini_options] -addopts = "--cov=hdmf --cov-report html" +addopts = "--cov=src/hdmf --cov-report html" norecursedirs = "tests/unit/helpers" [tool.codespell] From 7c7b9ea8d842c39de8e7d6d8349bc8f1b93d872e Mon Sep 17 00:00:00 2001 From: rly Date: Mon, 29 Apr 2024 13:35:28 -0700 Subject: [PATCH 3/8] Fix --- .github/workflows/run_coverage.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_coverage.yml b/.github/workflows/run_coverage.yml index 1cdd61590..bd292157d 100644 --- a/.github/workflows/run_coverage.yml +++ b/.github/workflows/run_coverage.yml @@ -60,7 +60,7 @@ jobs: - name: Run tests and generate coverage report run: | - pytest --cov + pytest python -m coverage xml # codecov uploader requires xml format python -m coverage report -m diff --git a/pyproject.toml b/pyproject.toml index 97a68872f..7658dae14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,7 @@ packages = ["src/hdmf"] # verbose = 1 [tool.pytest.ini_options] -addopts = "--cov=src/hdmf --cov-report html" +addopts = "--cov=hdmf --cov-report html" norecursedirs = "tests/unit/helpers" [tool.codespell] From e8f31f1eaaeae0ea0e26cbeec9c104610f7c9bd0 Mon Sep 17 00:00:00 2001 From: rly Date: Mon, 29 Apr 2024 14:13:00 -0700 Subject: [PATCH 4/8] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00eeeb5dd..8f86bcbb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) +- Update CI and testing to not install in editable mode. @rly [#1107](https://github.com/hdmf-dev/hdmf/pull/1107) ## HDMF 3.13.0 (March 20, 2024) From 08a5c9a189803f0ff57ca4f66620234d2a4b3222 Mon Sep 17 00:00:00 2001 From: rly Date: Mon, 29 Apr 2024 14:37:45 -0700 Subject: [PATCH 5/8] Update to work locally and on github actions --- .github/workflows/run_coverage.yml | 5 ++--- pyproject.toml | 11 +++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run_coverage.yml b/.github/workflows/run_coverage.yml index bd292157d..2afcc78b8 100644 --- a/.github/workflows/run_coverage.yml +++ b/.github/workflows/run_coverage.yml @@ -60,9 +60,8 @@ jobs: - name: Run tests and generate coverage report run: | - pytest - python -m coverage xml # codecov uploader requires xml format - python -m coverage report -m + # coverage is configured in pyproject.toml + pytest --cov=hdmf --cov-report=xml --cov-report=term # codecov uploader requires xml format - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 diff --git a/pyproject.toml b/pyproject.toml index 7658dae14..c90aef186 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,6 @@ packages = ["src/hdmf"] # verbose = 1 [tool.pytest.ini_options] -addopts = "--cov=hdmf --cov-report html" norecursedirs = "tests/unit/helpers" [tool.codespell] @@ -86,17 +85,17 @@ ignore-words-list = "datas" [tool.coverage.run] branch = true -source = ["src/"] -omit = [ - "src/hdmf/_due.py", - "src/hdmf/testing/*", -] +source = ["src"] [tool.coverage.report] exclude_lines = [ "pragma: no cover", "@abstract" ] +omit = [ + "*/hdmf/_due.py", + "*/hdmf/testing/*", +] # [tool.black] # line-length = 120 From 32eb745b945b9a35d5d8f85aee28269d02750639 Mon Sep 17 00:00:00 2001 From: rly Date: Mon, 29 Apr 2024 14:41:49 -0700 Subject: [PATCH 6/8] Specify coverage file --- .github/workflows/run_coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_coverage.yml b/.github/workflows/run_coverage.yml index 2afcc78b8..76fa1f19d 100644 --- a/.github/workflows/run_coverage.yml +++ b/.github/workflows/run_coverage.yml @@ -67,5 +67,6 @@ jobs: uses: codecov/codecov-action@v4 with: fail_ci_if_error: true + file: ./coverage.xml env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From ae5c2520f6fe3dda316f33bf674b372a53baa443 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Mon, 29 Apr 2024 14:57:04 -0700 Subject: [PATCH 7/8] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f86bcbb9..5d5a2cc62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +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) -- Update CI and testing to not install in editable mode. @rly [#1107](https://github.com/hdmf-dev/hdmf/pull/1107) +- 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) From 9be854bf272c4eeca9fe60616a19a586403f8d76 Mon Sep 17 00:00:00 2001 From: rly Date: Mon, 29 Apr 2024 15:28:27 -0700 Subject: [PATCH 8/8] Cleaner version --- .github/workflows/run_coverage.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_coverage.yml b/.github/workflows/run_coverage.yml index 76fa1f19d..a72a05e73 100644 --- a/.github/workflows/run_coverage.yml +++ b/.github/workflows/run_coverage.yml @@ -61,7 +61,7 @@ jobs: - name: Run tests and generate coverage report run: | # coverage is configured in pyproject.toml - pytest --cov=hdmf --cov-report=xml --cov-report=term # codecov uploader requires xml format + pytest --cov --cov-report=xml --cov-report=term # codecov uploader requires xml format - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 diff --git a/pyproject.toml b/pyproject.toml index c90aef186..e5584b581 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,7 +85,7 @@ ignore-words-list = "datas" [tool.coverage.run] branch = true -source = ["src"] +source = ["hdmf"] [tool.coverage.report] exclude_lines = [