-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpyproject.toml
More file actions
265 lines (244 loc) · 6.23 KB
/
pyproject.toml
File metadata and controls
265 lines (244 loc) · 6.23 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
257
258
259
260
261
262
263
264
265
[project]
name = "connectrpc"
version = "0.9.0"
description = "Server and client runtime library for Connect RPC"
readme = "README.md"
requires-python = ">= 3.10"
license = "Apache-2.0"
license-files = ["LICENSE"]
maintainers = [
{ name = "Anuraag Agrawal", email = "anuraaga@gmail.com" },
{ name = "Spencer Nelson", email = "spencer@firetiger.com" },
{ name = "Stefan VanBuren", email = "svanburen@buf.build" },
{ name = "Yasushi Itoh", email = "i2y.may.roku@gmail.com" },
]
keywords = ["connect", "grpc", "http", "protobuf", "rpc"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = ["protobuf>=5.28", "pyqwest>=0.4.1"]
[project.urls]
Documentation = "https://connectrpc.com/docs/python/getting-started/"
Homepage = "https://github.com/connectrpc/connect-python"
Issues = "https://github.com/connectrpc/connect-python/issues"
Repository = "https://github.com/connectrpc/connect-python"
[dependency-groups]
dev = [
# Needed to enable HTTP/2 in daphne
"Twisted[tls,http2]==25.5.0",
"asgiref==3.11.1",
"brotli==1.2.0",
"connect-python-example",
"daphne==4.2.1",
"granian==2.7.2",
"grpcio-tools==1.80.0",
"gunicorn==25.3.0",
"hypercorn==0.18.0",
"just-bin==1.48.1; sys_platform != 'win32'",
"pyright[nodejs]==1.1.408",
"pyvoy==0.3.0",
"ruff==0.15.9",
"tombi==0.9.14",
"typing_extensions==4.15.0",
"uvicorn==0.43.0",
"zstandard==0.25.0",
# dev dependencies only used in subprojects. Optimal structure would include these
# in the subproject itself, but then `uv sync` does not install them from the
# workspace root. We strategically keep them here instead so the entire workspace
# is ready for editing in an IDE with a simple sync command.
# If the below issue is resolved, we can move them back to subprojects and configure
# our default sync setting as --all-packages.
# https://github.com/astral-sh/uv/issues/5737
"opentelemetry-instrumentation-asgi==0.61b0",
"opentelemetry-instrumentation-wsgi==0.61b0",
"opentelemetry-sdk==1.40.0",
# Versions locked in constraint-dependencies
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-timeout",
]
docs = ["mkdocstrings-python==2.0.3", "zensical==0.0.31"]
[build-system]
requires = ["uv_build>=0.11.0,<0.12.0"]
build-backend = "uv_build"
[tool.pyright]
exclude = [
# Defaults.
"**/node_modules",
"**/__pycache__",
"**/.*",
".venv",
# GRPC python files don't typecheck on their own.
# See https://github.com/grpc/grpc/issues/39555
"**/*_pb2_grpc.py",
# TODO: Work out the import issues to allow it to work.
"conformance/**",
]
[tool.pytest]
# Turn all warnings into errors
filterwarnings = ["error"]
strict = true
testpaths = ["test"]
timeout = "1800" # 30 min
[tool.ruff]
# Don't run ruff on generated code from external plugins.
extend-exclude = ["*_pb2.py", "*_pb2.pyi"]
[tool.ruff.format]
skip-magic-trailing-comma = true
docstring-code-format = true
[tool.ruff.lint]
extend-select = [
# Same order as listed on https://docs.astral.sh/ruff/rules/
"YTT",
"ANN",
"ASYNC",
"S",
"FBT",
"B",
"A",
"COM818", # Other comma rules are handled by formatting
"C4",
"DTZ",
"T10",
"EM",
"EXE",
"FA",
"ISC",
"ICN",
"LOG",
"G",
"INP",
"PIE",
"T20",
"PYI",
"PT",
"Q004", # Other quote rules are handled by formatting
"RSE",
"RET",
# This rule is a bit strict since accessing private members within this package can be
# useful to reduce public API exposure. But it is important to not access private members
# of external dependencies so we enable it and ignore the locations where we need to.
"SLF",
"SIM",
"SLOT",
"TID",
# TODO: Update TODOs then enable
# "TD",
"TC",
"ARG",
"PTH",
"FLY",
"I",
"N",
"PERF",
"E",
"W",
# TODO: Flesh out docs and enable
# "DOC"
# "D",
"F",
"PGH",
"PLC",
"PLE",
"PLW",
"UP",
"FURB",
"RUF",
# TODO: See if it makes sense to enable after a pass at reducing code duplication
# "TRY",
]
# Document reasons for ignoring specific linting errors
ignore = [
# Not applicable
"AIR",
# Dangerous false positives https://github.com/astral-sh/ruff/issues/4845
"ERA",
# Not Applicable
"FAST",
# Important to call user callbacks safely
"BLE",
# stdlib includes a module named code. This is less of an issue since users need to import a module so allow it
"A005",
# TODO: Consider using copyright headers
"CPY",
# Not Applicable
"DJ",
# It's fine to have TODOs
"FIX",
# Not Applicable
"INT",
# Even prevents pytest.raises around an iteration which is too strict
"PT012",
# Triggers for protocol implementations that don't need the arg too
"ARG002",
# Complexity checks usually reduce readability
"C90",
# Not Applicable
"NPY",
# Not Applicable
"PD",
# We use the Exception suffix instead
"N818",
# Handled by formatting
"E111",
"E114",
"E117",
"E501",
"W191",
# Low signal-to-noise ratio
"PLR",
]
typing-extensions = false
[tool.ruff.lint.per-file-ignores]
"conformance/test/**" = ["ANN", "INP", "SLF", "SIM115", "S101", "D"]
"example/**" = [
"ANN",
"S", # Keep examples simpler, e.g. allow normal random
"T20",
"D",
]
"**/test_*.py" = [
"ANN",
"S101",
"S603",
"S607",
"FBT",
"EM",
"INP",
"SLF",
"PERF",
"D",
]
"**/*_grpc.py" = ["N", "FBT"]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
split-on-trailing-comma = false
[tool.uv]
constraint-dependencies = [
"coverage==7.13.2",
"pytest==9.0.2",
"pytest-asyncio==1.3.0",
"pytest-cov==7.0.0",
"pytest-timeout==2.4.0",
]
[tool.uv.build-backend]
module-name = "connectrpc"
[tool.uv.workspace]
members = ["connectrpc-otel", "example"]
[tool.uv.sources]
connectrpc = { workspace = true }
connect-python-example = { workspace = true }
connectrpc-otel = { workspace = true }