forked from teemtee/tmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
262 lines (235 loc) · 6.34 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
[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
"fmf>=1.2.1",
"jinja2>=2.11.3", # 3.1.2 / 3.1.2
"pint>=0.16.1", # 0.16.1 / 0.22
"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, <2.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 = [
"sphinx_rtd_theme>=1.2.2", # The theme pulls a specific sphinx version
"docutils>=0.18.1",
]
[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",
]
[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",
"requre",
"yq==3.1.1",
"pre-commit",
"types-Markdown",
"types-requests",
"types-setuptools",
"types-jsonschema",
"types-urllib3",
"types-jinja2",
"types-babel",
]
features = ["all"]
[tool.hatch.envs.dev.scripts]
lint = ["autopep8 {args:.}", "ruff --fix {args:.}"]
type = ["mypy {args:tmt}"]
check = ["lint", "type"]
unit = "pytest -vvv -ra --showlocals tests/unit"
smoke = "pytest -vvv -ra --showlocals tests/unit/test_cli.py"
cov = [
"coverage run --source=tmt -m pytest -vvv -ra --showlocals tests",
"coverage report",
"coverage annotate",
]
requre = [
"cd {root}/tests/integration",
"pytest -vvv -ra --showlocals",
"requre-patch purge --replaces :milestone_url:str:SomeText --replaces :latency:float:0 tests/integration/test_data/test_nitrate/*",
]
[tool.hatch.envs.test]
template = "dev"
description = "Run scripts with multiple Python versions"
[[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.11"]
[tool.hatch.envs.docs]
dependencies = ["tmt[docs]"]
detached = true
[tool.hatch.envs.docs.scripts]
html = "cd {root}/docs && make html"
man = [
"cp {root}/docs/header.txt {root}/man.rst",
"tail -n+8 README.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.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"
select = [
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle
"I", # isort
"N", # pep8-naming
"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
]
ignore = [
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ...
"COM812", # Trailing comma missing
"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`
]
[tool.ruff.flake8-bugbear]
extend-immutable-calls = ["tmt.utils.field"]
[tool.ruff.isort]
known-first-party = ["tmt"]
[tool.pytest.ini_options]
markers = ["web: tests which need to access the web"]