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 bd6e264 commit 27bd518
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 @@ -9,7 +9,9 @@ envlist = bandit, check-copyright, black-check, vulture, mypy, py3{9,10,11,12},
basepython = python3

[testenv]
allowlist_externals = poetry
allowlist_externals =
make
poetry
skip_install = True
# From Poetry FAQ "Is tox supported?" (https://python-poetry.org/docs/faq/#use-case-2)
#
Expand Down Expand Up @@ -40,42 +42,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 Down Expand Up @@ -103,7 +101,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 27bd518

Please sign in to comment.