forked from teemtee/tmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
376 lines (340 loc) · 10.7 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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "tmt"
dynamic = ["version"]
description = "Test Management Tool"
readme = "README.rst"
license = "MIT"
license-files = { paths = ["LICENSE"] }
requires-python = ">=3.9"
authors = [
{ name = "Petr Splichal", email = "[email protected]" },
]
maintainers = [
{ name = "Petr Splichal", email = "[email protected]" },
]
keywords = [
"metadata",
"testing",
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.11",
"Topic :: Utilities",
"Topic :: Software Development :: Testing",
"Operating System :: POSIX :: Linux",
]
dependencies = [ # F39 / PyPI
"click>=8.0.3,!=8.1.4", # 8.1.3 / 8.1.6 TODO type annotations tmt.cli.Context -> click.core.Context click/issues/2558
"docutils>=0.16", # 0.16 is the current one available for RHEL9
"fmf>=1.3.0",
"jinja2>=2.11.3", # 3.1.2 / 3.1.2
"pint>=0.16.1,<0.20", # 0.16.1 / 0.19.x TODO: Pint 0.20 requires larger changes to tmt.hardware
"pygments>=2.7.4", # 2.7.4 is the current one available for RHEL9
"requests>=2.25.1", # 2.28.2 / 2.31.0
"ruamel.yaml>=0.16.6", # 0.17.32 / 0.17.32
"urllib3>=1.26.5, <3.0", # 1.26.16 / 2.0.4
]
[project.optional-dependencies]
test-convert = [
"html2text>=2020.1.16",
"markdown>=3.3.4",
"nitrate>=1.8.2",
"python-bugzilla>=3.2.0",
]
export-polarion = [
"pylero>=0.0.8",
]
provision-beaker = [
"mrack>=1.15.1",
]
provision-virtual = [
"testcloud>=0.9.10",
]
provision-container = []
report-junit = [
"junit_xml>=1.9",
]
report-polarion = [
"tmt[report-junit]",
"tmt[export-polarion]",
]
all = [
"tmt[test-convert]",
"tmt[export-polarion]",
"tmt[provision-container]",
"tmt[provision-virtual]",
"tmt[provision-beaker]",
"tmt[report-junit]",
"tmt[report-polarion]",
]
# Needed for readthedocs and man page build. Not being packaged in rpm.
docs = [
"renku-sphinx-theme==0.3.0",
"readthedocs-sphinx-ext",
"docutils>=0.18.1",
"fmf>=1.3.0",
]
[project.scripts]
tmt = "tmt.__main__:run_cli"
[project.urls]
Homepage = "https://github.com/teemtee/tmt"
[tool.hatch.version]
source = "vcs"
raw-options.version_scheme = "release-branch-semver"
[tool.hatch.build.targets.sdist]
include = [
"/tmt",
"/LICENSE",
"/examples",
"/README.rst",
"/tests",
"/tmt.spec",
"/tmt.1",
"/completions",
"/.fmf",
]
artifacts = ["tmt.1"]
[tool.hatch.envs.default]
platforms = ["linux"]
[tool.hatch.envs.dev]
description = "Development environment"
dependencies = [
"typing-extensions>=4.4.0; python_version < '3.10'", # TypeAlias introduced in 3.10, Self in 3.11
"autopep8",
"ruff",
"mypy",
"pytest",
"python-coveralls",
"pytest-container",
"pytest-xdist",
"requre",
"yq==3.1.1",
"pre-commit",
# Do not install *types-click* - it's not recommended with Click 8 & newer,
# which is the version a developer encounters given the requirements are not
# frozen.
"types-Markdown",
# prevent conflict between types-requests and urllib3
"types-requests<2.31.0.7; python_version < '3.10'",
"types-requests; python_version >= '3.10'",
"types-setuptools",
"types-jsonschema",
"types-urllib3",
"types-jinja2",
"types-babel",
"types-docutils",
]
features = ["all"]
[tool.hatch.envs.dev.scripts]
lint = ["autopep8 {args:.}", "ruff --fix {args:.}"]
type = ["mypy {args:tmt}"]
check = ["lint", "type"]
unit = "make images-tests && pytest -vvv -ra --showlocals -n 0 tests/unit"
smoke = "pytest -vvv -ra --showlocals -n 0 tests/unit/test_cli.py"
cov = [
"coverage run --source=tmt -m pytest -vvv -ra --showlocals -n 0 tests",
"coverage report",
"coverage annotate",
]
requre = [
"cd {root}/tests/integration",
"pytest -vvv -ra --showlocals -n 0",
"requre-patch purge --replaces :milestone_url:str:SomeText --replaces :latency:float:0 tests/integration/test_data/test_nitrate/*",
]
[tool.hatch.envs.dev-not-editable]
template = "dev"
description = "Same as 'dev', but not using editable install"
dev-mode = false
[tool.hatch.envs.test]
template = "dev"
description = "Run scripts with multiple Python versions"
[[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.11", "3.12"]
[tool.hatch.envs.docs]
dependencies = ["tmt[docs]"]
[tool.hatch.envs.docs.scripts]
# Note that in RTD there are a few additional flags (from RTD's default build
# script) e.g. -E, -d, and -D. These should not affect generated documentation
# files below, but it may be providing additional metadata for RTD to index.
html = "sphinx-build -b html {root}/docs {root}/docs/_build {args}"
man = [
"cp {root}/docs/header.txt {root}/man.rst",
"tail -n+8 docs/overview.rst >> {root}/man.rst",
# TODO rst2man cannot process this directive, removed for now
"sed '/versionadded::/d' -i {root}/man.rst",
"rst2man.py {root}/man.rst > {root}/tmt.1",
"rm -f {root}/man.rst",
]
[dirs.env]
virtual = ".venv"
[tool.mypy]
# Be vewy, vewy stwict, we'we hunting wabbits^Wbugs.
strict = true
# Automagically make imported object part of mypy's view of module's namespace.
implicit_reexport = true
# Make error messages more rich, this helps better targeted waivers.
show_error_codes = true
# Allow mypy to follow imports to get correct picture of type
# annotations across module boundaries.
follow_imports = "normal"
python_version = "3.9"
files = ["tmt/"]
[[tool.mypy.overrides]]
module = [
"bugzilla.*",
"gssapi.*",
"guestfs.*",
"html2text.*",
"fmf.*",
"junit_xml.*",
"libvirt.*",
"nitrate.*",
"pylero.*",
"testcloud.*",
"mrack.*",
]
ignore_missing_imports = true
[tool.pyright]
include = [
"tmt/**/*.py",
]
ignore = [
"docs/**",
"examples/**",
"tests/**",
"tmt/export/*.py",
"tmt/plugins/*.py",
"tmt/steps/*.py",
"tmt/steps/discover/*.py",
"tmt/steps/execute/*.py",
"tmt/steps/finish/*.py",
"tmt/steps/prepare/distgit.py",
"tmt/steps/prepare/feature.py",
"tmt/steps/prepare/__init__.py",
"tmt/steps/prepare/install.py",
"tmt/steps/prepare/shell.py",
"tmt/steps/provision/*.py",
"tmt/steps/report/__init__.py",
"tmt/steps/report/polarion.py",
"tmt/steps/report/reportportal.py",
"tmt/__init__.py",
"tmt/base.py",
"tmt/convert.py",
"tmt/lint.py",
"tmt/queue.py",
"tmt/trying.py",
"tmt/utils.py"
]
pythonVersion = "3.9"
pythonPlatform = "Linux"
# Be vewy, vewy stwict, we'we hunting wabbits^Wbugs.
typeCheckingMode = "strict"
# Kicking off with some common issues we put aside for now. We might re-enable
# these checks later, or not, but for now they are not useful.
reportMissingTypeStubs = false # Stub file not found for "foo.bar"
reportPrivateUsage = false
reportUnknownMemberType = false
reportUnnecessaryCast = false # Unnecessary "cast" call; type is already...
[tool.autopep8]
max_line_length = 99
in-place = true
recursive = true
hang-closing = true
aggressive = 2
[tool.pep8]
max-line-length = "99"
[tool.ruff]
line-length = 99
src = ["tmt", "tests"]
target-version = "py39"
lint.select = [
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle
"I", # isort
"N", # pep8-naming
"D", # pydocstyle
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"YTT", # flake8-2020
"PT", # flake8-pytest-style
"RET", # flake8-return
"SIM", # flake8-simplify
"COM", # flake8-commas
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EXE", # flake8-executable
"PIE", # flake8-pie
"RSE", # flake8-raise
"PGH", # pygrep-hooks
"PLC", # pylint-convention
"PLE", # pylint-error
"PLR01", # pylint-refactor
"PLR02",
"PLR04",
"PLR1",
"RUF", # ruff
"D", # pydocstyle
]
lint.ignore = [
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ...
"COM812", # Trailing comma missing
# tmt codebase uses `warn` by default - disabling the check, switching to
# `warning` can be done in an extra patch.
"G010", # `warn` is deprecated in favor of `warning`
"PIE790", # Unnecessary `pass` statement
"PLC1901", # `{}` can be simplified to `{}` as an empty string is falsey
"PLE1205", # Too many arguments for `logging` format string
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"RUF013", # PEP 484 prohibits implicit `Optional`
# pydocstyle
# TODO: the permanent list (drop this comment once the temporary list
# below gets to zero items...)
"D203", # 1 blank line required before class docstring
# TODO: the temporary list - some of these will be enabled in their
# own patches
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in __init__
"D202", # No blank lines allowed after function docstring
"D205", # 1 blank line required between summary line and description
"D210", # No whitespaces allowed surrounding docstring text
"D212", # Multi-line docstring summary should start at the first line
"D301", # Use r""" if any backslashes in a docstring
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood
"D415", # First line should end with a period, question mark, or exclamation point
]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["tmt.utils.field"]
[tool.ruff.lint.pydocstyle]
# "The PEP 257 convention includes all D errors apart from: D203, D212,
# D213, D214, D215, D404, D405, D406, D407, D408, D409, D410, D411, D413,
# D415, D416, and D417."
#
# See https://docs.astral.sh/ruff/faq/#does-ruff-support-numpy-or-google-style-docstrings for
# the most up-to-date info.
convention = "pep257"
property-decorators = ["tmt.utils.cached_property"]
[tool.ruff.lint.isort]
known-first-party = ["tmt"]
[tool.pytest.ini_options]
markers = [
"containers: tests which need to spawn containers",
"web: tests which need to access the web"
]
[tool.codespell]
ignore-words = "docs/codespell.dic"
exclude-file = "docs/codespell.ignore"
skip = "tests/execute/weird/data/weird.txt,tests/lint/plan/data/invalid_attr.fmf,tests/lint/plan/test.sh"