forked from RedHatQE/openshift-virtualization-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
199 lines (182 loc) · 5.47 KB
/
pyproject.toml
File metadata and controls
199 lines (182 loc) · 5.47 KB
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
[tool.ruff]
preview = true
line-length = 120
fix = true
output-format = "grouped"
[tool.ruff.format]
exclude = [".git", ".venv", ".mypy_cache", ".tox", "__pycache__"]
[tool.ruff.lint]
# TODO: Each ignored rule below should be addressed in a dedicated PR.
ignore = [
"SIM102", # collapsible-if — nested ifs are often more readable
"SIM114", # combine if branches using logical or — reduces readability
"SIM117", # nested with statements — existing pattern, keep as-is
"C419", # unnecessary-comprehension-in-call — may change list vs generator semantics
"RUF015", # unnecessary-iterable-allocation-for-first-element — changes exception type
"DTZ005", # datetime.now() without tz — requires careful refactoring
"DTZ006", # datetime.fromtimestamp() without tz
"DTZ007", # naive datetime from strptime()
"BLE001", # blind exception catch — pre-existing, fix separately
"PYI036", # __exit__ parameter annotations
"PYI034", # __enter__ return type annotation
"EXE001", # shebang present but file not executable
"EXE002", # file executable but no shebang
"PLE0643", # expression likely to raise IndexError — needs per-case review
"PLW0604", # redundant global at module level — used in global_config files
"PLW1510", # subprocess.run without check — needs per-call review
"B005", # .strip() with multi-char string — intent-dependent
"B018", # useless expression — intent-dependent
"B023", # loop variable not bound in function — needs careful refactor
"G201", # .error(exc_info=True) vs .exception()
"SIM115", # context manager for file opening — may need structural changes
]
[tool.ruff.lint.per-file-ignores]
# F821: undefined name — global_config files use dynamic exec() loading via pytest_testconfig
"tests/global_config*.py" = ["F821"]
[tool.ruff.lint.isort]
order-by-type = true
known-third-party = [
"ocp_resources",
"ocp_utilities",
"timeout_sampler",
"pyhelper_utils",
]
[tool.mypy]
warn_unused_configs = true
warn_redundant_casts = true
[[tool.mypy.overrides]]
module = ["libs.*", "tests.network.libs.*", "tests.network.localnet.*"]
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
strict_equality = true
strict_concatenate = true
[project]
name = "openshift-virtualization-tests-4.22"
requires-python = ">=3.14"
version = "4.22"
description = "Tests for Openshift Virtualization"
authors = [{ "name" = "openshift-virtualization-tests" }]
dependencies = [
"bcrypt>=4.2.0",
"bitmath>=1.3.3.1",
"bs4>=0.0.2",
"click>=8.1.7",
"colorlog>=6.9.0",
"deepdiff>=8.0.1",
"dictdiffer>=0.9.0",
"docker>=7.1.0",
"importlib-metadata>=8.5.0",
"importlib-resources>=6.4.5",
"jinja2>=3.1.4",
"jira>=3.8.0",
"jsons>=1.6.3",
"kubernetes>=34.1.0",
"netaddr>=1.3.0",
"openshift-python-utilities>=6.0.0",
"openstacksdk>=4.1.0",
"pexpect>=4.9.0",
"podman>=5.2.0",
"pyhelper-utils>=2.0.2",
"pytest>=9.0.0",
"pytest-benchmark>=5.1.0",
"pytest-dependency>=0.6.0",
"pytest-order>=1.3.0",
"pytest-progress>=1.3.0",
"pytest-testconfig>=0.2.0",
"python-benedict>=0.34.0",
"python-rrmngmnt>=0.1.32",
"python-utility-scripts>=1.0.1",
"pyvmomi>=8.0.3.0.1",
"pyyaml>=6.0.2",
"requests>=2.32.3",
"sh>=2.1.0",
"shortuuid>=1.0.13",
"sqlalchemy>=2.0.36",
"timeout-sampler>=1.0.1",
"urllib3>=2.2.3",
"xmltodict>=0.14.2",
"python-simple-logger>=2.0.13",
"pytest-html>=4.1.1",
"openshift-python-wrapper>=11.0.126",
"cachetools>=6.2.2",
"dacite>=1.9.2",
"python-dotenv>=1.2.1",
"pytest-jira>=0.3.22",
]
[project.optional-dependencies]
# Dependencies for utilities unit testing
utilities-test = [
"pytest>=9.0.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.14.0",
"pytest-xdist>=3.5.0",
"pytest-timeout>=2.2.0",
"pytest-watch>=4.2.0",
]
[project.scripts]
quarantine-dashboard = "scripts.quarantine_stats.generate_dashboard:main"
pytest-marker-analyzer = "scripts.tests_analyzer.pytest_marker_analyzer:main"
compare-coderabbit-decisions = "scripts.tests_analyzer.compare_coderabbit_decisions:main"
[tool.hatch.build.targets.wheel]
packages = ["libs", "scripts", "tests", "utilities"]
[dependency-groups]
dev = [
"ipdb>=0.13.13",
"ipython>=8.12.3",
"pytest-repeat>=0.9.4",
]
[tool.uv.sources]
# Utilities Unit Testing Configuration
[tool.pytest.ini_options]
minversion = "9.0"
testpaths = ["utilities/unittests"]
python_files = "test_*.py"
python_classes = "Test*"
python_functions = "test_*"
addopts = """
-ra
--strict-markers
--strict-config
--cov=utilities
--cov-branch
--cov-report=term-missing:skip-covered
--cov-report=html:utilities/htmlcov
--cov-report=xml:utilities/coverage.xml
--cov-fail-under=90
"""
# Coverage configuration for utilities unit tests
[tool.coverage.run]
source = ["utilities"]
omit = [
"*/tests/*",
"*/__pycache__/*",
"*/manifests/*",
"*.pyc",
"*/test_*.py",
"__init__.py",
"utilities/unittests/conftest.py",
# Large modules with partial test coverage - excluded until full coverage is achieved
"utilities/infra.py",
"utilities/network.py",
"utilities/storage.py",
"utilities/virt.py",
"utilities/junit_ai_utils.py",
]
[tool.coverage.report]
precision = 2
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if TYPE_CHECKING:",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"pass",
"except ImportError:",
]
show_missing = true
skip_covered = false
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"