-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
74 lines (65 loc) · 2.17 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
[tox]
isolated_build = true
envlist = py39,py310,py311,lint,typing,requirements,precommit,test
skipsdist = true
[testenv]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt
[testenv:lint]
deps = pre-commit
setenv =
BLACK_CACHE_DIR = ~/.cache/black/
commands =
pre-commit run flake8 --all-files --show-diff-on-failure
pre-commit run isort --all-files --show-diff-on-failure
pre-commit run black --all-files --show-diff-on-failure
pre-commit run bandit --all-files --show-diff-on-failure
[testenv:typing]
setenv =
MYPY_CACHE_DIR = {toxinidir}/.mypy_cache
commands =
# Exclude tests for now as mocking and using pretend often leads to many
# mypy warnings.
mypy --exclude tests/ .
[run]
omit = tests/*
[testenv:test]
allowlist_externals = coverage
commands =
python -m pytest --cov-report=xml --cov-report=term --cov-config=tox.ini --cov -n auto -vv tests/
[testenv:requirements]
description="Check if `make requirements` is up-to-date."
deps = pipenv
skipsdist=false
allowlist_externals =
bash
commands =
pipenv --version
bash -c 'diff -w requirements.txt <(pipenv requirements)'
bash -c 'diff -w requirements-dev.txt <(pipenv requirements --dev)'
[testenv:precommit]
description="Check if `pre-commit autoupdate` is up-to-date."
deps = pre-commit
skipsdist=false
allowlist_externals =
bash
commands =
pre-commit --version
bash -c 'cp .pre-commit-config.yaml tmp-tox-precommit.yaml'
bash -c 'pre-commit autoupdate'
bash -c 'if ! diff -w .pre-commit-config.yaml tmp-tox-precommit.yaml; \
then echo "⚠️ [WARNING] pre-commit hooks are outdated"; fi'
bash -c 'rm tmp-tox-precommit.yaml'
[testenv:docs]
deps = -r{toxinidir}/docs/requirements.txt
allowlist_externals =
plantuml
commands =
plantuml -o ../source/_static/ -tpng docs/diagrams/*.puml
sphinx-apidoc -f -o docs/source/devel/ repository_service_tuf
sphinx-build -E -W -b html docs/source docs/build/html
[gh-actions]
python =
3.9: py39,pep8,lint,typing,requirements,precommit,test,docs
3.10: py310,pep8,lint,typing,requirements,precommit,test,docs
3.11: py311,pep8,lint,typing,requirements,precommit,test,docs