-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
91 lines (78 loc) · 2.01 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
[tox]
envlist = py312, flake8, isort, pylint, mypy, docs, black, bandit, jsonschema, vulture
skipsdist = True
[pytest]
asyncio_mode = auto
[flake8]
max-line-length = 120
ignore = D202, D203, D212, D213, D404, W503, ANN101
exclude = .git/, ./env/, ./venv/, ./.tox/, build/, metadata_backend.egg-info/, whitelist_dead_code.py
# Not using type hints in tests, ignore all errors
per-file-ignores =
tests/*:ANN
[testenv:docs]
deps =
.[docs]
commands = sphinx-build -W -c docs/ -b html docs/ docs/_build/html
sphinx-build -W -blinkcheck -d docs/_build/doctrees docs/ docs/_build/html
[testenv:flake8]
skip_install = true
deps =
flake8
flake8-docstrings
flake8-annotations
commands = flake8 .
[testenv:isort]
deps =
isort
commands = isort . --check --profile black
[testenv:pylint]
deps =
-rrequirements-dev.txt
commands =
pre-commit run pylint --all-files
[testenv:mypy]
skip_install = true
deps =
-rrequirements.txt
mypy
types-python-dateutil
types-ujson
types-requests
# Mypy fails if 3rd party library doesn't have type hints configured.
# Alternative to ignoring imports would be to write custom stub files, which
# could be done at some point.
commands = mypy --ignore-missing-imports metadata_backend/
[testenv:black]
skip_install = true
deps =
black
commands = black . -l 120 --check
[testenv:bandit]
skip_install = true
; plain search for known vulnerable code
deps =
bandit
commands = bandit -r metadata_backend/
[testenv:vulture]
skip_install = true
; plain search for dead code
deps =
vulture
commands = vulture metadata_backend/ whitelist_dead_code.py
[testenv]
deps =
.[test]
-rrequirements.txt
# Stop after first failure
commands = py.test -x --cov=metadata_backend -n auto tests/unit/
[testenv:jsonschema]
skip_install = true
deps =
pre-commit
commands =
pre-commit run check-metaschema --all-files
pre-commit run check-jsonschema --all-files
[gh-actions]
python =
3.12: black, isort, flake8, mypy, bandit, docs, jsonschema, py312, vulture