-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
201 lines (188 loc) · 6.97 KB
/
Copy pathpyproject.toml
File metadata and controls
201 lines (188 loc) · 6.97 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
[project]
name = "dexpace-sdk-workspace"
version = "0.0.0"
description = "Workspace root for the dexpace Python SDK packages (not published)."
requires-python = ">=3.12"
dependencies = [
"dexpace-sdk-core",
"dexpace-sdk-http-stdlib",
"dexpace-sdk-http-aiohttp",
"dexpace-sdk-http-httpx",
"dexpace-sdk-http-requests",
"dexpace-sdk-tck",
]
[tool.uv.workspace]
members = ["packages/*"]
[tool.uv.sources]
dexpace-sdk-core = { workspace = true }
dexpace-sdk-http-stdlib = { workspace = true }
dexpace-sdk-http-aiohttp = { workspace = true }
dexpace-sdk-http-httpx = { workspace = true }
dexpace-sdk-http-requests = { workspace = true }
dexpace-sdk-tck = { workspace = true }
[dependency-groups]
dev = [
"pytest>=9.1.0",
"pytest-cov>=4.1",
"pytest-asyncio>=1.4.0",
"hypothesis>=6.100",
"ruff>=0.15.17",
"mypy>=1.10",
"import-linter>=2.0",
]
[tool.pytest.ini_options]
testpaths = [
"packages/dexpace-sdk-tck/src/dexpace/sdk/tck",
"packages/dexpace-sdk-core/tests",
"packages/dexpace-sdk-http-stdlib/tests",
"packages/dexpace-sdk-http-aiohttp/tests",
"packages/dexpace-sdk-http-httpx/tests",
"packages/dexpace-sdk-http-requests/tests",
"examples/petstore/tests",
]
# The TCK battery + its self-tests ship inside the installed ``dexpace.sdk.tck``
# namespace package (so ``pytest --pyargs dexpace.sdk.tck`` certifies an adapter
# externally). ``consider_namespace_packages`` makes pytest import those modules
# under their full ``dexpace.sdk.tck.*`` names — the same module objects the
# adapter conftests import ``SYNC_HARNESS_FACTORIES`` / ``ASYNC_HARNESS_FACTORIES``
# from — so registration and the battery share one registry, not two.
consider_namespace_packages = true
# The petstore canary lives outside the packaged workspace members, so its
# generated SDK is importable in tests without an editable install.
pythonpath = ["examples/petstore/src"]
addopts = "-ra --strict-markers"
asyncio_mode = "auto"
markers = [
"req(requirement_id): mark a test as covering a spec requirement id (e.g. req(\"RETRY-19\")); consumed by tools/traceability_audit.py",
]
filterwarnings = [
# First-party suites run warnings-as-errors. The bare "error" entry already
# promotes every category (DeprecationWarning included); the explicit
# "error::DeprecationWarning" line pins that NFR contract literally, so the
# gate keeps catching deprecations even if "error" is ever narrowed.
"error",
"error::DeprecationWarning",
# Scoped waiver: pytest-asyncio raises its own DeprecationWarnings from
# inside the plugin. Ignore only those (listed last so it wins over the
# error filters above) — first-party deprecations still fail the run.
"ignore::DeprecationWarning:pytest_asyncio.*",
]
[tool.coverage.run]
branch = true
source = ["dexpace.sdk"]
[tool.coverage.report]
# Aggregate line+branch coverage gate, enforced as blocking in CI (the
# `coverage` job in .github/workflows/ci.yml). The tree currently measures
# ~94%; 80% is the contractual floor that holds the line against regressions,
# not a target to code down to.
fail_under = 80
show_missing = true
skip_covered = true
exclude_also = [
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
[tool.ruff]
line-length = 100
target-version = "py312"
src = ["packages/dexpace-sdk-core/src", "packages/dexpace-sdk-core/tests",
"packages/dexpace-sdk-http-stdlib/src", "packages/dexpace-sdk-http-stdlib/tests",
"packages/dexpace-sdk-http-aiohttp/src", "packages/dexpace-sdk-http-aiohttp/tests",
"packages/dexpace-sdk-http-httpx/src", "packages/dexpace-sdk-http-httpx/tests",
"packages/dexpace-sdk-http-requests/src", "packages/dexpace-sdk-http-requests/tests",
"packages/dexpace-sdk-tck/src",
"examples/petstore/src", "examples/petstore/tests"]
[tool.ruff.lint]
select = [
"E",
"W",
"F",
"I",
"N",
"B",
"UP",
"SIM",
"RUF",
]
ignore = [
"E501",
"B008",
]
[tool.ruff.lint.per-file-ignores]
"**/tests/**" = ["B011", "RUF012"]
# HttpTracer is an adapter-style base: every event method ships a no-op default
# so subclasses override only the events they consume. B024/B027 flag exactly
# that intentional pattern.
"**/instrumentation/http_tracer.py" = ["B024", "B027"]
[tool.mypy]
python_version = "3.12"
strict = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true
disallow_untyped_defs = true
disallow_any_generics = true
namespace_packages = true
explicit_package_bases = true
# Each transport-adapter package ships a thin tests/conftest.py that registers
# its harness into the shared transport-conformance battery. Those shims all
# resolve to the bare module name "conftest" and collide in mypy's flat module
# namespace (core/tests avoids this by being a package via tests/__init__.py;
# the adapter test dirs deliberately are not, to keep pytest's rootdir-relative
# collection). The substantive, typed harness code lives in each package's
# uniquely-named *_harness.py / *_conformance_harness.py module, which mypy
# still type-checks in full — only the registration shims are excluded here.
exclude = [
"packages/dexpace-sdk-http-[^/]+/tests/conftest\\.py$",
]
mypy_path = [
"packages/dexpace-sdk-core/src",
"packages/dexpace-sdk-http-stdlib/src",
"packages/dexpace-sdk-http-aiohttp/src",
"packages/dexpace-sdk-http-httpx/src",
"packages/dexpace-sdk-http-requests/src",
"packages/dexpace-sdk-tck/src",
"examples/petstore/src",
]
files = [
"packages/dexpace-sdk-core/src",
"packages/dexpace-sdk-core/tests",
"packages/dexpace-sdk-http-stdlib/src",
"packages/dexpace-sdk-http-stdlib/tests",
"packages/dexpace-sdk-http-aiohttp/src",
"packages/dexpace-sdk-http-aiohttp/tests",
"packages/dexpace-sdk-http-httpx/src",
"packages/dexpace-sdk-http-httpx/tests",
"packages/dexpace-sdk-http-requests/src",
"packages/dexpace-sdk-http-requests/tests",
"packages/dexpace-sdk-tck/src",
"examples/petstore/src",
"examples/petstore/tests",
]
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
disallow_untyped_decorators = false
disallow_untyped_calls = false
warn_return_any = false
# The TCK's own pytest bodies (the battery + its packaging/import self-tests)
# and its conftest are test code, not library surface, so they get the same
# relaxations as every other `tests.*` module. The TCK's *library* modules
# (`harness`, `fake_transport`, `golden_corpus.*`) are deliberately excluded
# from this list and stay under full `--strict`, since they are the public
# certification seam adapters compile against.
[[tool.mypy.overrides]]
module = [
"dexpace.sdk.tck.conftest",
"dexpace.sdk.tck.test_async_contract",
"dexpace.sdk.tck.test_corpus_packaging",
"dexpace.sdk.tck.test_import_discipline",
"dexpace.sdk.tck.test_sync_contract",
]
disallow_untyped_defs = false
disallow_untyped_decorators = false
disallow_untyped_calls = false
warn_return_any = false
[[tool.mypy.overrides]]
module = "furl.*"
ignore_missing_imports = true