Skip to content

Commit

Permalink
MAINT: clean up Tox configuration (#370)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
redeboer authored Aug 12, 2024
1 parent 8b7c1ab commit 97ed97b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 47 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dev = [
"compwa-policy[sty]",
"compwa-policy[test]",
"labels",
"pydeps",
"sphinx-autobuild",
"tox >=1.9", # for skip_install, use_develop
]
Expand Down
62 changes: 15 additions & 47 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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

0 comments on commit 97ed97b

Please sign in to comment.