-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
197 lines (175 loc) · 5.35 KB
/
Copy pathpyproject.toml
File metadata and controls
197 lines (175 loc) · 5.35 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
[project]
name = "clientwright"
dynamic = ["version"]
description = "HTTP client platform: one resilience and observability core with adapters for httpx, aiohttp, requests, urllib3 and friends"
readme = "README.md"
requires-python = ">=3.12"
# SPDX expression + a shipped file: PyPI shows "Apache-2.0" instead of the whole
# license text, so the OSI classifier must NOT also be present (PEP 639).
license = "Apache-2.0"
license-files = ["LICENSE"]
authors = [{ name = "Alex Shalaev", email = "shalaevad.alexey@gmail.com" }]
keywords = [
"http",
"http-client",
"httpx",
"aiohttp",
"requests",
"urllib3",
"retry",
"circuit-breaker",
"resilience",
"timeout",
"deadline",
"observability",
"prometheus",
"opentelemetry",
]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Monitoring",
"Typing :: Typed",
]
dependencies = []
[project.urls]
Repository = "https://github.com/bedrock-python/clientwright"
Documentation = "https://bedrock-python.github.io/clientwright/"
Changelog = "https://github.com/bedrock-python/clientwright/blob/master/CHANGELOG.md"
"Bug Tracker" = "https://github.com/bedrock-python/clientwright/issues"
[project.optional-dependencies]
httpx = ["httpx>=0.28,<1"]
httpx2 = ["httpx2>=2,<3"]
aiohttp = ["aiohttp>=3.12,<4"]
requests = ["requests>=2.32,<3"]
urllib3 = ["urllib3>=2.2,<3"]
metrics = ["prometheus-client>=0.20"]
tracing = ["opentelemetry-api>=1.26"]
observability = ["clientwright[metrics,tracing]"]
deadline = ["deadline-budget>=0.1,<1"]
dishka = ["dishka>=1.4"]
all = ["clientwright[httpx,httpx2,aiohttp,requests,urllib3,observability,deadline,dishka]"]
[dependency-groups]
test = [
"pytest>=9.0.2",
"pytest-asyncio>=1.3.0",
"pytest-cov>=7.0.0",
"freezegun>=1.5.5",
"opentelemetry-sdk>=1.26",
"hypothesis>=6.115",
]
docs = [
"zensical>=0.0.37",
"mkdocstrings-python>=2.0.3",
]
dev = [
"ruff>=0.15.1",
"mypy>=1.19.1",
"pre-commit>=4.5.1",
"import-linter>=2.3",
{ include-group = "test" },
]
[tool.uv]
link-mode = "copy"
[tool.hatch.version]
path = "clientwright/__version__.py"
[tool.hatch.build.targets.wheel]
packages = ["clientwright"]
[tool.hatch.build.targets.sdist]
# Tests ship with the sdist so downstream packagers can run the suite from it.
include = ["/clientwright", "/tests", "/README.md", "/LICENSE", "/CHANGELOG.md"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.mypy]
python_version = "3.12"
files = ["clientwright"]
mypy_path = ["."]
check_untyped_defs = true
disallow_untyped_defs = true
implicit_reexport = false
ignore_missing_imports = true
show_error_codes = true
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unreachable = true
[tool.ruff]
line-length = 120
target-version = "py312"
[tool.ruff.lint]
select = ["F", "E", "W", "I", "B", "N", "S", "C4", "DTZ", "SIM", "TRY", "PERF", "RUF", "UP", "ANN", "T20", "PTH", "PLC", "PLE", "PLW"]
ignore = ["TRY003", "S101", "ANN401", "RUF012", "S104", "S105", "S106", "ANN204", "DTZ", "ANN", "N802", "PERF401", "SIM105", "S607"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
testpaths = ["tests"]
pythonpath = ["."]
addopts = [
"-v",
"--strict-markers",
"--tb=short",
]
markers = [
"unit: mark a test as a unit test.",
"integration: mark a test as an integration test.",
"live: hits real third-party endpoints over the public internet; opt-in only.",
]
[tool.coverage.run]
source = ["clientwright"]
omit = [
"tests/*",
"*/test_*.py",
]
[tool.coverage.report]
exclude_also = [
"pragma: no cover",
"if TYPE_CHECKING:",
"@overload",
"raise NotImplementedError",
"\\.\\.\\.",
]
# The layering the whole design rests on: deleting adapters/ must leave core/
# importable. Checked by `make check` and the CI lint job.
[tool.importlinter]
root_package = "clientwright"
include_external_packages = true
[[tool.importlinter.contracts]]
name = "Core never depends on adapters"
type = "forbidden"
source_modules = ["clientwright.core"]
forbidden_modules = ["clientwright.adapters"]
[[tool.importlinter.contracts]]
name = "Core is stdlib-only"
type = "forbidden"
source_modules = ["clientwright.core"]
forbidden_modules = [
"httpx", "httpx2", "aiohttp", "requests", "urllib3", "niquests",
"tornado", "aiosonic", "pydantic", "dishka", "prometheus_client",
"opentelemetry", "structlog", "sentry_sdk",
]
# _httpx_shared is deliberately OUTSIDE this list: it is the one sanctioned
# sharing channel of the httpx family (httpx and httpx2 both import it).
[[tool.importlinter.contracts]]
name = "Adapters never depend on each other"
type = "independence"
modules = [
"clientwright.adapters.httpx",
"clientwright.adapters.httpx2",
"clientwright.adapters.aiohttp",
"clientwright.adapters.requests",
"clientwright.adapters.urllib3",
"clientwright.adapters.observability",
]