-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
81 lines (73 loc) · 2.08 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
[tox]
envlist = py{312}, black, prospector, bandit, mypy, lintci, sedr
[testenv]
change_dir = app
description = Run unit tests
commands = python3 -m unittest
deps =
-r requirements.txt
-r requirements-dev.txt
[testenv:black]
description = Check code style
deps =
-r requirements.txt
-r requirements-dev.txt
commands = black --check .
skip_install = true
[testenv:prospector]
description = Run static analysis using prospector
deps =
-r requirements.txt
-r requirements-dev.txt
commands = prospector --no-autodetect \
--doc-warnings \
--test-warnings \
--zero-exit \
.
[testenv:mypy]
description = Check typing
deps =
-r requirements.txt
-r requirements-dev.txt
commands = mypy --follow-imports skip \
--ignore-missing-imports \
.
skip_install = true
[testenv:bandit]
description = Check for security issues
deps =
-r requirements.txt
-r requirements-dev.txt
commands = bandit --recursive .
skip_install = true
[testenv:sedr]
; Remember to update sedr version in .gitlab-ci.yml too
ignore_outcome = true
change_dir = app
description = WIP! Start app in background, wait for startup, run sedr to validate API, kill background process based on port number.
deps =
-r requirements.txt
-r requirements-dev.txt
allowlist_externals =
bash
docker
commands_pre = bash -c 'python app.py &> app.log & sleep 10'
commands = docker run --tty=true --network=host --rm -v .:/logs ghcr.io/metno/sedr:0.7.6 --log-file /logs/debug.log --openapi http://localhost:5000/api --url http://localhost:5000
commands_post = bash -c 'sleep 10 && kill $(lsof -t -i:5000)'
[testenv:lintci]
ignore_outcome = true
change_dir = {tox_root}
description = Lint gitlab-ci and github workflows
commands =
yamllint \
.gitlab-ci.yml \
.github/workflows/docker-image.yml \
.github/workflows/tests.yml \
.github/workflows/trivy.yml
deps =
-r requirements-dev.txt
[gh-actions]
# See https://pypi.org/project/tox-gh-actions/
python =
3.10: py310
3.12: py312, black, prospector, bandit, mypy, lintgitlab, sedr