From 97ed97bd09d86c1437c292d9433c1c681bc33290 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:35:17 +0200 Subject: [PATCH] MAINT: clean up Tox configuration (#370) * DX: install `pydeps` in developer environment * DX: lower test coverage to 35% * DX: run `mypy` through `pre-commit` in `tox` * ENH: pack strings in single quotation marks in `tox.ini` * MAINT: clean up `--re-ignore` flags in `tox.ini` * MAINT: remove redundant `docnb` job * MAINT: write flags for `tox` commands in full --- pyproject.toml | 1 + tox.ini | 62 ++++++++++++-------------------------------------- 2 files changed, 16 insertions(+), 47 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f0477c14..3c7d10f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ dev = [ "compwa-policy[sty]", "compwa-policy[test]", "labels", + "pydeps", "sphinx-autobuild", "tox >=1.9", # for skip_install, use_develop ] diff --git a/tox.ini b/tox.ini index 1fc0494a..c50672ec 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ allowlist_externals = pytest commands = pytest {posargs} \ - --cov-fail-under=40 \ + --cov-fail-under=35 \ --cov-report=html \ --cov-report=xml \ --cov=compwa_policy @@ -33,9 +33,10 @@ allowlist_externals = sphinx-build commands = sphinx-build \ + --builder html \ + --fail-on-warning \ --keep-going \ - -TW \ - -b html \ + --show-traceback \ docs/ docs/_build/html description = Build documentation and API through Sphinx @@ -49,23 +50,10 @@ allowlist_externals = commands = sphinx-autobuild \ --open-browser \ - --re-ignore .*/.ipynb_checkpoints/.* \ - --re-ignore .*/__pycache__/.* \ - --re-ignore .*\.gitignore \ - --re-ignore .*\.tmp \ - --re-ignore docs/.*\.csv \ - --re-ignore docs/.*\.gif \ - --re-ignore docs/.*\.gv \ - --re-ignore docs/.*\.inv \ - --re-ignore docs/.*\.json \ - --re-ignore docs/.*\.pickle \ - --re-ignore docs/.*\.png \ - --re-ignore docs/.*\.svg \ - --re-ignore docs/.*\.yaml \ - --re-ignore docs/.*\.yml \ - --re-ignore docs/_build/.* \ - --re-ignore docs/_images/.* \ - --re-ignore docs/api/.* \ + --re-ignore '.*\.egg-info' \ + --re-ignore '.*/__pycache__/.*' \ + --re-ignore 'docs/_build/.*' \ + --re-ignore 'docs/api/.*' \ --watch docs \ --watch src \ docs/ docs/_build/html @@ -75,31 +63,13 @@ passenv = * setenv = FORCE_COLOR = yes - -[testenv:docnb] -allowlist_externals = - sphinx-build -commands = - sphinx-build \ - --keep-going \ - -TW \ - -b html \ - docs/ docs/_build/html -description = - Build documentation through Sphinx WITH output of Jupyter notebooks -passenv = * -setenv = - EXECUTE_NB = yes - FORCE_COLOR = yes - PYTHONHASHSEED = 0 - [testenv:linkcheck] allowlist_externals = sphinx-build commands = sphinx-build \ - -T \ - -b linkcheck \ + --builder linkcheck \ + --show-traceback \ docs/ docs/_build/linkcheck description = Check external links in the documentation (requires internet connection) @@ -108,27 +78,25 @@ setenv = FORCE_COLOR = yes [testenv:pydeps] +allowlist_externals = + pydeps changedir = src commands = pydeps compwa_policy \ -o module_structure.svg \ - --exclude *._* \ + --exclude '*._*' \ --max-bacon=1 \ --noshow -deps = - pydeps description = Visualize module dependencies passenv = * [testenv:sty] allowlist_externals = - mypy pre-commit commands = - mypy src tests # run separately because of potential caching problems - pre-commit run {posargs} -a + pre-commit run {posargs} --all-files description = Perform all linting, formatting, and spelling checks setenv = - SKIP = mypy, pyright + SKIP = pyright