aboutsummaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini46
1 files changed, 32 insertions, 14 deletions
diff --git a/tox.ini b/tox.ini
index 66e9870..4080616 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,46 +1,64 @@
[flake8]
max-line-length = 100
exclude = fietsboek/alembic
+extend-ignore = E203
per-file-ignores =
fietsboek/models/__init__.py:F401
[tox]
-envlist = python,pylint,pylint-tests,flake8
+envlist = python,pylint,pylint-tests,flake,mypy,black
+# This can be removed in tox 4 as it will be the default:
isolated_build = true
[testenv]
-deps =
- pytest
- lxml: lxml
-extras = testing
+deps = poetry
+skip_install = true
passenv =
TERM
+commands_pre =
+ poetry install -v --with testing
commands =
pytest {posargs}
[testenv:pylint]
-deps = pylint
-usedevelop = true
+commands_pre =
+ poetry install -v --with linters
commands =
pylint --rcfile=pylint.toml fietsboek
[testenv:pylint-tests]
-deps = pylint
-usedevelop = true
allowlist_externals = bash
+commands_pre =
+ poetry install -v --with linters,testing
commands =
bash -c "pylint --rcfile=pylint.tests.toml tests/**/*.py"
-[testenv:flake8]
-deps = flake8
-usedevelop = true
+[testenv:flake]
+# This is a bit of a hack since flake8 specifies Python 3.8 as minimum required
+# version, while fietsboek only specifices 3.7. Thus, we manually install
+# flake8 via pip and bypass poetry's locking-
+commands_pre =
+ poetry install -v
+ pip install flake8
commands =
flake8 fietsboek
[testenv:sphinx]
-deps = sphinx
-usedevelop = true
allowlist_externals = make
changedir={toxinidir}{/}doc
+commands_pre =
+ poetry install -v --with docs
commands =
make html
+
+[testenv:mypy]
+commands_pre =
+ poetry install --with types
+commands =
+ mypy fietsboek
+
+[testenv:black]
+deps = black
+commands_pre =
+commands =
+ black --diff --check fietsboek