-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpyproject.toml
More file actions
256 lines (233 loc) · 7.83 KB
/
pyproject.toml
File metadata and controls
256 lines (233 loc) · 7.83 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
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
[project]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Testing",
]
dependencies = [
"urllib3>=2.1.0,<3.0.0",
"python-dateutil>=2.8.2",
"pydantic>=2",
"typing-extensions>=4.7.1",
"lazy-imports>=1,<2",
]
description = "A system to store and query test results"
dynamic = ["version"]
license = "MIT"
authors = [{name = "Raoul Snyman"}]
maintainers = [{name = "Mike Shriver", email = "mshriver@redhat.com"}]
name = "ibutsu-client"
readme = "README.md"
requires-python = ">=3.11"
keywords = ["OpenAPI", "OpenAPI-Generator", "Ibutsu API", "testing", "results"]
[project.urls]
Source = "https://github.com/ibutsu/ibutsu-client-python"
Tracker = "https://github.com/ibutsu/ibutsu-client-python/issues"
[dependency-groups]
test = [
"pytest",
"pytest-cov",
"pytest-mock",
"coverage[toml]",
]
dev = [
"pre-commit",
"mypy",
"types-python-dateutil",
]
[build-system]
build-backend = "hatchling.build"
requires = [
"hatchling>=1.3.1",
"hatch-vcs",
]
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.targets.sdist]
include = ["/ibutsu_client", "/test", "/docs", "/requirements.txt", "/test-requirements.txt"]
[tool.hatch.build.targets.wheel]
packages = ["/ibutsu_client"]
[tool.hatch.envs.default]
dependencies = [
"pytest",
"pytest-cov",
"pytest-mock",
"pytest-xdist",
"pytest-rerunfailures",
"coverage[toml]",
"pre-commit",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args}"
test-cov = "pytest --cov=ibutsu_client --cov-report=xml --cov-report=term-missing --cov-report=html {args}"
cov-report = "coverage report"
cov-xml = "coverage xml"
cov-html = "coverage html"
lint = "pre-commit run --all-files"
# CI environment for testing multiple Python versions
[tool.hatch.envs.test-matrix]
template = "default"
[[tool.hatch.envs.test-matrix.matrix]]
python = ["3.11", "3.12", "3.13"]
[tool.mypy]
# Enable strict mode for maximum type safety
strict = true
# Additional strict settings
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true
strict_equality = true
no_implicit_reexport = true
# Override for generated client code - be more lenient
[[tool.mypy.overrides]]
module = ["ibutsu_client.*"]
ignore_missing_imports = true
follow_imports = "skip"
# Generated code may not follow strict typing
disallow_untyped_defs = false
disallow_incomplete_defs = false
check_untyped_defs = false
disallow_untyped_calls = false
disallow_untyped_decorators = false
warn_return_any = false
warn_unused_ignores = false
no_implicit_reexport = false
# Override for tests directory - be more lenient with pytest functions
[[tool.mypy.overrides]]
module = ["test.*"]
# Allow untyped function definitions for pytest functions
disallow_untyped_defs = false
# Allow incomplete type definitions in tests
disallow_incomplete_defs = false
# Don't require return type annotations for test functions
check_untyped_defs = false
# Allow untyped calls in tests for simplicity
disallow_untyped_calls = false
# Allow untyped decorators (common in pytest)
disallow_untyped_decorators = false
[tool.pytest.ini_options]
testpaths = ["test"]
# Only collect test classes from actual test files, not from imported modules
python_classes = ["Test*"]
python_files = ["test_*.py", "*_test.py"]
[tool.coverage.run]
source = ["ibutsu_client"]
branch = true
omit = [
"*/test/*",
"*/tests/*",
"*/test_*",
"*/conftest.py",
"*/__pycache__/*",
"*/venv/*",
"*/.venv/*",
]
[tool.coverage.report]
precision = 2
skip_empty = true
exclude_lines = [
# Pragmas and docstrings
"pragma: no cover",
"def __repr__",
# Defensive programming patterns
"raise AssertionError",
"raise NotImplementedError",
"assert False",
# Type checking blocks
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
# Abstract methods
"@abstractmethod",
"@abc.abstractmethod",
# Main guard
"if __name__ == .__main__.:",
# Debug-only code
"if self.debug:",
"if settings.DEBUG",
"if.*__debug__:",
"if 0:",
# Protocol definitions
"class .*\\bProtocol\\):",
"@overload",
"@typing.overload",
]
show_missing = true
[tool.coverage.html]
directory = "htmlcov"
[tool.coverage.xml]
output = "coverage.xml"
[tool.ruff]
line-length = 99
target-version = "py311"
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"ERA", # eradicate
"I", # isort
"N", # pep8-naming
"PIE", # flake8-pie
"PGH", # pygrep-hooks
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
]
ignore = [
"B905", # `zip()` without an explicit `strict=` parameter
"N806", # Variable in function should be lowercase - conflicts with generated API code
"N815", # Variable in class scope should not be mixedCase - conflicts with generated API code
]
[tool.ruff.lint.per-file-ignores]
"test/**" = [
"S101", # Use of assert detected
"N802", # Function name should be lowercase - test methods
"ERA001", # Found commented-out code - test comments
]
"ibutsu_client/**" = [
"N802", # Function name should be lowercase - generated code
"N803", # Argument name should be lowercase - generated code
"N805", # First argument of a method should be named `self` - Pydantic validators use `cls`
"N806", # Variable should be lowercase - generated code
"N815", # Variable should not be mixedCase - generated code
"N816", # Variable should not be mixedCase - generated code
"PGH004", # Use specific rule codes when using `ruff: noqa` - generated code
"SIM102", # Use a single `if` statement - generated code patterns
"SIM103", # Return the condition directly - generated code patterns
"SIM108", # Use ternary operator - generated code patterns
"SIM101", # Multiple isinstance calls - generated code patterns
"RUF015", # Prefer next(iter()) over single element slice - generated code
"RUF005", # Consider iterable unpacking - generated code patterns
"UP030", # Use implicit references for positional format fields - generated code
"UP031", # Use format specifiers instead of percent format - generated code
"E721", # Use `is` and `is not` for type comparisons - generated code
"B904", # Within except clause, raise exceptions with from - generated code
"F841", # Local variable assigned but never used - generated code
"RUF012", # Mutable class attributes should be annotated with ClassVar - generated code
"F821", # Undefined name - circular imports in generated code
"C408", # Unnecessary dict() call - generated code patterns
"SIM115", # Use context manager for opening files - generated code patterns
"ERA001", # Found commented-out code - generated code comments
"N801", # Class name should use CapWords - generated code utilities
"RUF002", # Docstring contains ambiguous unicode characters - generated code
"C409", # Unnecessary list literal passed to tuple() - generated code patterns
"N818", # Exception name should be named with an Error suffix - generated code
"SIM105", # Use contextlib.suppress(Exception) instead of try-except-pass - generated code
"TCH003", # Move standard library import into type-checking block - UUID needed at runtime for Pydantic
]
"setup.py" = [
"ERA001", # Found commented-out code - setup file comments
]
[tool.ruff.lint.isort]
known-first-party = ["ibutsu_client"]