-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathpyproject.toml
More file actions
215 lines (194 loc) · 6.3 KB
/
Copy pathpyproject.toml
File metadata and controls
215 lines (194 loc) · 6.3 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
[project]
name = "connectrpc"
version = "0.11.1"
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 = "stefan@vanburen.xyz" },
{ 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-py>=0.3.0",
"pyqwest>=0.5.1",
]
[project.urls]
Documentation = "https://connectrpc.com/docs/python/getting-started/"
Homepage = "https://github.com/connectrpc/connect-py"
Issues = "https://github.com/connectrpc/connect-py/issues"
Repository = "https://github.com/connectrpc/connect-py"
[dependency-groups]
dev = [
# Install all packages to be available in docs building, etc.
"connectrpc-grpcreflect",
"connectrpc-otel",
"example",
"protoc-gen-connectrpc",
"asgiref==3.12.1",
"brotli==1.2.0",
"buf-bin==1.72.0",
"granian==2.8.1",
"grpcio-tools==1.83.0",
"gunicorn==26.0.0",
"hypercorn==0.18.0",
"poethepoet==0.48.0",
"pytest==9.1.1",
"pytest-asyncio==1.4.0",
"pytest-cov==7.1.0",
"pytest-timeout==2.5.0",
"pyvoy==1.0.0",
"ruff==0.16.3",
"tombi==1.4.1",
"ty==0.0.72",
"types-grpcio==1.83.0.20260730",
"types-protobuf==7.34.1.20260816",
"typing_extensions==4.16.0",
"uvicorn==0.52.3",
"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.65b0",
"opentelemetry-instrumentation-wsgi==0.65b0",
"opentelemetry-sdk==1.44.0",
"protobuf>=5.28",
"protoc-gen-grpc-py==0.3.0",
"protoc-gen-py==0.3.0",
]
docs = ["mkdocstrings-python==2.0.6", "zensical==0.0.55"]
[build-system]
requires = ["uv_build>=0.12.0,<0.13.0"]
build-backend = "uv_build"
[tool.pytest]
# Turn all warnings into errors
filterwarnings = [
"error",
# Workaround https://github.com/open-telemetry/opentelemetry-python/issues/5231
"ignore:SelectableGroups dict interface is deprecated. Use select.",
]
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]
typing-extensions = false
select = ["ALL"]
ignore = [
# Rules recommended to ignore when using ruff formatting
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E111",
"E114",
"E117",
"E501",
"D206",
"D300",
"Q",
"COM812",
"COM819",
"CPY001", # We don't use copyright headers
"TRY301", # Abstract `raise` to an inner function - prevents a common pattern of having different validation points when creating a single response
"SLF001", # Private member accessed
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"PLR2004", # Magic value used in comparison - not helpful to name obvious constants
# Complexity rules: humans reviewing code can judge whether complexity is justified.
"C901", # McCabe complexity
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments in function definition
"PLR0914", # Too many local variables
"PLR0915", # Too many statements
"PLR0916", # Too many boolean expressions
"PLR0917", # Too many positional arguments
"PLR1702", # Too many nested blocks
"PT012", # pytest.raises should surround a single statement - too restrictive, author can decide
# TODO rules
"TD",
"FIX002", # Line contains TODO, consider resolving the issue
]
[tool.ruff.lint.per-file-ignores]
"conformance/test/**" = ["ANN", "BLE", "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]
combine-as-imports = true
required-imports = ["from __future__ import annotations"]
split-on-trailing-comma = false
[tool.ty.src]
exclude = [
# gRPC generated code references `grpc.experimental`, which is not exposed by the
# `grpc` package's public API. See https://github.com/grpc/grpc/issues/39555.
"**/*_pb2_grpc.py",
# Workaround lack of monorepo support by excluding subproject code from top-level project.
# https://docs.astral.sh/ty/reference/typing-faq/#does-ty-support-monorepos
# https://github.com/astral-sh/ty/issues/819
"connectrpc-grpcreflect",
"connectrpc-otel",
"example",
]
[tool.ty.environment]
# Conformance test files import generated code as `from gen.connectrpc...` and
# sibling modules like `_util`/`_cov_embed`. Pytest and the launched server/client
# subprocesses put `conformance/test/` on sys.path; teach ty to do the same.
extra-paths = ["conformance/test"]
[tool.uv.build-backend]
module-name = "connectrpc"
[tool.uv.workspace]
members = [
"connectrpc-grpcreflect",
"connectrpc-otel",
"example",
"protoc-gen-connectrpc",
]
[tool.uv.sources]
connectrpc = { workspace = true }
connectrpc-grpcreflect = { workspace = true }
connectrpc-otel = { workspace = true }
protoc-gen-connectrpc = { workspace = true }
example = { workspace = true }