-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.cfg
232 lines (210 loc) · 5.59 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
[metadata]
name = sebastes
version = 0.1.4
url = https://github.com/YADRO-KNS/sebastes
license = MIT License
author = Sergey Parshin
author_email = [email protected]
description = Pydantic library code generator for Redfish targets
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
Development Status :: 4 - Beta
Programming Language :: Python :: 3.9
License :: OSI Approved :: MIT License
Operating System :: Unix
[options]
include_package_data = true
python_requires = >= 3.9
[options.entry_points]
console_scripts =
sebastes = sebastes.__main__:main
[tox:tox]
envlist =
tests
coverage
typing
linter
[testenv]
basepython = python3.9
skip_install = true
install_command = python -m pip --disable-pip-version-check install {opts} {packages}
[testenv:tests]
whitelist_externals = /bin/bash
deps =
-r requirements.txt
unittest-xml-reporting
commands =
bash -ec 'mkdir -p artifacts/tests'
pip install --upgrade pip
python3 -m xmlrunner discover tests -v -o artifacts/tests
[testenv:tests-debug]
deps =
-r requirements.txt
commands =
pip install --upgrade pip
python3 -m unittest discover tests -v
[testenv:coverage]
whitelist_externals = /bin/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]
whitelist_externals = /bin/bash
deps =
-r requirements.txt
mypy-extensions==0.4.3
mypy==0.910
typed-ast==1.4.3
typing-extensions==3.10.0.0
mypy2junit
commands =
bash -ec 'mkdir -p artifacts/typing'
pip install --upgrade pip
- bash -ec 'mypy --no-strict-optional --no-warn-no-return --warn-unused-ignores --ignore-missing-imports --install-types \
--non-interactive --exclude "(setup.py|tests|venv)" . 2> artifacts/typing/mypy.txt'
bash -ec 'mypy2junit artifacts/typing/mypy.txt > artifacts/typing/mypy_junit.xml'
[testenv:typing-debug]
deps =
-r requirements.txt
mypy-extensions==0.4.3
mypy==0.910
typed-ast==1.4.3
typing-extensions==3.10.0.0
commands =
pip install --upgrade pip
mypy .
[testenv:linter]
whitelist_externals = /bin/bash
deps =
-r requirements.txt
flake8
flake8-bugbear
flake8-docstrings>=1.3.1
flake8-typing-imports>=1.1
pep8-naming
flake8-formatter-junit-xml
commands =
bash -ec 'mkdir -p artifacts/linter'
bash -ec 'flake8 --format junit-xml . > artifacts/linter/flake_junit.xml'
[testenv:linter-debug]
deps =
-r requirements.txt
flake8
flake8-bugbear
flake8-docstrings>=1.3.1
flake8-typing-imports>=1.1
pep8-naming
commands =
flake8 .
[testenv:build]
skip_install = true
deps =
wheel
setuptools
commands =
python setup.py -q sdist bdist_wheel
[testenv:release]
skip_install = true
deps =
{[testenv:build]deps}
twine >= 1.5.0
commands =
{[testenv:build]commands}
twine upload --skip-existing dist/*
[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.9.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
ignore = D100, D104, D105, D107, D200, D205, D400, D401, D401, W503, E266, N818
exclude =
.tox,
.git,
__pycache__,
build,
dist,
venv,
venv39,
tests/fixtures/*,
*.pyc,
*.egg-info,
.cache,
.eggs
# Per file ignores
# E126 - continuation line over-indented for hanging indent
# E131 - continuation line unaligned for hanging indent
# E704 - Multiple statements on one line (def)
# N802 - function name 'test_is_subclass_of_ControllerVegman' should be lowercase
# N803 - argument name 'UserManager_mock' should be lowercase
# N806 - variable 'ControllerRedfish_mock' in function should be lowercase
per-file-ignores =
tests/*: N802,N803,N806
[coverage:run]
branch = True
omit =
*/setup.py
*/app.py
*/.tox/*
*/.git/*
*/tests/*
*venv*
*/site-packages/*
*/distutils/*
*/usr/local/lib*
*__init__.py*
[coverage:report]
omit =
*/migrator/migrations/*
*/setup.py
*/app.py
*/.tox/*
*/.git/*
*/tests/*
*venv*
*/site-packages/*
*/distutils/*
*/usr/local/lib*
*__init__.py*
# Regexes for lines to exclude from consideration
exclude_lines = pass
ignore_errors = True
[coverage:html]
directory = coverage_html_report