-
Notifications
You must be signed in to change notification settings - Fork 29
/
pyproject.toml
287 lines (268 loc) · 11.1 KB
/
pyproject.toml
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools >= 65.3.0", # required by pyproject+setuptools_scm integration and editable installs
"setuptools_scm[toml] >= 7.0.5" # required for "no-local-version" scheme
]
[project]
authors = [{"email" = "[email protected]", "name" = "Bradley A. Thornton"}]
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python',
'Topic :: Software Development',
'Topic :: Utilities'
]
description = "Ansible Developtment Tools kit bundles all tools needed for content creation and testing."
dynamic = ["dependencies", "optional-dependencies", "version"]
keywords = ["ansible"]
license = {text = "GPL-3.0-only"}
maintainers = [{"email" = "[email protected]", "name" = "Ansible by Red Hat"}]
name = "ansible-dev-tools"
readme = "README.md"
requires-python = ">=3.10"
[project.scripts]
adt = "ansible_dev_tools.cli:main"
[project.urls]
changelog = "https://github.com/ansible/ansible-dev-tools/releases"
documentation = "https://ansible.readthedocs.io/projects/dev-tools/"
homepage = "https://github.com/ansible/ansible-dev-tools"
repository = "https://github.com/ansible/ansible-dev-tools"
[tool.mypy]
files = ["src", "tests"]
strict = true
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = ["gunicorn.*", "openapi_core.*"]
[tool.pydoclint]
allow-init-docstring = true
arg-type-hints-in-docstring = false
check-return-types = false
style = 'google'
[tool.pylint]
[tool.pylint.format]
max-line-length = 100
[tool.pylint.master]
good-names = "i,j,k,ex,Run,_,f,fh"
ignore = [
"_version.py" # built by setuptools_scm
]
jobs = 0
no-docstring-rgx = "__.*__"
[tool.pylint.messages_control]
disable = [
# https://gist.github.com/cidrblock/ec3412bacfeb34dbc2d334c1d53bef83
"C0103", # invalid-name / ruff N815
"C0105", # typevar-name-incorrect-variance / ruff PLC0105
"C0112", # empty-docstring / ruff D419
"C0113", # unneeded-not / ruff SIM208
"C0114", # missing-module-docstring / ruff D100
"C0115", # missing-class-docstring / ruff D101
"C0116", # missing-function-docstring / ruff D103
"C0121", # singleton-comparison / ruff PLC0121
"C0123", # unidiomatic-typecheck / ruff E721
"C0131", # typevar-double-variance / ruff PLC0131
"C0132", # typevar-name-mismatch / ruff PLC0132
# "C0198", # bad-docstring-quotes / ruff Q002
# "C0199", # docstring-first-line-empty / ruff D210
"C0201", # consider-iterating-dictionary / ruff SIM118
"C0202", # bad-classmethod-argument / ruff PLC0202
"C0205", # single-string-used-for-slots / ruff PLC0205
"C0208", # use-sequence-for-iteration / ruff PLC0208
"C0301", # line-too-long / ruff E501
"C0304", # missing-final-newline / ruff W292
"C0321", # multiple-statements / ruff PLC0321
"C0325", # superfluous-parens / ruff UP034
"C0410", # multiple-imports / ruff E401
"C0411", # wrong-import-order / ruff I001
"C0412", # ungrouped-imports / ruff I001
"C0413", # wrong-import-position / ruff E402
"C0414", # useless-import-alias / ruff PLC0414
# "C0501", # consider-using-any-or-all / ruff PLC0501
# "C1901", # compare-to-empty-string / ruff PLC1901
# "C2201", # misplaced-comparison-constant / ruff SIM300
"C3001", # unnecessary-lambda-assignment / ruff PLC3001
"C3002", # unnecessary-direct-lambda-call / ruff PLC3002
"E0001", # syntax-error / ruff E999
"E0101", # return-in-init / ruff PLE0101
"E0102", # function-redefined / ruff F811
"E0103", # not-in-loop / ruff PLE0103
"E0104", # return-outside-function / ruff F706
"E0105", # yield-outside-function / ruff F704
"E0107", # nonexistent-operator / ruff B002
"E0112", # too-many-star-expressions / ruff F622
"E0116", # continue-in-finally / ruff PLE0116
"E0117", # nonlocal-without-binding / ruff PLE0117
"E0118", # used-prior-global-declaration / ruff PLE0118
"E0211", # no-method-argument / ruff N805
"E0213", # no-self-argument / ruff N805
"E0241", # duplicate-bases / ruff PLE0241
"E0302", # unexpected-special-method-signature / ruff PLE0302
"E0602", # undefined-variable / ruff F821
"E0603", # undefined-all-variable / ruff F822
"E0604", # invalid-all-object / ruff PLE0604
"E0605", # invalid-all-format / ruff PLE0605
"E0711", # notimplemented-raised / ruff F901
"E1142", # await-outside-async / ruff PLE1142
"E1205", # logging-too-many-args / ruff PLE1205
"E1206", # logging-too-few-args / ruff PLE1206
"E1301", # truncated-format-string / ruff F501
"E1302", # mixed-format-string / ruff F506
"E1303", # format-needs-mapping / ruff F502
"E1304", # missing-format-string-key / ruff F524
"E1305", # too-many-format-args / ruff F522
"E1306", # too-few-format-args / ruff F524
"E1307", # bad-string-format-type / ruff PLE1307
"E1310", # bad-str-strip-call / ruff PLE1310
"E1700", # yield-inside-async-function / ruff PLE1700
"E2502", # bidirectional-unicode / ruff PLE2502
"E2510", # invalid-character-backspace / ruff PLE2510
"E2512", # invalid-character-sub / ruff PLE2512
"E2513", # invalid-character-esc / ruff PLE2513
"E2514", # invalid-character-nul / ruff PLE2514
"E2515", # invalid-character-zero-width-space / ruff PLE2515
"R0123", # literal-comparison / ruff F632
"R0124", # comparison-with-itself / ruff PLR0124
"R0133", # comparison-of-constants / ruff PLR0133
"R0205", # useless-object-inheritance / ruff UP004
"R0206", # property-with-parameters / ruff PLR0206
"R0911", # too-many-return-statements / ruff PLR0911
"R0912", # too-many-branches / ruff PLR0912
"R0913", # too-many-arguments / ruff PLR0913
"R0915", # too-many-statements / ruff PLR0915
# "R1260", # too-complex / ruff C901
"R1701", # consider-merging-isinstance / ruff PLR1701
"R1705", # no-else-return / ruff RET505
"R1706", # consider-using-ternary / ruff SIM108
"R1707", # trailing-comma-tuple / ruff COM818
"R1710", # inconsistent-return-statements / ruff PLR1710
"R1711", # useless-return / ruff PLR1711
"R1714", # consider-using-in / ruff PLR1714
"R1715", # consider-using-get / ruff SIM401
"R1717", # consider-using-dict-comprehension / ruff C402
"R1718", # consider-using-set-comprehension / ruff C401
"R1720", # no-else-raise / ruff RET506
"R1721", # unnecessary-comprehension / ruff PLR1721
"R1722", # consider-using-sys-exit / ruff PLR1722
"R1723", # no-else-break / ruff RET508
"R1724", # no-else-continue / ruff RET507
"R1725", # super-with-arguments / ruff UP008
"R1728", # consider-using-generator / ruff C417
"R1729", # use-a-generator / ruff C417
"R1734", # use-list-literal / ruff C405
"R1735", # use-dict-literal / ruff C406
# "R2004", # magic-value-comparison / ruff PLR2004
# "R5501", # else-if-used / ruff PLR5501
# "R6002", # consider-using-alias / ruff UP006
# "R6003", # consider-alternative-union-syntax / ruff UP007
"W0102", # dangerous-default-value / ruff B006
"W0104", # pointless-statement / ruff B018
"W0106", # expression-not-assigned / ruff B018
"W0107", # unnecessary-pass / ruff PLW0107
"W0109", # duplicate-key / ruff F601
"W0120", # useless-else-on-loop / ruff PLW0120
"W0122", # exec-used / ruff S102
"W0123", # eval-used / ruff PGH001
"W0127", # self-assigning-variable / ruff PLW0127
"W0129", # assert-on-string-literal / ruff PLW0129
"W0130", # duplicate-value / ruff PLW0130
"W0131", # named-expr-without-context / ruff PLW0131
"W0150", # lost-exception / ruff B012
# "W0160", # consider-ternary-expression / ruff SIM108
"W0199", # assert-on-tuple / ruff F631
"W0301", # unnecessary-semicolon / ruff E703
"W0401", # wildcard-import / ruff F403
"W0406", # import-self / ruff PLW0406
"W0410", # misplaced-future / ruff F404
"W0511", # fixme / ruff PLW0511
"W0602", # global-variable-not-assigned / ruff PLW0602
"W0603", # global-statement / ruff PLW0603
"W0611", # unused-import / ruff F401
"W0612", # unused-variable / ruff F841
"W0613", # unused-argument / ruff ARG001
"W0622", # redefined-builtin / ruff A001
"W0640", # cell-var-from-loop / ruff B023
"W0702", # bare-except / ruff E722
"W0705", # duplicate-except / ruff B014
"W0706", # try-except-raise / ruff TRY302
"W0707", # raise-missing-from / ruff TRY200
"W0711", # binary-op-exception / ruff PLW0711
"W0718", # broad-exception-caught / ruff PLW0718
"W1113", # keyword-arg-before-vararg / ruff B026
"W1201", # logging-not-lazy / ruff G
"W1202", # logging-format-interpolation / ruff G
"W1203", # logging-fstring-interpolation / ruff G
"W1300", # bad-format-string-key / ruff PLW1300
"W1301", # unused-format-string-key / ruff F504
"W1302", # bad-format-string / ruff PLW1302
"W1303", # missing-format-argument-key / ruff F524
"W1304", # unused-format-string-argument / ruff F507
"W1305", # format-combined-specification / ruff F525
"W1308", # duplicate-string-formatting-argument / ruff PLW1308
"W1309", # f-string-without-interpolation / ruff F541
"W1310", # format-string-without-interpolation / ruff PLW1310
"W1401", # anomalous-backslash-in-string / ruff W605
"W1404", # implicit-str-concat / ruff ISC001
"W1405", # inconsistent-quotes / ruff Q000
"W1508", # invalid-envvar-default / ruff PLW1508
"W1509", # subprocess-popen-preexec-fn / ruff PLW1509
"W1510", # subprocess-run-check / ruff PLW1510
"W1515", # forgotten-debug-statement / ruff T100
# "W1641", # eq-without-hash / ruff PLW1641
# "W2901", # redefined-loop-name / ruff PLW2901
# "W3201", # bad-dunder-name / ruff PLW3201
"W3301", # nested-min-max / ruff PLW3301
"duplicate-code",
"fixme",
"too-few-public-methods",
"unsubscriptable-object"
]
[tool.pytest.ini_options]
addopts = "-p no:pytest-ansible"
[tool.ruff]
builtins = ["__"]
fix = true
line-length = 100
select = ["ALL"]
target-version = "py310"
[tool.ruff.flake8-pytest-style]
parametrize-values-type = "tuple"
[tool.ruff.isort]
lines-after-imports = 2 # Ensures consistency for cases when there's variable vs function/class definitions after imports
lines-between-types = 1 # Separate import/from with 1 line
[tool.ruff.per-file-ignores]
# S101 Allow assert in tests
# S602 Allow shell in test
# T201 Allow print in tests
"tests/**" = ["S101", "S602", "T201"]
[tool.ruff.pydocstyle]
convention = "google"
[tool.setuptools.dynamic]
dependencies = {file = [".config/requirements.in"]}
optional-dependencies.docs = {file = [".config/requirements-docs.in"]}
optional-dependencies.test = {file = [".config/requirements-test.in"]}
optional-dependencies.server = {file = [".config/requirements-server.in"]}
[tool.setuptools_scm]
# To prevent accidental pick of mobile version tags such 'v6'
git_describe_command = [
"git",
"describe",
"--dirty",
"--long",
"--tags",
"--match",
"v*.*"
]
local_scheme = "no-local-version"
tag_regex = '^(?P<prefix>v)?(?P<version>[^\+]+)(?P<suffix>.*)?$'
write_to = "src/ansible_dev_tools/_version.py"
[tool.tomlsort]
in_place = true