Repository: incf-nidash/PyNIDM (language: python)

Issue:
Face lift
- [x] modern Python packaging: #326
- [x] maybe even pre-commit with whatever goodnesses we use for dandi-cli including black (only few PRs ATM): #329
- [x] autoreleasing, probably intuit auto would be enough: #346
- [x] Use a `src/` layout: #332
- [x] Set up local testing with `tox`: #334
- [x] Set up local linting with `tox`: #329
- [x] Run linting as part of CI: #333
- [x] `tox` environment for building docs: #357
- [ ] Type annotations
- [x] Remove dependency on simplejson: #337
- [x] Remove Python 2-specific `__future__` imports: #335
- [x] Remove use of `six`: #336
- [x] Do something with `profiler.py` and `rest-server.py` in repo root (Turn them into `tox` envs?)
    - `rest-server.py` was taken care of by #351.
    - `profiler.py` was deleted by #362.
- [x] Clean up `README.rst` markup: #340
- [x] Ensure that pytest is only used by test code, and then move it to the test dependencies: #334
- [x] Shorten rows of asterisks around license notices to < 80 columns: #345
- [x] Replace uses of `tmpdir` test fixture with `tmp_path`: #339
- [x] Ensure all commented-out `sys.path` manipulations are gone
- [x] Configure pytest to fail on warnings: #341
- [x] Use `build` instead of `setup.py` in `pythonpublish.yml`: #330
- [x] Run tests on pushes to master in addition to pull requests: #331
- [x] Measure test coverage: #344
- [x] Make tests write temp files to temp directories instead of using the current directory (#323): #343
- [x] The `setup` fixture in `nidm/experiment/tests/test_query.py` seems to depend on another test having previously created the `cmu_a.nidm.ttl` file.  Fix this dependency.: #343
- [x] `nidm/experiment/tools/tests/test_nidm_lingreg.py`: Replace `call_click_command()` with appropriate use of `click.testing.CliRunner`: #352
- ~Cut down on the use of global variables~ Moved to dedicated issue: #361
- [x] Replace %-formatting and `str.format()` with f-strings: #364
- [x] Update/clean up Dockerfiles: #351
- [x] Remove `README.md` files in code directories and move their contents (if any) to docstrings of adjacent `__init__.py` files: #338
- ~Fix the test workflow so that there are actually Junit files to upload~
    - Upload step deleted instead by #372
- [x] Update all actions used by workflows to the latest versions, and configure Dependabot to keep them up to date: #350
- [x] Replace uses of `urllib.request` with `requests`: #359
- [ ] Cut down on code duplication in `nidm/experiment/tools/`
- [x] Remove the giant comments [like these](https://github.com/incf-nidash/PyNIDM/blob/47ec0cc7107a74c0b8fdc8f23479e00f3da07fd6/src/nidm/experiment/tools/bidsmri2nidm.py#L1-L27) from source files and list their authors in a `CONTRIBUTORS` file: #363
- [ ] Replace `restLog` in `src/nidm/experiment/tools/rest.py` with an actual logger
- [ ] Replace most/all uses of `tempfile.gettempdir()` with `tempfile.mkdtemp()`
- [ ] Eliminate excessive whitespace printed out at ends of lines and around tab characters
- anything else good which comes to mind ;)


Discussion / hints:
@yarikoptic Should we maybe make this into a GitHub project with multiple issues instead of just one issue with a lot of tasks?
wow the description grew, I didn't notice, time flies ;-) ! 
On one hand -- I don't mind you taking any approach you would like to make you more efficient etc.  On the other -- I just love this checklist which could easily serve later as a condensed and easily copy pasteable template for one of us or someone else.
So if you like -- create separate issues, but checklist is as fine with me.
@yarikoptic It turns out that projects have to be created at the organization level, and I apparently don't have permission to create projects for incf-nidash.

Fix patch:
diff --git a/tox.ini b/tox.ini
index ac60549..75f7ecc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,6 +5,7 @@ envlist = lint,py3
 deps =
     importlib-resources; python_version < '3.9'
     pytest
+    pytest-cov
 commands =
     pytest {posargs} tests
 
@@ -19,6 +20,7 @@ commands =
     flake8 src tests
 
 [pytest]
+addopts = --cov=nidm --no-cov-on-fail
 filterwarnings =
     error
     # <https://github.com/sensein/etelemetry-client/pull/44>
@@ -26,6 +28,23 @@ filterwarnings =
     # <https://github.com/PythonCharmers/python-future/issues/246>
     ignore:the imp module is deprecated:DeprecationWarning
 
+[coverage:run]
+branch = True
+parallel = True
+
+[coverage:paths]
+source =
+    src
+    .tox/**/site-packages
+
+[coverage:report]
+precision = 2
+show_missing = True
+exclude_lines =
+    pragma: no cover
+    if TYPE_CHECKING:
+    \.\.\.
+
 [flake8]
 doctests = True
 exclude = .*/,build/,dist/,test/data,venv/


Test patch:
diff --git a/.github/workflows/pythontest.yml b/.github/workflows/pythontest.yml
index 8226dcf..dd3a8e1 100644
--- a/.github/workflows/pythontest.yml
+++ b/.github/workflows/pythontest.yml
@@ -8,25 +8,32 @@ on:
 
 jobs:
   build:
-
     runs-on: ubuntu-latest
     strategy:
       fail-fast: false
       matrix:
         python-version: ['3.8', '3.9', '3.10', '3.11']
-
     steps:
       - uses: actions/checkout@v3
+
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
+
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
           python -m pip install --upgrade tox
+
       - name: Test
-        run: tox -e py3
+        run: tox -e py3 -- --cov-report=xml
+
+      - name: Upload coverage to Codecov
+        uses: codecov/codecov-action@v3
+        with:
+          fail_ci_if_error: false
+
       - name: Upload pytest test results
         uses: actions/upload-artifact@v2
         with: