-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cfg
120 lines (110 loc) · 3.36 KB
/
setup.cfg
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
115
116
117
118
119
120
[tox:tox]
envlist =
tests
typing
linter
[testenv]
basepython = python3.12
skip_install = true
install_command = python -m pip --disable-pip-version-check install {opts} {packages}
[testenv:tests-debug]
deps =
-r requirements.txt
commands =
pip install --upgrade pip
python3 -m unittest discover tests -v
[testenv:coverage]
allowlist_externals = bash
deps =
-r requirements.txt
coverage
coverage-badge
anybadge
commands =
bash -ec 'mkdir -p artifacts/coverage'
pip install --upgrade pip
coverage run --source=. -m unittest discover -s tests
coverage html --directory=artifacts/coverage
bash -ec 'NA=$(python setup.py --name); coverage-badge > artifacts/$NA-coverage.svg'
bash -ec 'NA=$(python setup.py --name); VE=$(python setup.py --version); anybadge --label=$NA --value=$VE --file=artifacts/$NA-badge.svg \
--color=green --overwrite'
[testenv:typing]
deps =
-r requirements.txt
mypy-extensions==1.0.0
mypy==1.7.1
typed-ast==1.5.5
typing-extensions==4.9.0
commands =
pip install --upgrade pip
mypy .
[testenv:linter]
deps =
-r requirements.txt
flake8
flake8-bugbear
flake8-docstrings>=1.3.1
flake8-typing-imports>=1.1
pep8-naming
commands =
flake8 .
[mypy]
strict_optional = False
warn_no_return = False
warn_unused_ignores = True
ignore_missing_imports = True
install_types = true
non_interactive = true
exclude = setup.py|tests/|venv
disallow_untyped_defs = True
disallow_incomplete_defs = True
check_untyped_defs = True
[mypy-web.*,cache.*]
disallow_untyped_defs = False
disallow_incomplete_defs = False
check_untyped_defs = False
[flake8]
min_python_version = 3.12.0
max-complexity = 10
max-line-length = 120
# Ignore some flake8-docstrings errors
# D100 - Missing docstring in public module
# D104 - Missing docstring in public package
# D105 - Missing docstring in magic method
# D107 - Missing docstring in __init__
# D200 - One-line docstring should fit on one line with quotes
# D205 - 1 blank line required between summary line and description
# D400 - First line should end with a period
# D401 - First line should be in imperative mood
# W503 - Line break occurred before a binary operator
# E266 - About ### in test assertions
# N818 - Exception should be named with an Error suffix
# C901 - Function is too complex
# B019 - Use of `functools.lru_cache` or `functools.cache` on class methods can lead to memory leaks.
# D102 - Missing docstring in public method
# B012 - return/continue/break inside finally blocks cause exceptions to be silenced.
# D103 - Missing docstring in public function
# N805 - first argument of a method should be named 'self'
# E721 - do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
# ignore = D100, D104, D105, D107, D200, D205, D400, D401, D401, W503, E266, N818, B019, C901, D102, B012, D103, D101, N805, E721
ignore = D100, D101, D102, D104, D105, D107, D401
exclude =
.tox,
.git,
__pycache__,
build,
dist,
venv,
venv39,
tests/fixtures/*,
*.pyc,
*.egg-info,
.cache,
.eggs,
exper*.py
# Per file ignores
# N803 - argument name 'UserManager_mock' should be lowercase
# N806 - variable 'ControllerRedfish_mock' in function should be lowercase
# B017 - assertRaises(Exception): should be considered evil
# per-file-ignores =
# tests/*: N803,N806,E501,N816,B017