-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
114 lines (102 loc) · 2.58 KB
/
tox.ini
File metadata and controls
114 lines (102 loc) · 2.58 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
[tox]
minversion = 3.24.5
envlist = py39, py310, py311, py312, lint, isort, black, fix, coverage, bandit
[gh-actions]
python =
3.9: py39
3.10 : py310
3.11 : py311
3.12 : py312
[testenv]
setenv =
PYTHONPATH = {toxinidir}/src:{toxinidir}/tests
deps =
pytest
pytest-cov
commands =
pytest --import-mode=importlib \
--cov=ndict_tools \
--cov-report=term-missing \
--cov-report=xml:coverage/coverage.xml \
--cov-report=html:coverage/coverage_html tests
[testenv:lint]
description = Lint the code with flake8
deps =
flake8
commands =
flake8 src tests
[testenv:isort]
description = Check import sorting with isort
deps =
isort
commands =
isort --check-only --diff src
[testenv:black]
description = Check code formatting with black
deps =
black
commands =
black --check src
[testenv:fix]
description = Auto-fix formatting of package code (tests are excludes) issues using Black and isort
deps =
black
isort
commands =
black src
isort src
[testenv:coverage]
description = Generate code coverage report
deps =
pytest
pytest-cov
commands =
pytest --cov=src --cov-report=term-missing --cov-report=xml:coverage/coverage.xml --cov-report=html:coverage/coverage_html tests
[testenv:bandit]
description = Run security analysis with bandit
deps =
bandit
commands =
bandit -r src
[testenv:local]
description = Run checks on local environment with black, isort and bandit, the coverage with tests
deps =
-r requirements.test.txt
commands =
# Fix formatting
black src tests
isort src tests
# Security checks
bandit -r src
# Coverage testing
pytest --import-mode=importlib --cov=ndict_tools --cov-report=term-missing --cov-report=xml:coverage/coverage.xml --cov-report=html:coverage/coverage_html tests
[testenv:gh-ci]
description = Run checks pytest with coverage in GitHub CI environment
deps =
-r requirements.test.txt
commands =
# Vérification du formatage (sans correction)
black --check src
isort --check-only src
# Analyse de sécurité
# bandit -r src
# Tests avec couverture
pytest --import-mode=importlib --cov=ndict_tools --cov-report=term-missing --cov-report=xml:coverage/coverage.xml --cov-report=html:coverage/coverage_html tests
[flake8]
# Configuration pour flake8
max-line-length = 88
ignore = E501
extend-ignore = E203, W503
exclude =
.tox,
.git,
__pycache__,
build,
dist
[isort]
# Configuration pour isort
profile = black
line_length = 88
known_first_party = src
multi_line_output = 3
include_trailing_comma = true