Skip to content

Commit

Permalink
provo a installare ambienti più minimali. Questo potrebbe ridurre la …
Browse files Browse the repository at this point in the history
…durata dei test

Qualora funzioni, splittare il changeset.
  • Loading branch information
muxator committed Sep 17, 2024
1 parent e703f3a commit 70c81aa
Showing 1 changed file with 11 additions and 30 deletions.
41 changes: 11 additions & 30 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[tox]
allowlist_externals = poetry
isolated_build = True
envlist = bandit, check-copyright, black-check, vulture, mypy, py3{9,10,11,12}, docs
skip_install = True

[tox:.package]
# note tox will use the same python version as under what tox is installed to package
Expand All @@ -15,12 +17,11 @@ basepython = python3
# a fresh environment. Thus, dependencies are resolved by pip in the first
# place. But afterward we run Poetry, which will install the locked dependencies
# into the environment.
allowlist_externals = poetry
setenv =
PYTHONPATH = {toxinidir}
commands_pre =
poetry install --no-root --sync
poetry install --only testenv

[testenv:py{39,310,311,312}]
commands_pre = poetry install --only main --only testenv --sync
commands =
poetry run pytest \
--basetemp={envtmpdir} \
Expand All @@ -32,10 +33,6 @@ commands =
--cov-report=html \
--cov-report=term {posargs}

[testenv:py{39,310,311,312}]
commands =
{[testenv]commands}

# test environment for notebooks
[testenv:py{39,310,311,312}-nb]
deps =
Expand All @@ -57,27 +54,19 @@ commands =
mypy black_it tests scripts examples

[testenv:black]
allowlist_externals = poetry
skip_install = True
commands_pre = poetry install --only black
commands_pre = poetry install --only black --sync
commands = black .

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

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

[testenv:ruff-check]
allowlist_externals = poetry
skip_install = True
commands_pre = poetry install --only ruff
commands_pre = poetry install --only ruff --sync
commands = ruff check .

[testenv:bandit]
Expand Down Expand Up @@ -109,10 +98,7 @@ commands = darglint black_it
# a fresh environment. Thus, dependencies are resolved by pip in the first
# place. But afterward we run Poetry, which will install the locked dependencies
# into the environment.
allowlist_externals = poetry
commands_pre =
poetry install --no-root --sync
poetry install --only docs
commands_pre = poetry install --only main --only docs --sync
commands =
poetry run mkdocs build --clean

Expand All @@ -123,22 +109,17 @@ commands =
# a fresh environment. Thus, dependencies are resolved by pip in the first
# place. But afterward we run Poetry, which will install the locked dependencies
# into the environment.
allowlist_externals = poetry
commands_pre =
poetry install --no-root --sync
poetry install --only docs
commands_pre = poetry install --only main --only docs --sync
commands =
poetry run mkdocs build --clean
python -c 'print("###### Starting local server. Press Control+C to stop server ######")'
poetry run mkdocs serve

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

[testenv:spell_check]
skip_install = True
deps =
allowlist_externals = {toxinidir}/scripts/spell-check.sh
commands = {toxinidir}/scripts/spell-check.sh --report

0 comments on commit 70c81aa

Please sign in to comment.