Skip to content

Commit

Permalink
tox: let's take commands from the Makefile where possible (ACHTUNG: j…
Browse files Browse the repository at this point in the history
…ust lints for now: COMPLETE_ME)

The "make" command should be available on every supported platform in our Github
CI runners.
  • Loading branch information
muxator committed Sep 17, 2024
1 parent 99bcc44 commit 379c280
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ basepython = python3

[testenv]
# From Poetry FAQ "Is tox supported?" (https://python-poetry.org/docs/faq/#use-case-2)
allowlist_externals = poetry
allowlist_externals =
make
poetry
skip_install = True
setenv =
PYTHONPATH = {toxinidir}
Expand All @@ -35,42 +37,38 @@ commands = pytest examples/tests_on_toy_model.ipynb --nbmake --nbmake-timeout=30
[testenv:mypy]
deps =
commands_pre = poetry install --only main --only testenv --only mypy --sync
commands =
mypy black_it tests scripts examples
commands = make static

[testenv:black]
commands_pre = poetry install --only black --sync
commands = black .
commands = make black

[testenv:black-check]
commands_pre = poetry install --only black --sync
commands = black --check --verbose .
commands = make black-check

[testenv:ruff]
commands_pre = poetry install --only ruff --sync
commands = ruff check --fix --show-fixes .
commands = make ruff

[testenv:ruff-check]
commands_pre = poetry install --only ruff --sync
commands = ruff check .
commands = make ruff-check

[testenv:bandit]
skipsdist = True
commands_pre = poetry install --only bandit --sync
commands = bandit --configfile .bandit.yaml --recursive black_it tests scripts examples
commands = make bandit

[testenv:vulture]
skipsdist = True
commands_pre = poetry install --only vulture --sync
commands =
vulture black_it scripts/whitelists/package_whitelist.py
vulture examples scripts/whitelists/examples_whitelist.py
vulture tests scripts/whitelists/tests_whitelist.py
commands = make vulture

[testenv:darglint]
skipsdist = True
commands_pre = poetry install --only darglint --sync
commands = darglint black_it
commands = make darglint

[testenv:docs]
# From Poetry FAQ "Is tox supported?" (https://python-poetry.org/docs/faq/#use-case-2)
Expand All @@ -88,7 +86,7 @@ commands =

[testenv:check-copyright]
deps =
commands = python3 scripts/check_copyright.py
commands = make check-copyright

[testenv:spell_check]
deps =
Expand Down

0 comments on commit 379c280

Please sign in to comment.